PD

procload/dnd-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

55 stars 15 forks Качество 63 Тренд 0MIT

MCP Серверная реализация API DnD 5e с использованием ресурсов, инструментов и подсказок.

Обзор

Сервер на базе Python, реализующий протокол Model Context Protocol (MCP), который соединяет Клода и других помощников ИИ с игровой информацией Dungeons & Dragons 5e. Model Context Protocol (MCP) - это фреймворк, разработанный Anthropic, который позволяет помощникам ИИ, таким как Клод, общаться с внешними инструментами и службами. Этот сервер использует FastMCP, реализацию протокола Anthropic на Python, для создания структурированного моста между помощниками ИИ и API D&D 5e. Для подробного объяснения MCP и того, как этот проект реализует его, ознакомьтесь с нашей статьей в блоге.

Обзор (машинный перевод)

Сервер на базе Python, реализующий протокол Model Context Protocol (MCP), который соединяет Клода и других помощников ИИ с игровой информацией Dungeons & Dragons 5e.

Что такое MCP?

Model Context Protocol (MCP) - это фреймворк, разработанный Anthropic, который позволяет помощникам ИИ, таким как Клод, общаться с внешними инструментами и службами. Этот сервер использует FastMCP, реализацию протокола Anthropic на Python, для создания структурированного моста между помощниками ИИ и API D&D 5e.

Для подробного объяснения MCP и того, как этот проект реализует его, ознакомьтесь с нашей статьей в блоге.

Особенности

FastMCP Интеграция Предоставляет помощникам ИИ инструменты и ресурсы для запроса данных игр D&D D&D 5e API интеграция Полный доступ к заклинаниям, монстрам, оборудованию, классам, гонкам и многим другим Эффективное кэширование: постоянное локальное хранилище ответов API для повышения производительности Структурированный доступ к данным: четко определенные ресурсы и инструменты для последовательного взаимодействия ИИ ** Источник атрибуции**: Комплексное отслеживание и отображение источников информации ** Визуальное форматирование**: Шаблоны Markdown для красивой презентации контента D&D

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

D&D Knowledge Navigator

A Python-based server implementing the Model Context Protocol (MCP) that connects Claude and other AI assistants to Dungeons & Dragons 5e game information.

What is MCP?

The Model Context Protocol (MCP) is a framework developed by Anthropic that enables AI assistants like Claude to communicate with external tools and services. This server leverages FastMCP, Anthropic’s Python implementation of the protocol, to create a structured bridge between AI assistants and the D&D 5e API.

For a detailed explanation of MCP and how this project implements it, check out our blog article.

Features

  • FastMCP Integration: Provides AI assistants with tools and resources to query D&D game data
  • D&D 5e API Integration: Complete access to spells, monsters, equipment, classes, races, and more
  • Efficient Caching: Persistent local storage of API responses for improved performance
  • Structured Data Access: Well-defined resources and tools for consistent AI interactions
  • Source Attribution: Comprehensive tracking and display of information sources
  • Visual Formatting: Markdown templates for beautiful presentation of D&D content
  • Query Enhancement: Intelligent processing of D&D queries with synonym handling and fuzzy matching

Setup

Prerequisites

  • Python 3.10 or higher
  • uv package manager (recommended)
  • Claude Desktop client (for using with Claude)

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/dnd-knowledge-navigator.git
    cd dnd-knowledge-navigator
    
  2. Install dependencies:

    uv pip install -r requirements.txt
    

    or

    pip install .
    
  3. Configure Claude Desktop (if using with Claude):

    • Create a claude_desktop_config.json file in your Claude Desktop configuration directory
    • Add the following configuration (adjust paths as needed):
      {
        "mcpServers": {
          "dnd": {
            "command": "/path/to/uv",
            "args": [
              "--directory",
              "/path/to/dnd-knowledge-navigator",
              "run",
              "dnd_mcp_server.py"
            ]
          }
        }
      }
      
  4. Run the server:

    uv run python dnd_mcp_server.py
    

MCP Tool Usage

When connected to an AI assistant, the following tools are available:

  • search_all_categories: Search across all D&D resources for specific terms
  • verify_with_api: Verify D&D statements against official API data
  • check_api_health: Check the health and status of the D&D 5e API

Source Attribution System

The server includes a comprehensive source attribution system that:

  • Tracks the source of all information returned to the user
  • Provides confidence levels for each piece of information
  • Includes API endpoints and relevance scores
  • Formats attribution information for clear presentation

Template System

Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "dnd": { "command": "/path/to/uv", "args": [ "--directory", "/path/to/dnd-knowledge-navigator", "run", "dnd_mcp_server.py" ] } } }