Skip to main content
Glama

Awesome MCP FastAPI

by MR-GREEN1337
main.py805 B
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from typing import Dict, Any, List, Optional from src.utils import lifespan # Import the improved tool registry from src.utils.tools import bind_app_tools, auto_tool # Create the FastAPI app app = FastAPI(title="Tool Registry Demo", lifespan=lifespan) # Add CORS middleware app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Bind app to the tools # This must be done before defining routes for immediate registration bind_app_tools(app) @auto_tool(name="Health Check" ,description="Health Check") @app.get("/") async def health_check() -> Dict[str, Any]: """Health Check Definition""" return {"All Good": "All good"}

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/MR-GREEN1337/awesome-mcp-fastapi'

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