Specs and interactive docs for MCP servers — like OpenAPI, but for the Model Context Protocol.
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)/mcpspec.yaml— machine-readable spec in a standardized format/mcp— proxied MCP endpoint via Streamable HTTP
| Package | Registry | Status | Docs |
|---|---|---|---|
| @mcpspec-dev/typescript | npm | Available | README |
| mcpspec-dev (Python) | PyPI | Available | README |
npm install @mcpspec-dev/typescriptimport { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { mcpspec } from "@mcpspec-dev/typescript";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
// Register your tools, resources, prompts as usual...
const app = mcpspec(server, {
info: { title: "My MCP Server", version: "1.0.0" },
});
app.listen(3000);
// Docs: http://localhost:3000/docs
// Spec: http://localhost:3000/mcpspec.yaml
// MCP: http://localhost:3000/mcpFor full API reference, configuration options, and composable createHandler usage, see the TypeScript package docs.
- 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
- Proxies MCP at
/mcpso clients connect via Streamable HTTP
All introspection happens in-memory — mcpspec never touches the network or your auth layer.
mcpspec is a documentation tool, not a proxy.
- 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
See docs/guides/security.md for details.
mcpspec/
├── packages/typescript/ # @mcpspec-dev/typescript (npm)
├── packages/python/ # mcpspec-dev on PyPI
├── schema/ # JSON Schema for mcpspec.yaml
├── docs-ui/ # Docs HTML/CSS/JS source (bundled into package)
├── scripts/ # Build scripts (docs-ui bundler)
├── examples/typescript/ # Example Task Manager server
├── docs/
│ ├── guides/ # Quickstart, configuration, security, spec format
│ └── architecture/ # Coding standards, quality gates, modularity
└── website/ # mcpspec.dev (coming soon)
See CONTRIBUTING.md for development setup, code standards, and PR process.
