
tkmct/godot-doc-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Offline Model Context Protocol (MCP) server that serves Godot Engine API documentation from a local doc/ folder.
Обзор
Offline Model Context Protocol (MCP) server that serves Godot Engine API documentation from a local doc/ folder. It provides fast search and retrieval of class/method/signal/property docs over stdio to any MCP‑capable client. - Zero network at runtime (local docs only) - Parses Godot 4.x XML docs; tolerates 3.x variants - Builds an in‑memory search index with optional on‑disk warm start - Exposes stable MCP tools for search and retrieval Prereqs: - Node.js 20+ - pnpm (recommended) or npm Docs source: - Place Godot XML docs under ./doc/classes/*.xml (this repo already includes a representative set for local testing). Point GODOT_DOC_DIR elsewhere if you keep docs outside the repo. - Need fresh docs from an existing Godot checkout? Run the editor binary with --doctool pointing at your target doc/classes folder (add --headless for CI/servers).
README
Показан фрагмент оригинального README. Открыть оригинал.
Godot API Docs MCP Server
Offline Model Context Protocol (MCP) server that serves Godot Engine API documentation from a local doc/ folder. It provides fast search and retrieval of class/method/signal/property docs over stdio to any MCP‑capable client.
- Zero network at runtime (local docs only)
- Parses Godot 4.x XML docs; tolerates 3.x variants
- Builds an in‑memory search index with optional on‑disk warm start
- Exposes stable MCP tools for search and retrieval
Quick Start
Prereqs:
- Node.js 20+
- pnpm (recommended) or npm
Docs source:
-
Place Godot XML docs under
./doc/classes/*.xml(this repo already includes a representative set for local testing). PointGODOT_DOC_DIRelsewhere if you keep docs outside the repo. -
Need fresh docs from an existing Godot checkout? Run the editor binary with
--doctoolpointing at your targetdoc/classesfolder (add--headlessfor CI/servers). If you don’t already have the CLI binary on yourPATH, follow the official command line instructions to install or alias it (package install, manual build, or exporting the editor).# inside the upstream Godot repo after building the editor, or anywhere godot is on PATH godot --doctool ./doc/classes --headlessThe command exports the full XML set (classes, signals, etc.). Repeat whenever you update your Godot source to keep docs in sync.
Run (stdio):
# from repo root
export GODOT_DOC_DIR=./doc
pnpm install
pnpm dev # hot reload via tsx, runs the stdio MCP server
# or run without watch
pnpm start
Smoke tests and examples:
# Lightweight end‑to‑end checks
pnpm test
# Example local smoke against the parser/index/tools (no external clients)
pnpm run smoke:local
# Minimal MCP client demo (stdio handshake + tool calls)
pnpm run smoke:mcp
# Manual, step‑by‑step stdio session (prints what to send/expect)
node --import tsx scripts/manual-stdio.mjs
What This Is
This project turns the Godot docs you already have locally into an MCP server so LLM tooling can search and retrieve authoritative API information offline. The server:
- Parses
doc/classes/*.xmlinto typed objects - Builds a compact inverted index covering class names and text fields
- Serves MCP tools over stdio for search and direct lookup
- Optionally writes
.cache/godot-index.jsonfor warm starts
Non‑goals (for now): authoring docs, live web fetching, or general web search.
Repository Layout
server/— MCP server implementation (TypeScript)server/src/index.ts— bootstrap/containerserver/src/cli.ts— CLI (stdio by default)server/src/mcp/stdio.ts— MCP wiring: tools/resources/promptsserver/src/parser/xmlParser.ts— Godot XML → typed docsserver/src/indexer/— index build + persistence (if present)server/src/search/searchEngine.ts— in‑memory search
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →