Skip to main content
Glama
MTA:SA Documentation MCP Server

MTA:SA Documentation MCP Server

MTA:SA 文档 MCP 服务器

一个 MCP (Model Context Protocol) 服务器,为 AI 助手提供可靠、结构化的 Multi Theft Auto: San Andreas 文档访问权限。

它结合了快速关键词搜索、语义匹配和基于 SQLite 的缓存,使智能体能够发现正确的 API 并获取权威文档,而无需手动抓取 Wiki。

亮点

  • 11 个用于发现、文档检索、缓存操作和工作流指导的 MCP 工具

  • 事件优先发现 (search_events, find_events_for_task)

  • 基于 SQLite 向量搜索的语义任务匹配

  • 智能关键词扩展 (例如,database -> db* API)

  • 内置弃用检测和警告

  • 具有可配置生命周期的本地 SQLite 缓存

  • CI 验证门控、冒烟测试和发布自动化

Related MCP server: Documentation Retrieval MCP Server (DOCRET)

安装

要求:

  • Node.js 24+

  • Bun 1.3+ (可选运行时)

  • pnpm 10+ (用于本地开发)

启动器说明:

  • 您可以通过 npx、pnpx、bunx 或 yarn dlx 风格的流程启动/安装。

  • 运行时支持跨运行时:Node.js (通过 node:sqlite) 和 Bun (通过 bun:sqlite)。

从 npm 安装 (推荐)

npm install -g mtasa-docs-mcp

或者:

pnpm add -g mtasa-docs-mcp

快速安装

将 mtasa-docs MCP 服务器添加到 Cursor

从源码安装

git clone https://github.com/Luminaire1337/mtasa-docs-mcp.git
cd mtasa-docs-mcp
pnpm install
pnpm build

如果您的环境跳过了可选的本地依赖项,请运行:

pnpm install --force

MCP 客户端设置

Cursor (手动)

全局:~/.cursor/mcp.json

项目:.cursor/mcp.json

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

VS Code (手动)

工作区:.vscode/mcp.json

用户:命令面板 -> MCP: Open User Configuration

{
  "servers": {
    "mtasa-docs": {
      "command": "npx",
      "args": ["-y", "mtasa-docs-mcp"]
    }
  }
}

或者通过终端添加:

code --add-mcp "{\"name\":\"mtasa-docs\",\"command\":\"npx\",\"args\":[\"-y\",\"mtasa-docs-mcp\"]}"

Claude Code (CLI)

claude mcp add-json mtasa-docs '{"type":"stdio","command":"npx","args":["-y","mtasa-docs-mcp"]}'

OpenCode (手动)

全局配置文件:~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mtasa-docs": {
      "type": "local",
      "command": ["npx", "-y", "mtasa-docs-mcp"],
      "enabled": true
    }
  }
}

Antigravity (手动)

配置文件:~/.gemini/antigravity/mcp_config.json

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

通用 MCP 客户端 (手动)

{
  "mcpServers": {
    "mtasa-docs": {
      "command": "node",
      "args": ["/absolute/path/to/mtasa-docs-mcp/build/index.js"]
    }
  }
}

如果 mtasa-docs-mcp 已经发布,请将命令替换为:

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

可用工具

  • search_functions

  • search_events

  • find_functions_for_task

  • find_events_for_task

  • get_function_docs

  • get_multiple_function_docs

  • get_function_examples

  • list_functions_by_category

  • get_cache_stats

  • recommend_doc_workflow

  • clear_cache

开发

pnpm build
pnpm test
pnpm test:runtime
pnpm smoke
pnpm smoke:cross-runtime
pnpm verify
pnpm verify:full

有用的检查:

  • pnpm check:versions - 保持 package.json 和 MCP 服务器版本一致

  • pnpm check:changelog - 确保 CHANGELOG.md 具有当前发布标题

  • pnpm check:tool-names - 防止遗留工具命名回归

  • pnpm test:runtime - 运行 Node 和 Bun 冒烟路径的集成运行时测试

  • pnpm smoke:cross-runtime - 针对 Node 和 Bun 运行时运行冒烟检查

脚本位于 scripts/ (构建、冒烟、发布防护)。

发布流程

发布自动化由 .github/workflows/release.yml 处理。

  1. 在 package.json 和 src/index.ts 中提升版本号。

  2. 使用 ## [x.y.z] - YYYY-MM-DD 将发布说明从 Unreleased 移动到 CHANGELOG.md 中的版本化部分。

  3. 创建并推送发布标签:git tag v<version> && git push origin v<version>。

分支策略:

  • v1.0.0 之前:允许直接推送到 master。

  • 从 v1.0.0 开始:所有对 master 的更改均使用基于 PR 的开发。

