hollanddd/pokemon-mcp-server
If you are the rightful owner of pokemon-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Pokemon MCP Server is a Model Context Protocol server that provides access to Pokemon data via the PokeAPI, allowing clients to query detailed Pokemon information.
Pokemon MCP Server
A Model Context Protocol (MCP) server implementation that provides access to Pokemon data via the PokeAPI. This server allows MCP clients to query Pokemon information including stats, types, sprites, and more.
Features
- Pokemon Lookup: Retrieve detailed Pokemon information by name or ID
- Comprehensive Data: Access Pokemon stats, types, sprites, height, weight, and more
- Error Handling: Proper error responses for invalid Pokemon requests
- MCP Protocol: Full compliance with Model Context Protocol standards
Architecture
The server is built with a modular architecture:
main.rs: Entry point and server initializationserver.rs: MCP server implementation with tool definitionsclient.rs: HTTP client for PokeAPI interactionsmodels.rs: Data structures for Pokemon API responsesformatter.rs: Output formatting for Pokemon dataconfig.rs: Logging and configuration setup
Installation
Prerequisites
- Rust 2024 edition
- Cargo package manager
Build from Source
git clone <repository-url>
cd pokemon-mcp-server
cargo build --release
Usage
Starting the Server
cargo run
The server runs on stdio transport and will log startup information to stderr.
Available Tools
get_pokemon
Retrieves detailed information about a Pokemon by name or ID.
Parameters:
name_or_id(String): Pokemon name (case-insensitive) or numeric ID
Example Usage:
get_pokemon("pikachu")
get_pokemon("25")
Response Format:
**Pikachu** (ID: 25)
**Height:** 4 decimeters
**Weight:** 60 hectograms
**Types:** electric
**Sprite:** https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png
**Base Stats:**
hp: 35
attack: 55
defense: 40
special-attack: 50
special-defense: 50
speed: 90
Development
Running Tests
cargo test
Code Quality
# Check for compilation errors
cargo check
# Run linter
cargo clippy
# Format code
cargo fmt
Environment Variables
Set RUST_LOG to control logging levels:
RUST_LOG=debug cargo run
TurboMCP Framework
This project is built using TurboMCP, a high-performance MCP server framework for Rust.
Testing with TurboMCP CLI
For testing and development, you can use the TurboMCP CLI:
# Install turbomcp-cli
cargo install --git https://github.com/Epistates/turbomcp turbomcp-cli
# Test the server
turbomcp-cli tools-list --command "./target/release/pokemon-mcp" | jq
Dependencies
- turbomcp: MCP server framework with networking and stdio support
- tokio: Async runtime with multi-threading
- reqwest: HTTP client for API requests
- serde: Serialization/deserialization
- anyhow: Error handling
- tracing: Structured logging
API Integration
This server integrates with the PokeAPI REST API:
- Base URL:
https://pokeapi.co/api/v2/ - Endpoint:
/pokemon/{id or name} - Rate limits: Follows PokeAPI fair use policy
Error Handling
The server provides appropriate error responses:
- Invalid Request: When Pokemon is not found
- Internal Error: For network or parsing issues
- Proper Status Codes: HTTP status code handling
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run
cargo fmtandcargo clippy - Submit a pull request