Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Extends the action to support both stdio and http MCP upstream connections with type-specific configuration parameters.

Changes

Action Interface (action.yml)

  • Inputs: Added type (stdio/http), command, args, env for stdio; url, headers for http; container, container-image, container-version, logs-dir for general config
  • Outputs: Renamed api-keytoken for consistency; kept url, port

Input Marshaling (src/main.ts)

  • JSON parsing with runtime type validation for args (array), env/headers (string-keyed objects)
  • Type-based validation: command required for stdio, url required for http
  • Error messages include actual vs expected types (e.g., "must be JSON array, received: object")
  • Support for container, container-image, and container-version inputs

Upstream Configuration (src/server.ts)

  • Extended UpstreamConfig interface with env and headers fields
  • Pass environment variables to StdioClientTransport
  • Log warning via core.warning() when headers provided (MCP SDK limitation)

Documentation

  • README.md: Complete API documentation with usage examples
  • CONTRIBUTING.md: Development instructions (install, test, build, lint, format)

Example Usage

# stdio transport with environment
- uses: githubnext/gh-aw-mcp-container-action@v1
  with:
    type: stdio
    command: node
    args: '["mcp-server.js", "--port", "3000"]'
    env: '{"NODE_ENV": "production", "DEBUG": "mcp:*"}'

# http transport with auth headers
- uses: githubnext/gh-aw-mcp-container-action@v1
  with:
    type: http
    url: https://api.example.com/mcp
    headers: '{"Authorization": "Bearer token"}'

Notes

  • Supports container, container-image, and container-version inputs for container configuration
  • HTTP headers accepted but logged as warning (SDK doesn't support custom headers yet)

[!WARNING]

Original prompt

Update the action inputs and outputs t:

Inputs:

  • type: stdio/http

  • container:string

  • container-image: string

  • command: string

  • args: string[]

  • env: Map<string, string>

  • url: string

  • headers: Map<string,string>

  • logs-dir: string

Outputs:

  • url: string
  • port: number
  • token: string

Update the action.yml and the main.ts glue code that marshals the data using core APIs.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


#### General:

- **`container-image`**: Container image to run
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this one should have been "container-version", and keep "container"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added container-version input in action.yml and removed the deprecated status from container. Both fields are now documented in the README. (commit 6295988)

README.md Outdated
container-image: my-mcp-server:latest
```
## Development
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot move development guide in CONTRIBUTING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created CONTRIBUTING.md and moved all development instructions there. README now includes a link to the contributing guide. (commit 6295988)

Copilot AI changed the title [WIP] Update action inputs and outputs in action.yml and main.ts Add comprehensive input/output schema for stdio and http MCP transports Nov 7, 2025
Copilot AI requested a review from pelikhan November 7, 2025 12:47
Copilot finished work on behalf of pelikhan November 7, 2025 12:47
Copilot finished work on behalf of pelikhan November 7, 2025 12:57
@pelikhan pelikhan marked this pull request as ready for review November 7, 2025 13:00
@pelikhan pelikhan merged commit 07deffb into main Nov 7, 2025
6 of 10 checks passed
@pelikhan pelikhan deleted the copilot/update-action-inputs-outputs branch November 7, 2025 13:00
Copilot AI added a commit that referenced this pull request Nov 7, 2025
Merged commits:
- Add vitest test suites for TypeScript functions (#8)
- Add comprehensive input/output schema for stdio and http MCP transports (#7)
- Add agentic workflow for action metadata consistency checking (#11)
- Add agentic workflow for automated super-linter analysis and reporting (#4)

Resolved merge conflict in dist/index.js.map by rebuilding the package.

Co-authored-by: pelikhan <[email protected]>
Copilot AI added a commit that referenced this pull request Nov 7, 2025
Merged commits from main:
- Move test files to src/ directory alongside source files (#12)
- Add daily test improver agentic workflow (#10)
- Add agentic workflow for automated super-linter analysis and reporting (#4)
- Add agentic workflow for action metadata consistency checking (#11)
- Add comprehensive input/output schema for stdio and http MCP transports (#7)
- Add vitest test suites for TypeScript functions (#8)

Used merge=ours strategy for dist/index.js.map to keep our generated version.
All 49 tests pass.

Co-authored-by: pelikhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants