Skip to main content
Glama

FastAPI MCP Demo Server

main.py452 B
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Numbers(BaseModel): a: int b: int @app.get("/") def home(): return {"message": "MCP Server is live!"} @app.post("/sum") def calculate_sum(data: Numbers): result = data.a + data.b return {"result": result} class Greeting(BaseModel): name: str @app.post("/greet") def greet_user(data: Greeting): return {"message": f"Hello, {data.name}!"}

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/MAIMOONA-ISLAM/MCP-Server-using-FAST-MCP'

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