sbox-mcp-documentation

sbox-mcp-documentation

An MCP server that provides AI assistants with searchable access to the full s&box game engine documentation and API reference.

Category
访问服务器

README

sbox-mcp-documentation

npm version License: MIT

An MCP (Model Context Protocol) server that provides AI assistants with searchable access to the full s&box game engine documentation — 180+ pages of guides, tutorials, and concepts — plus the complete API reference with 1,800+ types and 15,000+ members.

Quick Start

No installation required — use npx directly in your MCP config:

{
    "servers": {
        "sbox-docs": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "sbox-mcp-documentation"]
        }
    }
}

Or install globally:

npm install -g sbox-mcp-documentation

Features

Documentation

  • Full-text search across all s&box documentation with fuzzy matching and relevance ranking
  • Direct page retrieval with chunked reading for large pages
  • Category browsing to discover available documentation topics

API Reference

  • API type search across 1,800+ public types (classes, structs, enums, interfaces) with member-aware ranking
  • Detailed type lookup — methods, properties, fields, events, XML doc comments, and inheritance info
  • Chunked output for large types so no detail is truncated

General

  • Automatic caching — docs cached for 4 hours, API schema cached for 24 hours
  • Background indexing on startup — both subsystems ready within seconds
  • Built-in self-tests to verify the server is working correctly

Data Sources

Documentation

Documentation is fetched from the official s&box wiki via the LLM-optimized index at sbox.game/llms.txt. This file lists all available documentation pages, and each page is fetched as raw Markdown from sbox.game/dev/doc/{page}.md. The server crawls all listed pages and builds a local search index using MiniSearch.

API Reference

The API schema is downloaded from the Facepunch CDN as a JSON file (the same data powering sbox.game/api). It contains all public types from the s&box assembly — 1,800+ types with full member signatures, XML doc comments, and inheritance info. The server strips internal/compiler-generated types and indexes everything with MiniSearch for fast fuzzy lookup.

Installation

Option 1: npx (recommended)

No install needed. Just reference npx sbox-mcp-documentation in your MCP configuration (see below).

Option 2: Global install

npm install -g sbox-mcp-documentation

Option 3: From source

git clone https://github.com/fiedlermarius/sbox-mcp-documentation.git
cd sbox-mcp-documentation
npm install
npm run build

Configuration

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your workspace:

{
    "servers": {
        "sbox-docs": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "sbox-mcp-documentation"]
        }
    }
}

Cursor

Add to .cursor/mcp.json:

{
    "mcpServers": {
        "sbox-docs": {
            "command": "npx",
            "args": ["-y", "sbox-mcp-documentation"]
        }
    }
}

Claude Desktop

Add to your Claude Desktop config (%APPDATA%/Claude/claude_desktop_config.json on Windows):

{
    "mcpServers": {
        "sbox-docs": {
            "command": "npx",
            "args": ["-y", "sbox-mcp-documentation"]
        }
    }
}

Local Checkout Example

If you want to use a local checkout instead of npx, update your configuration as follows:

{
    "servers": {
        "sbox-docs": {
            "type": "stdio",
            "command": "node",
            "args": ["<path-to-repo>/dist/index.js"]
        }
    }
}

As shown above, you need to replace "command": "npx" and "args" with "command": "node" and "args": ["<path-to-repo>/dist/index.js"].

Tools

Tool Description
sbox_search_docs Search documentation with fuzzy matching. Returns titles, URLs, categories, and relevant snippets. Supports category filtering and result limits.
sbox_get_doc_page Fetch a specific documentation page as Markdown. Supports chunked reading via start_index and max_length for large pages.
sbox_list_doc_categories List all documentation categories with page counts. Useful for discovering what topics are available.
sbox_search_api Search the s&box API reference by type name, namespace, or keyword. Returns matching types with namespace, description, and top member names.
sbox_get_api_type Get full details for a specific API type — all methods, properties, fields, events, XML doc comments, and inheritance. Supports chunked output for large types.
sbox_cache_status Show cache and index health — page counts, freshness, and whether both docs and API indexing are complete.
sbox_run_tests Run built-in self-tests for all six modules (cache, search, crawler — docs and API). Returns pass/fail results per test case.

Architecture

sbox.game/llms.txt (doc index)            cdn.sbox.game (AssemblySchema JSON)
        │                                           │
        ▼                                           ▼
   DocCrawler ──► GET /llms.txt             ApiCrawler ──► resolves schema URL
        │         GET /dev/doc/*.md               │         downloads + filters types
        │                                           │
        ▼                                           ▼
     DocCache ──► ~/.sbox-docs-mcp/cache/       ApiCache ──► ~/.sbox-docs-mcp/cache/
        │        manifest.json (TTL 4h)              │        api-types.json (TTL 24h)
        │                                           │
        ▼                                           ▼
   DocSearch ──► MiniSearch index            ApiSearch ──► MiniSearch index
                 title (3x), category (2x),              name (4x), fullName (3x),
                 content (1x)                            members (2x), namespace (1.5x)

Cache Behavior

  • Location: ~/.sbox-docs-mcp/cache/
  • Docs TTL: 4 hours (configurable via SBOX_DOCS_CACHE_TTL env var, in seconds)
  • API TTL: 24 hours — the schema is large (~9 MB) and changes infrequently
  • Custom directory: Set SBOX_DOCS_CACHE_DIR env var
  • Both caches are populated on server startup in the background
  • Set SBOX_API_SCHEMA_URL to pin a specific schema version

Related Projects

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选