spec2mcp
Enables AI agents to execute GitHub REST API endpoints exposed from an OpenAPI spec, allowing interaction with GitHub repositories and related resources with token-based authentication.
Enables AI agents to call Stripe REST API endpoints defined in an OpenAPI spec, exposing payment and billing operations as executable MCP tools with injected authentication.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
spec2mcp
spec2mcp is a flexible API gateway built specifically for the Model Context Protocol (MCP). It dynamically transforms your REST APIs—defined via OpenAPI YAML/JSON specs—into native, executable MCP tools.
By bridging the gap between existing API infrastructures and AI agents, developers can expose powerful systems (e.g., GitHub, Stripe, Internal Microservices) to language models seamlessly without manual tool-wiring.
Overview
spec2mcp works by interpreting OpenAPI 3 schemas:
Automatic Loading: Scans an
apis/directory for YAML/JSON specs and dynamically extracts endpoints intoGETandPOSTtools.Dynamic FastMCP Server: Wraps endpoints in safe, asynchronous invocation boundaries using the FastMCP framework.
Smart Authentication: Supports injecting
Authorizationheaders,api_keyquery parameters, and extracting local environment variables across multiple specs simultaneously.
Related MCP server: rest2mcp
Installation
You can install spec2mcp via PyPI:
pip install spec2mcpQuickstart
1. Create your specs directory:
Create a folder called apis/ anywhere on your machine.
mkdir apis2. Add an OpenAPI Specification:
Save your API definitions inside apis/. For instance, you could place a subset of the GitHub REST API spec in apis/github.yaml.
3. Configure Authentication:
If the APIs you are hitting require API keys, create an auth.json to store your authentication mappings. spec2mcp understands environment variable extraction out-of-the-box (${VARIABLE}).
{
"github": {
"headers": {
"Authorization": "Bearer ${GITHUB_TOKEN}"
}
},
"weather_api": {
"query": {
"api_key": "${WEATHER_API_KEY}"
}
}
}4. Start the MCP Server! To run the server natively locally (or to provide the command string for an AI Agent's MCP config block):
python -m spec2mcp.cli serve ./apis --auth-config auth.jsonIntegrating into Claude Desktop / Cursor
Add the following to your MCP Configuration file mcp.json or mcp_config.json:
{
"mcpServers": {
"spec2mcp": {
"command": "python",
"args": [
"-m", "spec2mcp.cli",
"serve",
"C:\\absolute\\path\\to\\apis",
"--auth-config", "C:\\absolute\\path\\to\\auth.json"
]
}
}
}Restart your IDE or Desktop client, and your AI should natively understand and begin executing tools against the mapped API logic!
License
OpenMCP is licensed under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Discover and call 10,000+ production APIs from one MCP server. Pay-per-call billing for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceTurns any OpenAPI/Swagger API into MCP tools, enabling AI assistants to call REST API endpoints directly.2MIT
- FlicenseNot gradedqualityDmaintenanceExposes any REST API as MCP tools, enabling AI agents to discover and call existing HTTP endpoints without modifying the original API.-
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to call any OpenAPI-defined API by automatically converting its operations into tools, with built-in support for authentication, rate limiting, and response handling.7Apache 2.0
- AlicenseNot gradedqualityDmaintenanceExposes REST API endpoints defined by OpenAPI specifications as MCP tools, enabling LLMs to discover and interact with those APIs through MCP.MIT