Built using FastAPI to provide a high-performance framework for the MCP server implementation.
Interacts with the Swagger Petstore API using an OpenAPI 3.0 specification, providing tools for managing pets, stores, and users including operations like adding pets, placing orders, and managing user accounts.
Click on "Install 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., "@Swagger MCP Serverfind available pets by status"
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.
Swagger-MCP-server
Swagger-MCP-server is a lightweight Model Context Protocol (MCP) server that interacts with the Swagger Petstore API using an OpenAPI 3.0 specification. The server dynamically loads API tools defined in openapi.json and exposes endpoints that mimic those of the Petstore API using the mcp.server.fastmcp module.
๐ฆ Features
โ Dynamic loading of OpenAPI 3.0 spec (Petstore).
๐พ Full support for Petstore operations: Pets, Stores, Users.
โก Built using FastAPI.
๐ ๏ธ Utilizes the
mcpserver CLI and dynamic tool registration.
Related MCP server: Swagger MCP Server
๐ Installation Guide
Clone the repository
Create and activate a virtual environment
Install dependencies
๐งช Running the Server
To start the server:
This will start an MCP server that registers endpoints as defined in the openapi.json file and serves them via the Petstore API interface.
๐ API Endpoints
The server mirrors the Swagger Petstore API. It includes operations for:
Pets
Add a new pet
Update an existing pet
Find pets by status or tags
Get pet by ID
Delete a pet
Stores
Place an order
Get order by ID
Check inventory
Users
Create users
Login/logout
Get user by username
Update/delete user
๐ฆ Dependencies
Dependencies are listed in requirements.txt and include:
fastapi: High-performance API framework.
httpx: Async-compatible HTTP client.
mcp[cli]: Model Context Protocol server framework.
jsonschema: JSON Schema validation.
Install them via: