Skip to main content
Glama

FastAPI-MCP

by tadata-org
--- title: Deploying the Server icon: play --- ## Deploying separately from original FastAPI app You are not limited to serving the MCP on the same FastAPI app from which it was created. You can create an MCP server from one FastAPI app, and mount it to a different app: ```python {9, 15, } from fastapi import FastAPI from fastapi_mcp import FastApiMCP # Your API app api_app = FastAPI() # ... define your API endpoints on api_app ... # A separate app for the MCP server mcp_app = FastAPI() # Create MCP server from the API app mcp = FastApiMCP(api_app) # Mount the MCP server to the separate app mcp.mount(mcp_app) ``` Then, you can run both apps separately: ```bash uvicorn main:api_app --host api-host --port 8001 uvicorn main:mcp_app --host mcp-host --port 8000 ```

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tadata-org/fastapi_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server