Skip to main content

Simple tool which mounts your fastapi application and exposes an mcp endpoint for AI agents to inspect your fastapi server.

Project description

fastapi-mcp-inspect

Mount an MCP server onto your FastAPI application to let AI agents inspect your routes, endpoints, and schemas at runtime.

Installation

uv add fastapi-mcp-inspect
# or using pip: pip install fastapi-mcp-inspect

Quick Start

from fastapi import FastAPI
from fastapi_mcp_inspect import FastAPIInspect

app = FastAPI()
FastAPIInspect(app, mount_path="/mcp")

Any LLM with MCP support can now connect to your app's /mcp endpoint and inspect all registered routes.

MCP Tools

show_all_routes()

Lists every registered route with its HTTP methods, summary, description, and total count.

show_endpoint_details(method, endpoint)

Shows detailed information for a specific endpoint, including request/response schemas and any referenced Pydantic models.

search_routes(query, method=None, search_in_summary=False, tags=None)

Searches routes by path (case-insensitive) with optional filters:

  • method — filter by HTTP method (e.g. GET, POST).
  • search_in_summary — when True, also matches against summaries and descriptions.
  • tags — filter by tag names (OR logic — any match).

list_all_tags()

Lists every unique tag used across API routes with route counts.

get_schema_definition(schema_name)

Returns the full field-level definition of a Pydantic schema used by any endpoint. Lookup is case-insensitive.

Development

git clone https://github.com/inclinedadarsh/fastapi-mcp-inspect.git
cd fastapi-mcp-inspect
uv sync

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_mcp_inspect-0.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_mcp_inspect-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_mcp_inspect-0.2.0.tar.gz.

File metadata

  • Download URL: fastapi_mcp_inspect-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fastapi_mcp_inspect-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a35d20e09c647957a6b9b241e4051d1b96708b7de428a871fa9b580d7e5ca72c
MD5 a111fb280889ed1a61aed8feba4af937
BLAKE2b-256 a658f2b17966ae326e9cc05467744376dccbcdc5377c3a5cabf521129f1cef2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_mcp_inspect-0.2.0.tar.gz:

Publisher: ci.yml on inclinedadarsh/fastapi-mcp-inspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_mcp_inspect-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_mcp_inspect-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 276e83ab04a002788ffb41eec8867c8b1ec48f25df5eeaabd33d2beda4fceb47
MD5 84736d16ddbf4021da83b3bbb42ce287
BLAKE2b-256 b7d47cb3bb6d5625f597610515007784f85d291da27cb0237b52638c076ebbaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_mcp_inspect-0.2.0-py3-none-any.whl:

Publisher: ci.yml on inclinedadarsh/fastapi-mcp-inspect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page