Skip to main content
Glama
finianoneill

MCP FastAPI Server

by finianoneill

MCP FastAPI Server

A production-ready Model Context Protocol (MCP) server built with FastAPI.

Directory Structure

.
├── main.py                    # Entry point
├── requirements.txt           # Dependencies
├── README.md                 # Documentation
└── src/
    ├── __init__.py
    ├── app.py                # FastAPI application
    └── mcp_app/
        ├── __init__.py
        ├── models.py         # Pydantic models
        ├── server.py         # MCP server logic
        └── tools.py          # Tool registry & implementations

Related MCP server: Learn_MCP Math Server

Installation

pip install -r requirements.txt

Usage

python main.py

Server runs on http://localhost:8000

Endpoints

  • GET / - Server information

  • GET /health - Health check

  • GET /tools - List available tools

  • WS /mcp - MCP WebSocket endpoint

  • POST /mcp/http - MCP HTTP endpoint

Built-in Tools

  1. calculate - Mathematical calculations

  2. get_time - Current time in timezone

  3. echo - Echo messages

API Documentation

Visit http://localhost:8000/docs for interactive API documentation.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.
    8
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server implementation built with FastAPI that enables AI agent interactions. Provides a structured foundation for building AI-powered applications with proper data validation and modern Python tooling.
    -
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A production-ready Model Context Protocol server built with FastAPI, featuring JWT authentication, PostgreSQL database support, Redis caching, and comprehensive health monitoring for building secure async API applications.
    -