nest-openapi-mcp
Allows AI agents to interact with any NestJS API that has Swagger documentation, automatically exposing its endpoints as MCP tools through the real Nest pipeline (Guards, Pipes, Interceptors, Scope.REQUEST providers).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nest-openapi-mcpgenerate an MCP server from my NestJS API's Swagger metadata"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nest-openapi-mcp
Turn an existing NestJS API (already documented with @nestjs/swagger) into a spec-compliant
Model Context Protocol server — with zero per-endpoint annotation,
and execution that goes through the real Nest pipeline (Guards, Pipes, Interceptors, Scope.REQUEST
providers), not a reimplementation of it.
Several NestJS↔MCP integrations already exist (notably
rekog-labs/MCP-Nest), but they're decorator-based — you
annotate each method you want exposed by hand. This project's angle is Swagger-driven auto-discovery:
if your API already has @nestjs/swagger metadata (or even just class-validator decorators — see
enrichEmptySchemas in @onkarsabale15/mcp-gen-core), tool schemas are derived from it directly, with a safe-by-
default policy so nothing is LLM-callable until you explicitly opt it in.
Status:
@onkarsabale15/mcp-gen-core(the OpenAPI → MCP schema engine) is built, tested, and validated against three independently-built NestJS codebases (seedocs/real-world-validation-report.md).@onkarsabale15/mcp-gen-server(the actual NestJS module you'd install) and@onkarsabale15/mcp-gen-cliare still placeholders — this isn't installable as a working MCP server yet. Seedocs/mcp-generator-hld-lld.mdfor the full architecture and phased roadmap.
Packages
Package | Purpose |
| Shared types, JSON-RPC types, error classes. No framework dependency. |
| OpenAPI parsing, schema flattening, tool naming, tool registry, truncation. No NestJS dependency. |
| NestJS dynamic module ( |
| Standalone CLI: turns any OpenAPI 3.0/3.1 document into a proxying MCP server. |
Related MCP server: Swagger MCP Adapter
Usage
There are four distinct ways this is designed to be used — only one of them works today. See
docs/usage/ for the full breakdown with a status table and a guide
per mode:
Use
@onkarsabale15/mcp-gen-coredirectly — available now, real code examples.In-process NestJS module — planned (
McpModule.forRoot()).Manual, non-HTTP tools — planned (
@McpTool/@McpArg).Standalone CLI / proxy — planned (
npx @onkarsabale15/mcp-gen-cli serve).
Development
pnpm install
pnpm build
pnpm lint
pnpm typecheck
pnpm testThis repo uses pnpm workspaces + Turborepo, Changesets for versioning/publishing, and strict
TypeScript throughout. See CONTRIBUTING.md for conventions, and
SECURITY.md for the threat model and how to report a vulnerability privately.
Naming note
Packages are published under the author's personal npm scope (@onkarsabale15/mcp-gen-*) rather than a
dedicated organization scope — no functional difference, just where the name is claimed from.
This server cannot be deployed
Maintenance
Related MCP Connectors
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
- typeshipOAuthdev.typeship
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for AI access to Swagger by SmartBear.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceExposes REST API endpoints defined in an OpenAPI Specification as MCP tools, allowing AI models to call them via the ModelContext Protocol.-- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that integrates with Swagger/OpenAPI specifications to expose API endpoints as tools for Large Language Models (LLMs), enabling natural language interaction with any OpenAPI-compliant API.49MIT
- AlicenseNot gradedqualityDmaintenanceActs as a bridge between standard REST/OpenAPI web APIs and the Model Context Protocol, dynamically converting REST endpoints into MCP tools for LLM clients like Cursor, Claude Desktop, and n8n.9 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceConverts any OpenAPI/Swagger spec into an MCP server, exposing REST API endpoints as tools for Claude.MIT