Llewhtor/mcp-learn
If you are the rightful owner of mcp-learn 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.
This is a Model Context Protocol (MCP) server implementation that provides a chat interface to the Guild Wars 2 API.
Guild Wars 2 MCP Server
This is a Model Context Protocol (MCP) server implementation that provides a chat interface to the Guild Wars 2 API.
Features
- Account information lookup
- Character details and comparison
- Wallet contents with formatted currency
- Bank contents sorted by rarity
- Achievement tracking
- Streaming support for large inventory queries
Setup
- Ensure you have Python 3.8 or newer installed
- Create a virtual environment:
python -m venv .venv - Activate the virtual environment:
- Windows:
.\.venv\Scripts\activate - Unix/MacOS:
source .venv/bin/activate
- Windows:
- Create a
.envfile with your GW2 API key:GW2_API_KEY=your-api-key-here - Install dependencies:
pip install -r requirements.txt
Running the Server
To start the server:
python main.py
The server will start at http://localhost:8000 and listen for incoming MCP requests.
How it Works
The server implements the MCP specification to provide a chat interface for the Guild Wars 2 API. It handles requests through the process_request method, which interprets natural language queries and converts them into appropriate GW2 API calls.
Available Commands
- Account information: "Show my account information"
- Character list: "List my characters"
- Character details: "Show character details for [NAME]"
- Character comparison: "Compare characters [NAME1] and [NAME2]"
- Wallet contents: "Show my wallet"
- Bank contents: "Show my bank"
- Achievements: "Show my achievements"
Response Format
Responses are formatted in a user-friendly way:
- Currencies are properly formatted (gold, silver, copper)
- Bank items are sorted by rarity
- Character comparisons use formatted tables
- Large responses use streaming for better performance
Error Handling
The server includes comprehensive error handling for:
- GW2 API rate limiting
- Network connectivity issues
- Invalid API keys
- Missing or incorrect parameters
- Character not found scenarios
Testing
You can test the server using any MCP client. The server processes natural language queries about your Guild Wars 2 account and returns formatted responses according to the MCP specification.