OpenViSTAI · Agents · Blockchain · Crypto
Menu
MCP & Tooling

Fastapi MCP

A Python library that mounts an MCP server onto a FastAPI application and exposes its endpoints as MCP tools.

Independent OpenViST project profile, based on linked sources.

Fastapi MCP — OpenViST project profile in MCP & Tooling.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when an existing FastAPI service needs an MCP interface without replacing its route schemas, documentation, dependency mechanisms, or ASGI-based application structure.

Who it is for

  • Developers maintaining FastAPI services.
  • Teams adding MCP access to existing APIs.
  • Engineers needing FastAPI-based authentication and authorization for MCP endpoints.

Documented uses

  • Expose existing FastAPI routes as MCP tools.
  • Preserve request and response schemas and endpoint documentation.
  • Reuse FastAPI dependencies for MCP authentication and authorization.
  • Run MCP capabilities in the same application or as a separate deployment.
Before you choose

Requirements & limits

The project is a public, MIT-licensed Python library. Installation is documented through uv or pip; Python 3.10+ is required, with Python 3.12 recommended.

  • Existing FastAPI architecture is central to the integration.
  • FastAPI request and response schemas and endpoint documentation are preserved.
  • Authentication and authorization can reuse existing FastAPI dependencies.
  • ASGI communication avoids MCP-to-API HTTP calls in the described same-application design.
  • Separate deployment is supported, but operational deployment details are not documented in the supplied material.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Mount an MCP server on a FastAPI application

Add an auto-generated MCP server to an existing FastAPI app.

Before you start

  • An existing FastAPI application.
  • Python 3.10 or later; Python 3.12 is recommended.
  • FastAPI-MCP installed with uv or pip.

Steps

  1. Install the library with the command below or the command below.

    Documented command
    uv add fastapi-mcp
    Documented command
    pip install fastapi-mcp
  2. Import FastApiMCP and create an instance with the FastAPI application.

  3. Call mcp.mount() to mount the MCP server directly to the application.

  4. Use the documented application /mcp path for the generated MCP server endpoint.

Expected outcome

The FastAPI application exposes its endpoints as MCP tools while retaining the documented request and response schemas and endpoint documentation.

Guide limitations

  • The supplied instructions do not enumerate supported authentication schemes.
  • Separate-deployment operational steps are not included in the documented basic usage.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
1 October 2026
Original website title
tadata-org/fastapi_mcp · Official homepage title · retained in its source language