@qianxiao199/mcp-server-swagger-api v0.2.22
Swagger API MCP Server
A Model Context Protocol (MCP) server that provides Swagger API documentation by fetching the first resource from the resources list and its details.
Features
- Two-level API access:
- First fetches Swagger API resources from the base endpoint
- Then fetches detailed API documentation for the first resource only
- MCP protocol compatible
- Easy integration with AI models
- Markdown formatted output with clickable links and JSON data
- Focused API documentation in a single request
- Compact JSON format without whitespace to minimize data size
Supported APIs
- Primary API:
http://192.168.2.166:8080/basic-manage/api/swagger-resources - Secondary API:
http://192.168.2.166:8080/basic-manage/api{resource[0].url}
Express Server Endpoints
The server also provides a web interface and REST API endpoints:
GET /- Web interface with a button to fetch API documentationGET /api/docs- Returns the full Swagger API documentation for the first resource in compact formatGET /api/search?keyword=<keyword>- Searches for API paths containing the specified keywordGET /api/filter?tag=<tag>- Returns the complete API documentation in compact format (tag parameter is required but not used for filtering)
Available Tools
get_swagger_api_docssources- Required arguments: API ID list
- Example usage:
get_swagger_api_docs([1]): Get Swagger API documentation for the first resource
How It Works
- The server first calls the Swagger resources endpoint to get a list of available APIs
- It extracts the
urlfield from the first resource in the list (index 0) - It then makes a second API call to
http://192.168.2.166:8080/basic-manage/api{url}for that resource - The result from the secondary API call is returned in a structured format
Installation
NPX
{
"mcpServers": {
"mcp-server-swagger-api": {
"command": "npx",
"args": [
"-y",
"@qianxiao199/mcp-server-swagger-api"
]
}
}
}Docker
( Docker image not uploaded to Docker Hub, need to build it yourself. )
{
"mcpServers": {
"mcp-server-swagger-api": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"wopal/mcp-server-swagger-api"
]
}
}
}Development
# Install dependencies
npm install
# Watch mode
npm run watch
# Build
npm run build
# Test URLs
npm run test:urlsDocker build:
docker build -t wopal/mcp-server-swagger-api:latest -f Dockerfile .License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago