This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
Environment Variables
Set the following environment variables before running:
# Required for Calculator Basic API (Bearer token auth)
export CALCULATOR_BEARER_TOKEN=your-secret-token
OpenAPI Specifications
This server hosts multiple OpenAPI specifications:
| Spec Name | File | Endpoint | Description |
|---|---|---|---|
| OpenAPI 1 | openapi1.json | /api/openapi/openapi1 | User API v1 |
| OpenAPI 2 | openapi2.json | /api/openapi/openapi2 | User API v2 |
| Calculator Basic | calculator-basic.json | /api/openapi/calculator-basic | Add/Subtract with Bearer auth |
| Calculator OAuth | calculator-oauth.json | /api/openapi/calculator-oauth | Multiply with OAuth |
List All Available Specs
curl http://localhost:3000/api/openapi
Get a Specific Spec
curl http://localhost:3000/api/openapi/calculator-basic
Calculator APIs
Calculator Basic (Bearer Token Authentication)
Requires Authorization: Bearer <token> header where token matches CALCULATOR_BEARER_TOKEN env var.
Add two numbers:
curl -X POST http://localhost:3000/api/calculator-basic/add \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"a": 10, "b": 5}'
Response: {"result": 15}
Subtract two numbers:
curl -X POST http://localhost:3000/api/calculator-basic/subtract \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"a": 10, "b": 3}'
Response: {"result": 7}
Calculator OAuth (OAuth 2.0 Authentication)
Requires Authorization: Bearer <oauth-token> header with a valid OAuth token (minimum 10 characters for demo).
Multiply two numbers:
curl -X POST http://localhost:3000/api/calculator-oauth/multiply \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-oauth-token-here" \
-d '{"a": 6, "b": 7}'
Response: {"result": 42}
Docker Deployment
Build and run with Docker:
# Build the image
docker build -t mcp-poc-app .
# Run the container
docker run -p 3000:3000 -e CALCULATOR_BEARER_TOKEN=your-secret-token mcp-poc-app
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
Summary
Petstore - OpenAPI 3.1: This is a sample Pet Store Server based on the OpenAPI 3.1 specification.
Some useful links:
For more information about the API: Find out more about Swagger
Table of Contents
Installation
[!TIP] To finish publishing your MCP Server to npm and others you must run your first generation action.
MCP Bundle (Desktop Extension)
Install the MCP server as a Desktop Extension using the pre-built mcp-server.mcpb file:
Simply drag and drop the mcp-server.mcpb file onto Claude Desktop to install the extension.
The MCP bundle package includes the MCP server and all necessary configuration. Once installed, the server will be available without additional setup.
[!NOTE] MCP bundles provide a streamlined way to package and distribute MCP servers. Learn more about Desktop Extensions.
Cursor
Or manually:
- Open Cursor Settings
- Select Tools and Integrations
- Select New MCP Server
- If the configuration file is empty paste the following JSON into the MCP Server Configuration:
{
"mcpServers": {
"Petstore": {
"command": "npx",
"args": [
"petstore",
"start",
"--environment",
"...",
"--api-key",
"..."
]
}
}
}
Claude Code CLI
claude mcp add petstore npx petstore start -- --environment ... --api-key ...
Windsurf
Refer to Official Windsurf documentation for latest information
- Open Windsurf Settings
- Select Cascade on left side menu
- Click on
Manage MCPs. (To Manage MCPs you should be signed in with a Windsurf Account) - Click on
View raw configto open up the mcp configuration file. - If the configuration file is empty paste the full json
{
"mcpServers": {
"Petstore": {
"command": "npx",
"args": [
"petstore",
"start",
"--environment",
"...",
"--api-key",
"..."
]
}
}
}
VS Code
Refer to Official VS Code documentation for latest information
- Open Command Palette
- Search and open
MCP: Open User Configuration. This should open mcp.json file - If the configuration file is empty paste the full json
{
"mcpServers": {
"Petstore": {
"command": "npx",
"args": [
"petstore",
"start",
"--environment",
"...",
"--api-key",
"..."
]
}
}
}
Claude Desktop
Claude Desktop doesn't yet support SSE/remote MCP servers.You need to do the following
- Open claude Desktop
- Open left hand side pane, then click on your Username
- Go to
Settings - Go to
Developertab (on the left hand side) - Click on
Edit ConfigPaste the following config in the configuration
{
"mcpServers": {
"Petstore": {
"command": "npx",
"args": [
"petstore",
"start",
"--environment",
"...",
"--api-key",
"..."
]
}
}
}
Stdio installation via npm
To start the MCP server, run:npx petstore start --environment ... --api-key ...
For a full list of server arguments, run:
npx petstore --help
