Granthai MCP server
Commit Oct 22, 2026Generates OpenAPI 3.1 documentation and MCP servers automatically from live API traffic using Express middleware or a reverse proxy.
Also known as GranthAi/granthai
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 22, 2026
- License
- MIT
What is Granthai MCP?
Granthai generates OpenAPI 3.1 documentation and MCP servers automatically from live API traffic using Express middleware or a reverse proxy.
Summary generated from the project's README
About Granthai MCP server
Generating OpenAPI 3.1 documentation and MCP servers from live API traffic is the primary function of GranthAi. Developers can use the Express middleware package to automatically create an OpenAPI description, a Swagger UI accessible at /api-docs, and an MCP server at /mcp-server. This approach ensures that documentation stays synchronized with the actual traffic your API serves.
For projects using languages other than Node, the granthai-agent reverse proxy provides a language-agnostic solution. By running npx granthai-agent with a target port, such as 8000, you can wrap any HTTP API written in Python, Java, PHP, or Go to gain the same documentation and MCP capabilities without modifying your existing codebase. This setup allows AI clients to interact with your existing services through a standardized interface derived from real-world usage.
What you can do with it
- 1Automate OpenAPI documentationA developer can generate an OpenAPI 3.1 description directly from the traffic an Express API is currently serving.
- 2Add MCP support to non-Node APIsYou can provide an MCP server for a Python or Go API by using the language-agnostic reverse proxy.
- 3Visualize API endpoints via SwaggerIntegrate middleware into an Express application to host a Swagger UI at a specific path.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHubGranthAi
Automatic API documentation, generated from the traffic your API actually serves.
This monorepo holds every GranthAi project:
| Path | What it is | Published as |
|---|---|---|
packages/node |
Express middleware that generates an OpenAPI 3.1 description, Swagger UI at /api-docs and an MCP server at /mcp-server |
granthai on npm |
packages/agent |
Language-agnostic reverse proxy: put it in front of any HTTP API (Python, Java, PHP, Go, ...) with npx granthai-agent --target 8000 and get the same docs and MCP server with no code changes |
granthai-agent on npm |
apps/web |
The granthai.vercel.app website (Next.js) | Deployed on Vercel |
SDKs for more languages (Python, Java, ...) will live alongside the Node package under packages/.
Development
Requires Node 18+ and pnpm.
pnpm install # install all workspace dependencies
pnpm dev:web # run the website locally
pnpm build:web # production build of the website
Publishing the npm packages
Bump version in the package's package.json, commit, then from the repo root:
pnpm publish:node # granthai
pnpm publish:agent # granthai-agent
License
Granthai MCP questions
How can I use GranthAi with an existing API without changing my code?
You can use the granthai-agent reverse proxy to put it in front of any HTTP API (Python, Java, PHP, Go, etc.) to get documentation and an MCP server with no code changes.
What does the Node package provide?
The Node package is an Express middleware that generates an OpenAPI 3.1 description, Swagger UI at /api-docs, and an MCP server at /mcp-server.