Custom OpenAPI MCP Server
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., "@Custom OpenAPI MCP Server Show me all authentication endpoints"
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.
Custom OpenAPI MCP Server
A powerful Model Context Protocol (MCP) server that dynamically fetches and exposes OpenAPI/Swagger documentation as tools for AI assistants like GitHub Copilot and Claude. This server enables AI models to understand and interact with any REST API by automatically parsing OpenAPI specifications.
Features
š Dynamic API Discovery: Automatically fetches and parses OpenAPI/Swagger specifications from any URL
š Intelligent Endpoint Exploration: List and filter endpoints by tags for organized API navigation
š Detailed Documentation: Get comprehensive endpoint descriptions, parameters, and response schemas
š” Smart Code Generation: Generate realistic request examples based on OpenAPI schemas
ā” Real-time Integration: Works seamlessly with GitHub Copilot, Claude, and other MCP-compatible AI tools
š ļø Zero Configuration: Works out of the box with sensible defaults
Related MCP server: mcp-swagger
Tools Provided
1. list_endpoints_by_tag
Lists all endpoints grouped by OpenAPI tags, providing a high-level overview of API functionality.
Parameters:
tag(string): OpenAPI tag name (e.g., "Authentication", "Users", "Orders")
Example Output:
GET /auth/login: Authenticate user with credentials
POST /auth/refresh: Refresh authentication token
DELETE /auth/logout: Logout and invalidate session2. describe_endpoint
Provides detailed information about a specific endpoint including parameters, request body, and responses.
Parameters:
path(string): API endpoint path (e.g., "/users/{id}")method(string): HTTP method (e.g., "GET", "POST", "PUT", "DELETE")
Example Output:
### POST /users
Create a new user account
**Parameters**
- `x-api-key` (header) **required** ā string
**Request Body**
- application/json
- schema: UserCreateRequest
**Responses**
- 201: User created successfully
- 400: Invalid request data
- 409: User already exists3. generate_request_example
Generates sample JSON request bodies based on OpenAPI schemas, perfect for testing and development.
Parameters:
path(string): API endpoint pathmethod(string): HTTP method
Example Output:
{
"username": "string",
"email": "string",
"password": "string",
"profile": {
"firstName": "string",
"lastName": "string",
"age": 0
}
}Installation
Prerequisites
Node.js 18+
npm or yarn
An MCP-compatible AI assistant (GitHub Copilot, Claude Desktop, etc.)
Quick Start
Clone and Install
git clone <your-repo-url> cd custom-mcp npm installConfigure Environment (Optional)
cp .env.example .env # Edit .env to set your API documentation URLTest the Server
npm start
GitHub Copilot Integration
{
"mcpServers": {
"custom-openapi": {
"command": "node",
"args": ["/absolute/path/to/custom-mcp/index.js"],
"env": {
"API_DOCS_URL": "https://your-api.com/swagger.json"
}
}
}
}For macOS/Linux (~/.config/github-copilot/mcp.json):
{
"servers": {
"custom-openapi": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/custom-mcp/index.js"],
"env": {
"API_DOCS_URL": "https://your-api.com/swagger.json"
}
}
}
}For Windows (%APPDATA%\github-copilot\mcp.json):
{
"servers": {
"custom-openapi": {
"type": "stdio",
"command": "node",
"args": ["C:\\path\\to\\custom-mcp\\index.js"],
"env": {
"API_DOCS_URL": "https://your-api.com/swagger.json"
}
}
}
}Claude Desktop Integration
Add to your Claude Desktop MCP configuration (claude_desktop_config.json):
{
"mcpServers": {
"custom-openapi": {
"command": "node",
"args": ["/absolute/path/to/custom-mcp/index.js"],
"env": {
"API_DOCS_URL": "https://your-api.com/swagger.json"
}
}
}
}Configuration
Environment Variables
Variable | Description | Default |
| URL to OpenAPI/Swagger JSON specification | Petstore demo API |
Supported OpenAPI Sources
ā OpenAPI 3.0+ specifications
ā Swagger 2.0 specifications
ā Local files (
file://URLs)ā Remote HTTPS endpoints
ā APIs with CORS enabled
ā JSON and YAML formats
Example API URLs
# Petstore Demo (default)
API_DOCS_URL=https://petstore.swagger.io/v2/swagger.json
# Local development server
API_DOCS_URL=http://localhost:3000/api/docs/json
# Production API
API_DOCS_URL=https://api.yourcompany.com/v1/openapi.json
# Local file
API_DOCS_URL=file:///path/to/your/openapi.jsonUsage Examples
Once integrated with your AI assistant, you can use natural language to explore APIs:
"Show me all authentication endpoints"
ā Uses list_endpoints_by_tag with tag="Authentication"
"How do I create a new user?"
ā Uses describe_endpoint for POST /users
"Generate an example request for user registration"
ā Uses generate_request_example for POST /users/registerArchitecture
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā AI Assistant āāāāāŗā MCP Server āāāāāŗā OpenAPI Spec ā
ā (Copilot/Claude)ā ā (This Project) ā ā (Remote/Local) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāCore Components
index.js: Server bootstrap and OpenAPI spec fetchingtools.js: MCP tool definitions and OpenAPI parsing logicpackage.json: Dependencies and project metadatamcp.json: Example MCP client configuration
Example of current configration

Troubleshooting
Common Issues
Server fails to start:
# Check if the API URL is accessible
curl -s "https://your-api.com/swagger.json" | jq .
# Verify Node.js version
node --version # Should be 18+No tools appear in AI assistant:
Verify the absolute path in
mcp.jsonis correctRestart your AI assistant after configuration changes
Check the server logs for errors
Schema parsing errors:
Ensure your OpenAPI spec is valid JSON/YAML
Test with a minimal spec first
Check for unsupported OpenAPI extensions
Validation
Test your OpenAPI specification:
# Using swagger-codegen
npx swagger-codegen-cli validate -i https://your-api.com/swagger.json
# Using online validator
curl -X POST "https://validator.swagger.io/validator/debug" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-api.com/swagger.json"}'Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built with the Model Context Protocol SDK
Inspired by the need for dynamic API exploration in AI development workflows
Available Tools
3 toolsdescribe_endpointA
Return summary, description, parameters & responses for one endpoint.
Inputs: path (required), method (required).
generate_request_exampleA
Create a sample JSON body for an endpoint (if it has one).
Inputs: path (required), method (required).
list_endpoints_by_tagA
List every endpoint (method + description) under a given tag.
Inputs: tag (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 3 tools
Each tool serves a distinct purpose: listing endpoints under a tag, describing a specific endpoint, and generating a request example. There's no overlap or ambiguity between them.
All tool names follow a clear verb_noun pattern in snake_case: list_endpoints_by_tag, describe_endpoint, generate_request_example. This is perfectly consistent.
Three tools is on the low end but still within the expected range for a focused server. It feels slightly thin for general OpenAPI exploration, but each tool earns its place.
The set covers tagged endpoint listing, detailed endpoint descriptions, and request example generation, but lacks a way to list available tags or all endpoints without a tag. This is a notable gap that could hinder agents unfamiliar with the API structure.
Maintenance
Related MCP Connectors
Publish your API docs so AI assistants can look up endpoints and call your API correctly.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Discover, compare, route, and execute machine-accessible capabilities for AI agents.
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to discover, search, and interact with REST APIs by parsing OpenAPI/Swagger specifications with intelligent fuzzy search across endpoints, supporting both local and remote API sources.6 npm2MIT
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1420 npm2MIT
- FlicenseNot gradedqualityDmaintenanceDynamically exposes any OpenAPI/Swagger API as tools for AI assistants, automatically generating MCP tools from OpenAPI specs with authentication support.-
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with access to OpenAPI specifications, enabling API discovery, schema retrieval, and direct API execution with support for OAuth 2.0 and other authentication methods.5 npm1MIT