- Home
- MCP servers
- MCP Swagger
MCP Swagger
- javascript
0
GitHub Stars
javascript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"izjing-mcp-swagger": {
"command": "npx",
"args": [
"-y",
"mcp-swagger-schema"
],
"env": {
"SWAGGER_SPEC_URL": "https://api.example.com/swagger.json",
"SWAGGER_CACHE_TTL_MS": "60000"
}
}
}
}You work with an MCP server designed to query interface schemas from Swagger/OpenAPI specifications. This server lets you retrieve the JSON Schema for requests and responses of API endpoints, resolve internal references, and match path parameters, all with built-in caching to speed up repeated lookups.
How to use
After configuring the MCP server, you can ask it to fetch the schema for a specific API path. For example, you can request the schema for an endpoint like /api/users to inspect the expected request body and the shape of the response.
How to install
Prerequisites you need before installing this MCP server: Node.js installed on your machine, and a working MCP client that can communicate with MCP servers. You will also need access to a Swagger/OpenAPI JSON URL for your API.
Step 1. Prepare the Swagger URL you want to query. You typically have a URL such as https://your-api.com/v3/api-docs.
Step 2. Add the MCP server configuration to your MCP setup. Use the configuration block shown below to run the MCP server via npx and point it at your Swagger specification URL.
Configuration example
{
"mcpServers": {
"swagger-schema": {
"command": "npx",
"args": ["-y", "mcp-swagger-schema"],
"env": {
"SWAGGER_SPEC_URL": "REPLACE_WITH_YOUR_SWAGGER_URL"
}
}
}
}
Environment variables
The following environment variables are used by the MCP server configuration. Provide these in your config and in the MCP server’s runtime environment as needed.
-
SWAGGER_SPEC_URL: The URL to your Swagger/OpenAPI JSON specification. This is required to locate the API schema.
-
SWAGGER_CACHE_TTL_MS: Optional cache time-to-live in milliseconds. If not provided, a default of 60000 ms is used.
Troubleshooting
If you encounter issues starting the MCP server, ensure that the required command and environment are correctly configured. The sample configuration uses npx to run the schema fetcher, so make sure npx is available in your PATH and that your SWAGGER_SPEC_URL is accessible from the environment where MCP runs.
Notes
You can query schemas for different API paths by issuing requests that specify the path and, optionally, the HTTP method. If you omit the method, the system will attempt to choose one automatically.