Get the FREE Ultimate OpenClaw Setup Guide →

simple

A python implementation of the Model Context Protocol (MCP) server with fastmcp, fastapi and streamablehttp.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rb58853-simple-mcp-server python -m uvicorn src.app:app --host 0.0.0.0 --port 8000 \
  --env SUPERUSERNAME="username for admin (optional for oauth setup)" \
  --env SUPERUSERPASSWORD="password for admin (optional for oauth setup)"

How to use

This MCP server is a Python-based implementation of the Model Context Protocol using FastAPI and a streamable HTTP interface. It exposes MCP-compatible tools via a FastAPI application mounted under endpoints (e.g., /echo, /math in the examples) so clients can invoke context-aware operations through HTTP streams. The server is designed to be stateless for HTTP transport, enabling simple scaling and easy integration with MCP clients and OAuth-based authorization if you enable the private server integration. You can run multiple MCP instances in the same FastAPI app to compose richer services and expose distinct tool collections.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • npm/yarn (optional, if you plan to use any JavaScript tooling)
  • Git (to clone the repository)

Step-by-step:

  1. Clone the repository git clone https://github.com/rb58853/simple-mcp-server.git cd simple-mcp-server

  2. Create and activate a virtual environment (recommended) python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate

  3. Install dependencies pip install -r requirements.txt

  4. Run the server (using uvicorn as shown in the configuration)

    This starts the FastAPI app and serves MCP endpoints

    python -m uvicorn src.app:app --host 0.0.0.0 --port 8000

  5. Optional: run the OAuth server in parallel (if you enable OAuth integration) python3 src/services/fast_mcp/private_server/oauth_server.py

  6. Verify startup Open http://127.0.0.1:8000 in your browser to see the help page or endpoint listing.

Docker (optional):

  • Build and run with Docker Compose if provided in the repository: docker compose -f docker-compose.yml up -d --build

Additional notes

Tips and common considerations:

  • If you enable OAuth integration, set up the .env file with SUPERUSERNAME and SUPERUSERPASSWORD for initial credentials.
  • You can run multiple MCP tools by mounting additional FastMCP servers in the same FastAPI application, enabling richer tool sets and independent session management.
  • Ensure your environment variables for OAuth (if used) are configured and that the OAuth server is reachable from the MCP server.
  • For production deployments, prefer a reverse proxy (e.g., Nginx) in front of uvicorn and consider enabling TLS termination.
  • When debugging, check server logs for MCP tool registration messages and any authorization errors from the token verifier.

Related MCP Servers

Sponsor this space

Reach thousands of developers