Skip to content

Deployment: Dockerfile and Smithery config #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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.
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
29 changes: 29 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -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' } })