MCP ExplorerExplorer

Mcp Fastapi Proxy

@wdhortonon a year ago
2 MIT
FreeCommunity
AI Systems
Create an MCP server that proxies to an existing FastAPI server

Overview

What is Mcp Fastapi Proxy

mcp-fastapi-proxy is a project designed to create an MCP server that acts as a proxy to an existing FastAPI server, allowing for enhanced functionality and integration.

Use cases

Use cases for mcp-fastapi-proxy include creating a development environment for testing FastAPI applications, integrating multiple FastAPI services, and providing a simple interface for tool execution in a controlled environment.

How to use

To use mcp-fastapi-proxy, first start your FastAPI server with the command ‘uv run fastapi dev fastapi_server.py’. Then, run the MCP server using ‘uv run fastmcp dev mcp_server.py’. You can access the tools at http://localhost:5173/#tools, where you can list and run available tools.

Key features

Key features of mcp-fastapi-proxy include the ability to proxy requests to an existing FastAPI server, easy setup and integration, and a simple interface for listing and executing tools.

Where to use

mcp-fastapi-proxy can be used in various fields such as web development, API integration, and rapid prototyping of applications that require a FastAPI backend.

Content

MCP FastAPI Proxy

Hacking on a way to automatically create an Anthropic MCP server from an existing FastAPI server. NOT FOR PRODUCTION USE, this uses exec() which could be very bad if you pointed it at untrusted servers.

How to run

Start FastAPI server

uv run fastapi dev fastapi_server.py

Run the MCP server

uv run fastmcp dev mcp_server.py

Now you can go to http://localhost:5173/#tools, hit “List Tools”, and you should be able to see the get_weather tool and run it with “Run Tool”.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers