Sponsored by Deepsite.site

MTG Assistant

Created By
0010aor8 months ago
A Model Context Protocol server that provides Magic: The Gathering card information fetching capabilities using the Scryfall API.
Content

MCP Server MTG Assistant

A Model Context Protocol server that provides Magic: The Gathering card information fetching capabilities using the Scryfall API.

Example Rules Question Workflow

While primarily used for looking up specific card details, this server can also be a crucial first step in answering MTG rules questions.

User Query: "If I cast a Finale of Devastation with X=10 and search for an Avenger of Zendikar, do the tokens also get +10/+10 and haste, or not?"

Example Interaction

Available Tools

  • get_mtg_card_info - Retrieves details for a specific Magic: The Gathering card from Scryfall.
    • query (string, required): The search query string (e.g., card name, partial name, characteristics).

Installation and Running

This project uses uv for dependency management and running scripts.

Ensure uv is installed. You can run the server directly from the project directory:

# Navigate to the project root directory first
cd path/to/mcp-servers/mcp-mtg-assistant

# Install dependencies (if needed) and run the server script
uv run mcp-server-mtg-assistant

Using PIP (for distribution or alternative setup)

If the package were published, you could install it via pip:

pip install mcp-server-mtg-assistant

After installation, you could run it as a script:

python -m mcp_server_mtg_assistant

For development, you typically run it using uv run as shown above.

Configuration

Configure for MCP Clients (e.g., Claude.app, Inspector)

Add an entry to your client's MCP server configuration. The exact key ("mtg-assistant" in the examples) can be chosen by you.

Important: The configuration needs to point uv to the correct project directory using the --directory argument. The path style (/ vs \) depends on your operating system and how you run uv.

Default: Using uv Directly (Linux/macOS/WSL)

This is the standard approach if your MCP client and the server run in the same Linux, macOS, or WSL environment.

// Example for mcp.json or Claude settings
"mcpServers": {
  "mtg-assistant": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/mcp-servers/mcp-mtg-assistant", // Unix-style path
      "run",
      "mcp-server-mtg-assistant"
    ]
  }
}
Windows Client + WSL Server

This configuration is recommended if your MCP client runs on Windows, but you want the server to execute within WSL It uses wsl.exe to invoke uv inside WSL.

Requirements:

  • uv must be installed inside your WSL distribution.
  • Adjust the path to uv inside WSL (e.g., /home/user/.cargo/bin/uv) if it's not in the WSL PATH.
  • Use the /mnt/... style path for the --directory argument accessible from within WSL.
// Example for mcp.json or Claude settings on Windows
"mcpServers": {
  "mtg-assistant": {
    "command": "wsl.exe",
    "args": [
      "/home/your-user/.cargo/bin/uv", // uv WSL PATH
      "--directory",
      "/mnt/d/repos/mcp-servers/mcp-mtg-assistant", // WSL-style path to project
      "run",
      "mcp-server-mtg-assistant"
    ]
  }
}
Alternative: Using uv Directly on Windows

This assumes uv is installed directly on Windows and your MCP client also runs directly on Windows.

  • Use the Windows-style path (D:\...) for the --directory argument.
  • Be mindful of potential .venv conflicts if you also use WSL (see below).
// Example for mcp.json or Claude settings on Windows
"mcpServers": {
  "mtg-assistant": {
    "command": "uv",
    "args": [
      "--directory",
      "D:\path\to\mcp-servers\mcp-mtg-assistant", // Windows-style path
      "run",
      "mcp-server-mtg-assistant"
    ]
  }
}

Handling .venv Conflicts (Different Environments)

  • Problem: uv run creates a .venv directory specific to the operating system/environment (e.g., Linux vs. Windows). If you switch between running the server directly on Windows and running it via WSL (or native Linux), the existing .venv might be incompatible.
  • Solution: Before switching environments, delete the .venv directory in the mcp-mtg-assistant project root. uv run will then create a fresh, compatible one for the environment you are using.

Debugging

You can use the MCP inspector to debug the server by prefixing the command and arguments from your configuration with npx @modelcontextprotocol/inspector.

# Example using the Default (Linux/macOS/WSL) configuration:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-servers/mcp-mtg-assistant run mcp-server-mtg-assistant

# Example using the Recommended (Windows Client + WSL Server) configuration:
npx @modelcontextprotocol/inspector wsl.exe /home/your-user/.cargo/bin/uv --directory /mnt/d/repos/mcp-servers/mcp-mtg-assistant run mcp-server-mtg-assistant

# Example using the Alternative (Direct Windows) configuration:
npx @modelcontextprotocol/inspector uv --directory D:\path\to\mcp-servers\mcp-mtg-assistant run mcp-server-mtg-assistant

Contributing

We encourage contributions to help expand and improve this MTG Assistant MCP server. Whether you want to add new features, enhance existing functionality, or improve documentation, your input is valuable.

For examples of other MCP servers and implementation patterns, see: https://github.com/modelcontextprotocol/servers

Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements.

License

mcp-server-mtg-assistant is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors