mcpspec-dev
OpenAPI-like specs for Python MCP servers. One line of code. Zero config.
mcpspec wraps your MCP server, introspects its tools, resources, and prompts via the MCP protocol, and serves:
/docs— interactive HTML documentation (dark/light/high-contrast themes, no CDN)/mcpspec.yaml— a machine-readable spec in a standardized format
Install
pip install mcpspec-dev
# or
uv add mcpspec-dev
Quick Start (FastMCP)
from mcp.server.fastmcp import FastMCP
from mcpspec_dev import McpSpec
mcp = FastMCP("my-server")
@mcp.tool()
def greet(name: str) -> str:
"""Say hello to someone"""
return f"Hello, {name}!"
spec = McpSpec(mcp, info={"title": "My Server", "version": "1.0.0"})
mcp.run(transport="streamable-http")
Visit http://localhost:8000/docs and http://localhost:8000/mcpspec.yaml.
Quick Start (Server API)
from mcp.server.lowlevel import Server
from mcpspec_dev import McpSpec
import uvicorn
server = Server("my-server")
# Register tools via @server.call_tool(), etc.
spec = McpSpec(server, info={"title": "My Server", "version": "1.0.0"})
app = spec.create_app()
uvicorn.run(app, port=3000)
What It Does
- Introspects your MCP server at first request (lazy, cached)
- Generates a
mcpspec.yamlspec with tools, resources, prompts, and metadata - Serves human-readable docs and the raw spec as HTTP endpoints
- Injects routes on FastMCP via
custom_route()— or usecreate_app()for standalone ASGI
Options
spec = McpSpec(
server,
info={
"title": "My Server", # Required: display name
"version": "1.0.0", # Required: server version
"description": "Does things", # Optional
"repository": "https://...", # Optional: source repo URL
"license": "MIT", # Optional: SPDX identifier
"serverUrl": "https://...", # Optional: production URL
"authors": [{"name": "You"}], # Optional
},
transport=[{ # Optional: document connection methods
"type": "streamable-http",
"url": "https://my-server.com/mcp",
"auth": {"type": "bearer"},
}],
base_path="/api", # Optional: prefix all routes
exclude=["internal_*"], # Optional: hide tools by glob pattern
include=["public_*"], # Optional: allowlist mode (overrides exclude)
groups={ # Optional: group tools in the docs UI
"Data": ["get_users", "list_items"],
"Admin": ["reset_cache"],
},
examples={ # Optional: add usage examples to tools
"get_users": [{
"title": "Fetch first 10 users",
"input": {"limit": 10},
}],
},
)
Security
Your spec, your rules. mcpspec is a documentation tool, not a surveillance tool.
- Only calls
tools/list,resources/list,prompts/list— never reads content or executes tools - Introspects via in-memory transport — bypasses HTTP/auth entirely
- Use
exclude/includeto control what appears in the spec - Use
overridesto redact or rewrite descriptions
See the security guide for details.
Links
- Docs & Viewer: mcpspec.dev
- GitHub: github.com/namishsaxena/mcpspec
- Spec Format: Spec Format Reference
- TypeScript: @mcpspec-dev/typescript on npm
License
MIT
Metadata
Release files for mcpspec-dev 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcpspec_dev-0.1.0.tar.gz | 10.5 kB | Without provenance | Details for mcpspec_dev-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcpspec_dev-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcpspec_dev-0.1.0-py3-none-any.whl |
Total release size: 23.7 kB
Release files / mcpspec_dev-0.1.0.tar.gz
| Download URL | mcpspec_dev-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55ac7c05d5f21fc4699df9f6d4a5ab6c4aed0e62599756406fd4d05b1af424fb
|
|
BLAKE2b-256 checksum How to use checksums |
45cbcf7616e0ffa25c5f0194d6d8ea4ba5160ec60c81658af240ee281e956978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mcpspec_dev-0.1.0-py3-none-any.whl
| Download URL | mcpspec_dev-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec6adcb692e4652d17b95cbd2b1348cf0fbe6b3b8fb1dbdcb6e04e9b21c94482
|
|
BLAKE2b-256 checksum How to use checksums |
0bfa1eab996f57d0df5edb458425ecd0ec5bf7a8063edc67ec76475c3559fb3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mcpspec-dev 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.