Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new mcp-container-manager MCP server package that exposes the create-a-container REST API as MCP tools (generated from the OpenAPI spec), alongside small OpenAPI and API-docs serving improvements to support that integration.
Changes:
- Added a new Python package (
mcp-container-manager) to run an MCP server backed by the existing OpenAPI spec. - Updated
create-a-containerto serve the OpenAPI spec directly as/api/openapi.jsonand/api/openapi.yamland reorganized Swagger UI setup. - Made small OpenAPI schema/description fixes and added end-user documentation for VS Code MCP setup.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| mie-opensource-landing/docs/users/mcp-server.mdx | Adds user-facing VS Code setup instructions for the MCP server. |
| mcp-container-manager/pyproject.toml | Defines the new Python package metadata, deps, and console script entrypoint. |
| mcp-container-manager/mcp_container_manager/server.py | Implements the MCP server bootstrap and OpenAPI spec URL wiring. |
| mcp-container-manager/README.md | Documents installation/usage and provides MCP client configuration examples. |
| mcp-container-manager/.python-version | Pins Python version for the new package. |
| mcp-container-manager/.gitignore | Ignores local Python build/venv artifacts for the new package. |
| create-a-container/server.js | Adds endpoints to serve OpenAPI as JSON/YAML and relocates Swagger UI setup. |
| create-a-container/openapi.yaml | Tweaks schema nullability and fixes a YAML description formatting issue. |
| from awslabs.openapi_mcp_server.server import load_config, create_mcp_server, setup_signal_handlers | ||
|
|
||
| def main(): | ||
| os.environ['API_SPEC_URL'] = f'{os.environ['API_BASE_URL']}/api/openapi.json' |
There was a problem hiding this comment.
This f-string is syntactically invalid because the outer quotes and the inner os.environ['API_BASE_URL'] quotes conflict. This prevents the MCP server from starting. Use different quoting (or os.environ["API_BASE_URL"]) when building the URL.
| os.environ['API_SPEC_URL'] = f'{os.environ['API_BASE_URL']}/api/openapi.json' | |
| os.environ['API_SPEC_URL'] = f'{os.environ["API_BASE_URL"]}/api/openapi.json' |
| mcp_server = create_mcp_server(config) | ||
| mcp_server._client.headers['accept'] = 'application/json' |
There was a problem hiding this comment.
This mutates mcp_server._client, which is a private implementation detail in awslabs-openapi-mcp-server/FastMCPOpenAPI and isn’t a supported extension point. Prefer configuring default headers when constructing the underlying HTTP client (via the library’s client factory / config) so upgrades don’t break this.
| mcp_server = create_mcp_server(config) | |
| mcp_server._client.headers['accept'] = 'application/json' | |
| if hasattr(config, "client_headers"): | |
| client_headers = getattr(config, "client_headers") or {} | |
| if not isinstance(client_headers, dict): | |
| client_headers = dict(client_headers) | |
| client_headers["accept"] = "application/json" | |
| setattr(config, "client_headers", client_headers) | |
| mcp_server = create_mcp_server(config) |
| os.environ['API_SPEC_URL'] = f'{os.environ['API_BASE_URL']}/api/openapi.json' | ||
| os.environ['AUTH_TYPE'] = 'bearer' | ||
| config = load_config() | ||
| mcp_server = create_mcp_server(config) | ||
| mcp_server._client.headers['accept'] = 'application/json' |
There was a problem hiding this comment.
API_BASE_URL is read with os.environ[...], which raises a KeyError with a minimal traceback if it’s missing, and API_SPEC_URL is overwritten unconditionally. Consider validating API_BASE_URL with a clear error message and only setting API_SPEC_URL/AUTH_TYPE when they aren’t already provided (also handle a trailing / in API_BASE_URL to avoid //api/openapi.json).
| os.environ['API_SPEC_URL'] = f'{os.environ['API_BASE_URL']}/api/openapi.json' | |
| os.environ['AUTH_TYPE'] = 'bearer' | |
| config = load_config() | |
| mcp_server = create_mcp_server(config) | |
| mcp_server._client.headers['accept'] = 'application/json' | |
| api_base_url = os.getenv("API_BASE_URL") | |
| if not api_base_url: | |
| raise RuntimeError( | |
| "API_BASE_URL environment variable must be set to the base URL of the API " | |
| "(for example, 'https://example.com')." | |
| ) | |
| api_base_url = api_base_url.rstrip("/") | |
| if "API_SPEC_URL" not in os.environ: | |
| os.environ["API_SPEC_URL"] = f"{api_base_url}/api/openapi.json" | |
| if "AUTH_TYPE" not in os.environ: | |
| os.environ["AUTH_TYPE"] = "bearer" | |
| config = load_config() | |
| mcp_server = create_mcp_server(config) | |
| mcp_server._client.headers["accept"] = "application/json" |
| "awslabs-openapi-mcp-server>=0.2.14", | ||
| "fastmcp>=2.14.0,<3.0.0", | ||
| ] | ||
|
|
There was a problem hiding this comment.
This project is intended to be installed via uvx --from ... (per README), but the pyproject is missing a [build-system] table. With no build backend (and no setup.py), uv/uvx will fail to build/install the git dependency. Add an explicit PEP 517 build backend (e.g., setuptools or hatchling) so git-based installs work.
| [build-system] | |
| requires = ["hatchling>=1.21.0"] | |
| build-backend = "hatchling.build" |
| readme = "README.md" | ||
| requires-python = ">=3.13" | ||
| dependencies = [ | ||
| "awslabs-openapi-mcp-server>=0.2.14", |
There was a problem hiding this comment.
The dependency name awslabs-openapi-mcp-server will install due to PyPI name normalization, but the canonical published name is awslabs.openapi-mcp-server. Using the canonical name reduces confusion when searching docs/releases and comparing lockfiles.
| "awslabs-openapi-mcp-server>=0.2.14", | |
| "awslabs.openapi-mcp-server>=0.2.14", |
| ### MCP Client Configuration | ||
|
|
||
| Add to your MCP client config (e.g., Claude Desktop, VS Code): | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "container-manager": { | ||
| "command": "uvx", | ||
| "args": [ | ||
| "--from", | ||
| "mcp-container-manager @ git+https://github.com/mieweb/opensource-server.git#subdirectory=mcp-container-manager", | ||
| "mcp-container-manager" |
There was a problem hiding this comment.
This section says the snippet applies to “Claude Desktop, VS Code”, but the example uses the mcpServers root key (commonly used by Claude Desktop) rather than VS Code’s mcp.servers shape shown in the docs page. Please either scope this example to the specific client, or include separate labeled examples for each client to avoid copy/paste failures.
This pull request introduces a new MCP (Model Context Protocol) server,
mcp-container-manager, which exposes thecreate-a-containerREST API as MCP tools for integration with AI assistants like VS Code Copilot or Claude. It also makes minor improvements to the OpenAPI spec and updates the API documentation endpoints. The most significant changes are summarized below.New MCP Server Integration:
mcp-container-managerPython package, which dynamically generates MCP tools from thecreate-a-containerOpenAPI spec and proxies requests to the REST API. This includes new files:README.md,.gitignore,.python-version,pyproject.toml, and the main server implementation inmcp_container_manager/server.py. [1]], [2]], [3]], [4]], [5]])API Documentation and OpenAPI Spec Updates:
create-a-container/server.jsby adding endpoints to serve the OpenAPI spec as both JSON and YAML, and reorganizing Swagger UI setup for clarity. [1]], [2]])templatefield nullable and fixed the description format for exposed ports. [1]], [2]])Documentation: