Petstore MCP Server
Provides tools to interact with the Swagger Petstore API, including searching available pets, getting pet details, and retrieving store inventory.
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., "@Petstore MCP Servershow me available pets"
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.
Theorvane Petstore MCP Example
A single runnable example showing a truthful end-to-end path from the public Swagger Petstore v2 demo API to a TypeChain @Agent() that uses an actual local MCP HTTP session.
What this proves
Swagger Petstore v2 GET API
→ injected PetstoreClient
→ TypeMCP @McpServer() / @McpTool()
→ TypeMCP Streamable HTTP handler
→ local 127.0.0.1 ephemeral-port MCP runtime
→ official MCP SDK client session
→ TypeChain @Agent() + @Tool() MCP-client façade
→ TypeChain buildAgent() / LangChain agent loopThe fixture run proves the MCP SDK client performs protocol initialization, tools/list, and tools/call over loopback Streamable HTTP. It also proves a LangChain FakeToolCallingModel selects search_available_pets, and the TypeChain @Agent() façade sends that call through the MCP client rather than calling the REST client or TypeMCP server directly.
Related MCP server: mcp_sdk_petstore_api
Prerequisites
Node.js 20 or newer
npm 10 or newer
npm ci
npm run checkRun the deterministic MCP agent example
npm run example:petstore:mcp-agent:fixtureIt starts an in-process Node HTTP server bound only to 127.0.0.1 on an ephemeral port, connects the official MCP SDK StreamableHTTPClientTransport, discovers the tools, runs the agent loop, and shuts down the MCP client session and HTTP server in finally blocks.
Expected result contains fixture data:
{
"discoveredTools": [
"search_available_pets",
"get_pet",
"get_petstore_inventory"
],
"tool": "search_available_pets",
"result": [
{ "id": 1, "name": "Milo", "status": "available" },
{ "id": 2, "name": "Nori", "status": "available" }
]
}For the narrower protocol-only smoke run (loopback URL, 404 route boundary, tools/list, and tools/call), use:
npm run example:petstore:mcp:fixtureOptional public REST smoke run
npm run example:petstore:liveThis calls the mutable public Swagger Petstore demo API. Its data and uptime are outside this repository's control, so it is not used by tests or CI. The command is a GET-only REST smoke run; it does not demonstrate MCP client connectivity or a model-backed agent.
Read-only Petstore contract
PetstoreClient has a fixed base URL, https://petstore.swagger.io/v2, and only sends GET requests. The TypeMCP server exposes exactly three tools:
MCP tool | REST operation |
|
|
|
|
|
|
The example has no create, update, delete, API-key, credential, environment-configured API host, or public listener path.
Application-owned model runtime
The fixture uses FakeToolCallingModel, not a live provider. An application that wants a real model must install/configure that model itself, then pass it together with a connected MCP client to the agent builder:
import { buildPetstoreMcpAgent } from "./examples/typechain-petstore-mcp-agent.js";
// The consuming application chooses, authenticates, and authorizes this model.
declare const applicationModel: Parameters<
typeof buildPetstoreMcpAgent
>[0]["model"];
// The application owns the lifecycle of this client connection.
declare const connectedMcpClient: Parameters<
typeof buildPetstoreMcpAgent
>[0]["client"];
const agent = buildPetstoreMcpAgent({
model: applicationModel,
client: connectedMcpClient,
});This repository deliberately does not select a provider/model, install provider SDKs, read credentials or process.env, run a live LLM command, or implement authorization/retry/audit/redaction policy.
Example-only runtime boundary
The loopback runtime is a deterministic integration example, not a production deployment recipe. It intentionally does not provide public hosting, authentication, authorization, durable sessions, a reverse proxy, observability, deployment configuration, or persistent MCP lifecycle management. A production application must own those decisions.
Development
npm run lint
npm run build
npm test
npm run audit:prod
npm run checkPackages
@theorvane/type-chain0.1.1@theorvane/type-mcp0.2.2or later within the0.2.xrange
License
MIT © Theorvane
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA lightweight server that enables interaction with the Swagger Petstore API using the Model Context Protocol, allowing operations on pets, stores, and users through dynamically loaded OpenAPI specifications.Last updated1Apache 2.0
- Flicense-qualityDmaintenanceA standalone MCP server that exposes Petstore API endpoints as tools for AI assistants like Claude and ChatGPT. It enables interaction with petstore management services through natural language by proxying API requests via SSE transport.Last updated
- Flicense-qualityDmaintenanceAn MCP server generated from an OpenAPI specification that exposes Petstore API endpoints as tools for AI assistants. It enables interaction with pet store management functionalities using the Model Context Protocol over SSE transport.Last updated
- Flicense-qualityDmaintenanceMCP server for the Petstore API enabling LLMs to find pets by status via function calling.Last updated
Related MCP Connectors
A basic MCP server to operate on the Postman API.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Theorvane/examples'
If you have feedback or need assistance with the MCP directory API, please join our Discord server