Step 1: Download MCP for Python
First, you need to download the MCP for Python from the OpenAPI Tools website. Please visit: https://openapitools.com/dashboard/tools
Download the MCP Python package from this link.
Go into the directory, download the latest versions of these dependencies by running:
pip install -r requirements.txt
This will install the Model Context Protocol SDK and other required dependencies for your TypeScript implementation.
Step 2: Configure mcpconfig.json
Once downloaded, you’ll need to create a configuration file called mcpconfig.json
with the following content:
{
"server_name": "anthropic-mcp-server",
"host": "0.0.0.0",
"port": 8000,
"server_version": "0.1.0",
"tool_names": [],
"mode": "stdio",
"refresh_time_minutes": 1440,
"api_key": "apik_47677d9a7375d4087bdcf60a6b861d33bff06bff1f5bdddaad0e1a1959759430eaf8bd94cef844245200fedccd55b5c8_c4854ed60d3ee64f"
}
Note: The mode
is set to stdio
which is required for Claude Desktop integration. If you want to use it as a server, you would change this to sse
mode.
Step 3: Configure Claude Desktop
You’ll need to modify Claude Desktop’s configuration file based on your operating system:
For macOS:
Edit the file at: ~/Library/Application Support/Claude/claude_desktop_config.json
For Windows:
Edit the file at: %APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"otp": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\kvssa\\Desktop\\openapitools\\mcp-python",
"run",
"server.py"
]
}
}
}
- Adjust the directory path to match where you’ve installed the MCP Python package.
- Ensure
uvicorn
is installed in your Python environment globally. You can install it usingpip install uvicorn
. - Change the server name from
otp
to whatever you want to call it. This name will be used in the Claude Desktop interface to select the tool.
Step 4: Providing only few tools or api_key (Optional)
Instead of fetching tools locally you can use your api_key but there will be rate limits. You can also provide only few tools to be fetched from the server.
refresh_time_minutes
will refresh tools for for every n minutes if you are using
api_key
.
{
"server_name": "anthropic-mcp-server",
"server_version": "0.1.0",
"host": "0.0.0.0",
"port": 8000,
"tool_names": ["generate-otp", { "name": "get-orders", "version": "prod" }],
"mode": "stdio",
"refresh_time_minutes": 1440,
"api_key": "YOUR_API_KEY_HERE"
}
Step 5: Running Your MCP Server
Once everything is configured, restart Claude Desktop. Your MCP server should be available for use within the Claude interface.
You can test if your integration is working by selecting your tool from the tool menu in Claude Desktop.