
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@ngineer101/mcpr
Advanced tools
A CLI tool that generates a Model Context Protocol (MCP) server from a Swagger/OpenAPI document.
# Install dependencies
npm install
# Build the project
npm run build
# Link globally (optional)
npm link
node dist/cli.js --doc <swagger-json-path-or-url> [--output <output-directory>]
# Generate MCP server from a local Swagger document
node dist/cli.js --doc api-spec.json --output my-api-server
# Generate from a remote URL
node dist/cli.js --doc https://petstore.swagger.io/v2/swagger.json --output petstore-server
# Use default output directory (./generated-mcp-server)
node dist/cli.js --doc api-spec.json
--doc <path>
: Path or URL to Swagger/OpenAPI JSON document (required)--output <path>
: Output directory for generated MCP server (default: ./generated-mcp-server
)--help
: Display help information--version
: Display version informationThe generated MCP server includes:
src/index.ts
: Main MCP server implementation with tools for each API endpointsrc/types.ts
: TypeScript types generated from Swagger schemaspackage.json
: Node.js package configuration with dependenciestsconfig.json
: TypeScript compilation configurationREADME.md
: Documentation for the generated servercd <output-directory>
npm install
npm run build
npm start
The server runs on stdio transport and can be used with any MCP-compatible client.
Each API endpoint in your Swagger document becomes an MCP tool:
operationId
from Swagger, or generates one from method + pathsummary
or description
from the endpoint{
"openapi": "3.0.0",
"info": {
"title": "User API",
"version": "1.0.0"
},
"paths": {
"/users/{id}": {
"get": {
"operationId": "getUserById",
"summary": "Get user by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
]
}
}
}
}
The above endpoint becomes an MCP tool named getUserById
with:
id
string parameter/users/{id}
with path parameter substitutionmcpr/
āāā src/
ā āāā cli.ts # CLI entry point
ā āāā parser.ts # Swagger document parser
ā āāā generator.ts # MCP server generator
ā āāā type-generator.ts # TypeScript type generator
ā āāā templates.ts # Code templates
āāā dist/ # Compiled JavaScript
āāā package.json
āāā tsconfig.json
āāā README.md
npm run build
: Compile TypeScript to JavaScriptnpm run dev
: Run CLI in development mode with tsxnpm run lint
: Run ESLintnpm run typecheck
: Run TypeScript type checkingFAQs
CLI tool to generate MCP servers from Swagger/OpenAPI documents
We found that @ngineer101/mcpr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.