Skip to main content
Glama

FastAPI MCP SSE

by panz2018
routes.py1.12 kB
from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse from fastapi import APIRouter from app import app # Create a router with a general tag for API documentation organization router = APIRouter(tags=["General"]) @router.get("/") async def homepage(): """Root endpoint that returns a simple HTML welcome page""" html_content = ( "<h1>FastAPI MCP SSE</h1>" "<p>Welcome to the SSE demo with MCP integration.</p>" ) return HTMLResponse(html_content) @router.get("/about") async def about(): """About endpoint that returns information about the application""" return PlainTextResponse( "About FastAPI MCP SSE: A demonstration of Server-Sent Events " "with Model Context Protocol integration." ) @router.get("/status") async def status(): """Status endpoint that returns the current server status""" status_info = { "status": "running", "server": "FastAPI MCP SSE", "version": "0.1.0", } return JSONResponse(status_info) # Include the router in the main application app.include_router(router)

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/panz2018/fastapi_mcp_sse'

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