在发布标签推送 (v*.*.*) 时,发布工作流会:

  • 检查版本是否已存在于 npm 上

  • 运行 pnpm verify:full

  • 使用受信任的发布 (OIDC) 将带有来源证明的包发布到 npm

  • 使用 GitHub OIDC 将 server.json 发布到 MCP 注册表

  • 从 CHANGELOG.md 创建/更新 GitHub Release

  • 验证已发布包的可安装性并运行冒烟测试

维护者设置 npm 受信任发布

在 npm 包设置中,为此存储库和工作流配置受信任的发布者:

  • 存储库:Luminaire1337/mtasa-docs-mcp

  • 工作流文件:.github/workflows/release.yml

  • 环境 (如果使用):匹配您的 GitHub Actions 配置

维护者设置 MCP 注册表发布

  • 确保 server.json 存在于存储库根目录并使用此包名称:mtasa-docs-mcp

  • 为 io.github.Luminaire1337/mtasa-docs-mcp 配置 MCP 注册表所有权

  • 发布工作流使用 mcp-publisher login github-oidc,并且仅在 npm 发布门控通过时才发布

CI 工作流

  • .github/workflows/ci.yml - 推送/PR 到 master 时的验证 (Ubuntu + macOS),以及标记 PR 上的可选实时 Wiki 集成测试

  • .github/workflows/release.yml - 发布标签 (v*.*.*) 时的自动发布和 GitHub Release

项目文档

  • AGENTS.md - 架构和贡献者指南

  • FEATURES.md - 路线图和想法

  • CHANGELOG.md - 发布历史

  • SECURITY.md - 漏洞披露政策

许可证

GNU 通用公共许可证 v3.0。请参阅 LICENSE。

Available Tools

11 tools
clear_cacheB

Clear the MTA:SA documentation cache for a specific function or all functions.

Inputs: function_name (required).

find_events_for_taskA

Task-to-events matcher. Use when you need event names for handlers/triggers (e.g., resource lifecycle, player joins, marker hits). Returns ranked MTA:SA events only.

Inputs: task_description (required), side, limit.

find_functions_for_taskA

Task-to-functions matcher. Use this FIRST when user intent is high-level (e.g., 'vehicle dealership', 'login panel'). Returns ranked MTA:SA functions/events optimized for follow-up documentation retrieval.

Inputs: task_description (required), limit.

get_cache_statsB

Get statistics about the MTA:SA documentation cache.

Inputs: no named parameters.

get_function_docsA

Fetch authoritative docs for exactly ONE MTA:SA function/event by canonical name. Preferred over manual web browsing. For multiple names, use get_multiple_function_docs in one call.

Inputs: function_name (required), use_cache, include_optional_arguments.

get_function_examplesA

Get only code examples for one function/event after docs lookup. Use when writing implementation snippets and tests.

Inputs: function_name (required).

get_multiple_function_docsA

Batch docs retrieval for implementation phase. Provide exact function/event names (ideally from search/find tools) and get combined authoritative docs in one response.

Inputs: function_names (required), include_examples, include_optional_arguments.

list_functions_by_categoryA

Enumerate canonical function/event names in a category. Useful for discovery when query terms are vague.

Inputs: category (required), limit.

recommend_doc_workflowA

Planner tool that tells LLMs exactly which mtasa-docs tools to call next for a given task. Use this to enforce MCP-first workflows and avoid manual wiki scraping.

Inputs: task_description (required), known_function_names.

search_eventsA

Event discovery tool. Search MTA:SA client/server events only (not regular functions), then chain into docs tools with exact event names.

Inputs: query (required), side, limit.

search_functionsA

Primary discovery tool. Search MTA:SA functions and events by name or keyword before coding. Returns canonical function names with side/category so LLMs can reliably chain into docs tools.

Inputs: query (required), side, limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: search tools (search_functions, search_events) differ from task matchers (find_functions_for_task, find_events_for_task), retrieval tools handle single/batch/examples, and cache/listing/planner serve unique roles. No overlap or confusion.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (e.g., clear_cache, search_functions, get_function_docs). No mixing of cases or verb styles, making the pattern predictable and easy to navigate.

    Tool Count5/5

    With 11 tools, the server is well-scoped for its documentation purpose. Each tool earns its place, covering search, retrieval, cache management, category listing, and workflow planning without excess or deficiency.

    Completeness5/5

    The tool surface provides a complete workflow: discover (search/task matchers), retrieve (docs, examples, batch), manage (cache stats/clear), explore (category listing), and plan (workflow recommender). No obvious gaps for a documentation server.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers