Petfinder MCP Server
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., "@Petfinder MCP Serverfind adoptable dogs in Los Angeles"
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.
Petfinder MCP Server
Single-file HTTP MCP Server for Petfinder's API to find adoptable pets and the organizations that care for them, powered by Bun.
OAuth token management โ automatically handles Petfinder API authentication and token refresh
Pet search capabilities โ find adoptable pets by characteristics, location, and status
Organization search โ discover animal welfare organizations by name, ID, and location
Single file implementation โ complete MCP server in
simple-mcp-server.tsAll capabilities are exposed as MCP tools over a Bun HTTP server
๐ก Don't have Bun? Install it from https://bun.com/
๐๏ธ Built With
This single-file MCP server uses:
Bun's built-in HTTP server - Ultra-fast native HTTP handling with zero dependencies
Zod - TypeScript-first schema validation for bulletproof input validation
Petfinder API v2 - RESTful API for accessing adoptable pets and animal welfare organizations
Native fetch - Built-in HTTP client for API calls
Related MCP server: mcp_sdk_petstore_api
๐ Authentication
This MCP server handles Petfinder OAuth authentication automatically via query parameters:
Query Parameter Authentication
Add your Petfinder credentials as query parameters to the MCP server URL:
http://localhost:3000/mcp?client-id=your-petfinder-client-id&client-secret=your-petfinder-client-secretOAuth Flow Management
Client credentials flow: Exchanges your credentials for access tokens automatically
Multi-client token caching: Each client ID gets its own isolated token cache
Automatic token management: Caches tokens in-memory with expiration tracking per client
Token refresh: Automatically requests new access tokens when expired (every 3600 seconds)
Bearer token authentication: Uses access tokens in
Authorization: Bearer {token}headers
MCP Client Integration
When adding this MCP server to MCP clients (Claude.ai, MCP Inspector, etc.):
Use the server URL with your credentials:
http://localhost:3000/mcp?client-id=your-client-id&client-secret=your-client-secretNo additional headers or configuration needed
The server automatically extracts credentials from the URL query parameters
Works seamlessly with all MCP clients that support HTTP servers
โจ Features
Capability | Petfinder API endpoint |
Search for adoptable pets |
|
Get specific pet details |
|
Search animal welfare organizations |
|
Get organization details |
|
List all animal types |
|
Get animal type details |
|
List breeds for animal type |
|
Typical MCP request:
POST /mcp
{
"tool": "pets.search",
"input": {
"type": "dog",
"breed": "labrador",
"size": "medium",
"location": "90210",
"distance": 25,
"limit": 20
}
}๐ Repo layout
.
โโ simple-mcp-server.ts # Complete single-file MCP server
โโ package.json # Dependencies (bun, zod)
โโ tsconfig.json # TypeScript configuration
โโ Dockerfile # Container deployment
โโ README.md # This fileThe entire MCP server is implemented in a single TypeScript file (simple-mcp-server.ts) that handles OAuth token management and Petfinder API integration.
โ๏ธ Prerequisites
Petfinder API credentials
Sign up for a developer account at https://www.petfinder.com/developers/
Create an application to get your API Key (Client ID) and Secret
No additional permissions or approval needed - the API uses OAuth client credentials flow
Bun โฅ 1.2.19 installed locally (or let Docker handle it).
๐ Configuration
Name | Example | Required | Description |
|
| โ | Server port (defaults to 3000) |
๐ Authentication: Credentials are provided via query parameters only - no environment variables needed!
Getting your credentials:
Create a Petfinder account at petfinder.com if you don't have one
Get your API Key (Client ID) and Secret at petfinder.com/user/developer-settings
Use these credentials as query parameters when connecting to the MCP server
๐งช Development & Testing
You can use the official MCP Inspector to interactively test this server.
Start the server in one terminal:
bun run simple-mcp-server.tsRun the inspector in another terminal with your credentials:
npx @modelcontextprotocol/inspector "http://localhost:3000/mcp?client-id=your-client-id&client-secret=your-client-secret"
This will launch a web UI where you can see all available tools and manually trigger them with different parameters, making it easy to debug your tool logic.
โถ๏ธ Running locally
# Install deps
bun install
# Run server on port 3000 (no environment variables needed!)
bun run simple-mcp-server.tsSend a request:
curl -X POST "http://localhost:3000/mcp?client-id=your-client-id&client-secret=your-client-secret" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "pets.search",
"arguments": {
"type": "dog",
"breed": "labrador",
"location": "90210",
"distance": 25,
"limit": 10
}
}
}'Youโll get real JSON responses from the Petfinder API using your provided credentials.
Additional endpoints
Route | Method | Purpose |
| GET/HEAD | Simple health-check (returns |
All responses include Access-Control-Allow-Origin: * so the MCP can be called from a browser without extra CORS configuration.
๐พ OAuth Token Management
The server handles Petfinder API authentication automatically:
Token exchange: Uses
CLIENT_IDandCLIENT_SECRETto request access tokens fromhttps://api.petfinder.com/v2/oauth2/tokenIn-memory caching: Caches access tokens in-memory with expiration tracking (tokens expire after 3600 seconds)
Automatic refresh: Detects expired tokens and automatically requests new ones before making API calls
Bearer authentication: Includes
Authorization: Bearer {access_token}header in all Petfinder API requests
The OAuth flow follows Petfinder's client credentials pattern:
curl -d "grant_type=client_credentials&client_id={CLIENT-ID}&client_secret={CLIENT-SECRET}" \
https://api.petfinder.com/v2/oauth2/tokenResponse format:
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "..."
}๐ ๏ธ MCP tool set
Tool | Purpose | Input โ Output |
| find adoptable pets |
|
| get specific pet details |
|
| find animal welfare orgs |
|
| get specific org details |
|
| list all animal types |
|
| get animal type details |
|
| list breeds for animal type |
|
๐ Search Parameters:
Pet search: Filter by animal type (dog, cat, etc.), breed, size (small/medium/large), location (ZIP/postal code), distance radius
Organization search: Filter by name, location, state/province, country
Pagination: Use
limitparameter to control result count (default: 20, max: 100)Location-based: Distance searches require a location parameter (ZIP code, city, etc.)
๐ Response Data:
Pet objects: Include photos, description, age, gender, size, breed, contact info, and adoption status
Organization objects: Include name, address, phone, email, website, and mission statement
Rich metadata: Comprehensive information to help users make informed adoption decisions
๐ MCP Client Integration & Debugging
This server includes comprehensive request logging to help you integrate with MCP clients:
Example with query parameter authentication:
curl -X POST "http://localhost:3000/mcp?client-id=your-client-id&client-secret=your-client-secret" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'Debug Output: The server logs all incoming requests, query parameters, and authentication attempts to help you see exactly what your MCP client is sending and troubleshoot any authentication issues.
Search Examples
Pet Search Examples:
# Find dogs in Los Angeles area
{ "type": "dog", "location": "90210", "distance": 25 }
# Find small cats ready for adoption
{ "type": "cat", "size": "small", "limit": 10 }
# Find specific breed
{ "type": "dog", "breed": "golden retriever", "location": "New York, NY" }Organization Search Examples:
# Find shelters by name
{ "name": "SPCA" }
# Find organizations in specific state
{ "state": "CA", "limit": 15 }
# Find organizations near location
{ "location": "Austin, TX" }Typical Pet Response includes:
id- Unique pet identifiername- Pet's namephotos- Array of photo URLsdescription- Detailed descriptionbreeds- Primary and secondary breedsage,gender,size- Basic characteristicscontact- Organization contact informationstatus- Adoption status (adoptable, pending, etc.)
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.
Latest Blog Posts
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/mattlgroff/petfinder-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server