Provides a Model Context Protocol (MCP) interface for FastAPI endpoints, automatically generating tools from API endpoints decorated with @mcp_app.tool(), enabling interaction with CRUD operations through MCP clients
Integrates with Swagger UI to provide interactive API documentation at /docs, allowing developers to explore and test the API endpoints
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastAPI MCP Applicationlist all users in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FastAPI Application
Este é um projeto de exemplo de uma aplicação REST API construída com FastAPI.
Configuração do Ambiente
Crie o ambiente virtual:
python -m venv venvAtive o ambiente virtual:
Windows:
.\venv\Scripts\activatemacOS/Linux:
source venv/bin/activate
Instale as dependências:
pip install -r requirements.txt
Related MCP server: MCP-OpenAPI
Executando a Aplicação
Para iniciar o servidor Uvicorn, execute:
uvicorn main:app --reload
ou
python main.pyIsso iniciará a aplicação em http://127.0.0.1:8000. Você pode acessar a documentação interativa da API em http://127.0.0.1:8000/docs (Swagger UI) ou http://127.0.0.1:8000/redoc (ReDoc).
Usando a Interface MCP
Para interagir com as ferramentas MCP geradas automaticamente a partir dos seus endpoints FastAPI, acesse através de um cliente MCP:
http://127.0.0.1:8000/mcpNeste caminho, você encontrará a interface do Model Context Protocol (MCP), onde as ferramentas (seus endpoints CRUD decorados com @mcp_app.tool()) estarão disponíveis para interação via clientes MCP ou diretamente através da interface.
Instalar no cursor
Para funcionar no cursor deve rodar o servidor com o comando acima e adicionar o json abaixo em mcp.json do cursor
"mcp-crud": { "url": "http://127.0.0.1:8000/mcp" }
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.