Description

by KimiJL

327 downloads
Not rated
GitHub

About

Example web app mounting a model context protocol (MCP) server on a FastAPI server

Details

Author
KimiJL
Downloads
327
Categories
Developer Tools

- Mounts an MCP server onto existing FastAPI
- Includes sample client using MCP client library
- Uses MCP Python SDK for server logic
- Containerized with Docker for easy deployment
- Modular code with separate server and client modules

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Description
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Build and run the server using Docker (docker build -t fastapi-mcp . then docker run -p 8000:8000 --net=host fastapi-mcp) or set up a Python environment, install dependencies, and run uvicorn src.main:app. Then execute the sample client with python client/client.py.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "description": {
            "fastapi-mcp": {
                "command": "docker",
                "args": [
                    "build",
                    "-t",
                    "fastapi-mcp",
                    "."
                ]
            }
        }
    }
}

McpServers

{
    "fastapi-mcp": {
        "command": "docker",
        "args": [
            "build",
            "-t",
            "fastapi-mcp",
            "."
        ]
    }
}

Description

Simple example web app + client showing Model Context Protocol server mounted on an existing fastapi server

Model Context Protocol

FastAPI Mounting

Files

./src/main.py -> main fastapi server app

./src/mcp.py -> mcp sub server app logic

./client/client.py -> sample client showing some communication logic using mcp client lib

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.