原生方法文档服务

一个为AI开发工作流提供CFX/FiveM/RedM原生方法文档访问的MCP服务器。

  • by AleksanderEvensen
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 AleksanderEvensen/fx-natives-mcp

使用说明

FX原生MCP

免责声明: 本项目与Cfx.re、Rockstar Games或Take-Two Interactive没有附属关系、认可或关联。

MCP(模型上下文协议)服务器,为AI助手提供对CFX/FiveM/RedM本机方法文档的访问。直接在AI驱动的开发工作流程中获取准确、最新的本机函数签名和文档。

安装

使用npx

添加到MCP客户端配置中:

{
  "mcpServers": {
    "fx-natives": {
      "command": "npx",
      "args": ["-y", "fx-natives-mcp"]
    }
  }
}

使用Bun(推荐)

{
  "mcpServers": {
    "fx-natives": {
      "command": "bunx",
      "args": ["fx-natives-mcp"]
    }
  }
}

全球安装

npm install -g fx-natives-mcp

然后添加到MCP配置中:

{
  "mcpServers": {
    "fx-natives": {
      "command": "fx-natives-mcp"
    }
  }
}

按编辑器配置

Claude Desktop

添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "fx-natives": {
      "command": "npx",
      "args": ["-y", "fx-natives-mcp"]
    }
  }
}
Claude Code

运行以下命令:

claude mcp add fx-natives -- npx -y fx-natives-mcp

或添加到您的 .claude/settings.json:

{
  "mcpServers": {
    "fx-natives": {
      "command": "npx",
      "args": ["-y", "fx-natives-mcp"]
    }
  }
}
Cursor

添加到光标MCP设置中:

{
  "mcpServers": {
    "fx-natives": {
      "command": "npx",
      "args": ["-y", "fx-natives-mcp"]
    }
  }
}
VS Code (Copilot)

添加到您的VS代码设置JSON:

{
  "mcp": {
    "servers": {
      "fx-natives": {
        "command": "npx",
        "args": ["-y", "fx-natives-mcp"]
      }
    }
  }
}

可用工具

search-native

使用模糊匹配搜索本地方法。

参数:

  • query (string)-搜索本机方法查询
  • page (number,可选)-分页结果的页码(默认值:1)

例子:

Search: "get player ped"
Returns: List of matching natives with their hashes

get-native-doc

按名称或哈希获取特定本机的详细文档。

参数:

  • hashOrName (string)-精确的本机名称或哈希值

例子:

Input: "GET_PLAYER_PED" or "0x275F255ED201B937"
Returns: Full documentation with TypeScript and Lua signatures

发展

# Install dependencies
bun install

# Run in development mode
bun run dev

# Run with MCP Inspector
bun run inspect

# Build for production
bun run build