diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99c122a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use an official Python runtime as a parent image +FROM python:3.12-slim-bookworm + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container at /app +ADD . /app + +# Install the package dependencies +RUN pip install --no-cache-dir setuptools wheel && \ + pip install --no-cache-dir . + +# Environment variables for OpenAPI server +ENV OPENAPI_SPEC_URL="" +ENV API_AUTH_BEARER="" +ENV TOOL_WHITELIST="" +ENV TOOL_NAME_PREFIX="" +ENV OPENAPI_SIMPLE_MODE=false + +# Make port 80 available to the world outside this container +EXPOSE 80 + +# Run mcp-openapi-proxy when the container launches +CMD ["uvx", "--from", "git+https://github.com/matthewhand/mcp-openapi-proxy", "mcp-openapi-proxy"] diff --git a/README.md b/README.md index b8c2d32..c886e01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # mcp-openapi-proxy +[![smithery badge](https://smithery.ai/badge/@matthewhand/mcp-openapi-proxy)](https://smithery.ai/server/@matthewhand/mcp-openapi-proxy) + **mcp-openapi-proxy** is a Python package implementing a Model Context Protocol (MCP) server that dynamically exposes REST APIs defined by OpenAPI specifications as MCP tools. This allows you to easily integrate any OpenAPI-described API into MCP-based workflows. ## Overview @@ -19,6 +21,14 @@ The package supports two operation modes: ## Installation +### Installing via Smithery + +To install OpenAPI Proxy for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@matthewhand/mcp-openapi-proxy): + +```bash +npx -y @smithery/cli install @matthewhand/mcp-openapi-proxy --client claude +``` + ### MCP Ecosystem Integration Add **mcp-openapi-proxy** to your MCP ecosystem by configuring your `mcpServers`. Generic example: @@ -207,4 +217,4 @@ uvx --from git+https://github.com/matthewhand/mcp-openapi-proxy mcp-openapi-prox ## License -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. \ No newline at end of file +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..cc6536b --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,29 @@ +# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: + - openapiSpecUrl + properties: + openapiSpecUrl: + type: string + description: URL to the OpenAPI specification JSON file + apiAuthBearer: + type: string + description: Bearer token for authentication + toolWhitelist: + type: string + description: Comma-separated list of endpoint paths to expose as tools + toolNamePrefix: + type: string + description: Prefix for all tool names + openapiSimpleMode: + type: boolean + description: Enable FastMCP mode + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({ command: 'uvx', args: ['--from', 'git+https://github.com/matthewhand/mcp-openapi-proxy', 'mcp-openapi-proxy'], env: { OPENAPI_SPEC_URL: config.openapiSpecUrl, API_AUTH_BEARER: config.apiAuthBearer || '', TOOL_WHITELIST: config.toolWhitelist || '', TOOL_NAME_PREFIX: config.toolNamePrefix || '', OPENAPI_SIMPLE_MODE: config.openapiSimpleMode ? 'true' : 'false' } })