Roblox MCP Server
Bridges AI assistants with Roblox game environments in real-time via a Lua client and WebSocket connection. Enables AI tools like Claude to navigate instances, execute scripts, monitor remote events, and interact with the Roblox API through natural language.
README
Roblox MCP Server
A Model Context Protocol (MCP) server that bridges AI assistants with Roblox via a Lua client. This enables AI tools like Claude to interact with the Roblox game environment in real-time.
Overview
This project consists of two components:
- MCP Server (
src/index.ts) - A Node.js server that implements the MCP protocol and communicates with AI clients - Lua Client (
client.lua) - A Lua script that runs inside Roblox via a script executor and connects to the MCP server via WebSocket
Prerequisites
- Node.js v18 or higher
- npm or yarn
- A Roblox script executor with WebSocket support (e.g., Synapse X, KRNL, Fluxus, Solara)
Installation
1. Clone and Install Dependencies
cd mcp
npm install
2. Build the Server
npm run build
This compiles the TypeScript source to JavaScript in the build/ directory.
Configuration
MCP Client Configuration (Claude Desktop, etc.)
Add the following to your MCP client configuration file:
Claude Desktop (Windows)
Location: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"roblox": {
"command": "node",
"args": ["C:/path/to/mcp/build/index.js"]
}
}
}
Claude Desktop (macOS)
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"roblox": {
"command": "node",
"args": ["/path/to/mcp/build/index.js"]
}
}
}
WebSocket Port
The server listens on port 8888 by default. You can modify this in src/index.ts if needed.
Usage
Step 1: Start the MCP Server
The MCP server starts automatically when your AI client (like Claude Desktop) initializes it. Alternatively, for testing:
npm start
Step 2: Connect the Lua Client
- Open Roblox and join a game
- Open your script executor
- Copy the contents of
client.luaand execute it
The client will automatically:
- Connect to the WebSocket server at
ws://localhost:8888 - Forward game logs to the MCP server
- Handle commands from the AI assistant
- Auto-reconnect if disconnected
Tip: Add client.lua to your executor's autoexec folder for automatic connection on startup.
Available Tools
The MCP server exposes the following tools that AI assistants can use:
Instance Navigation
| Tool | Description |
|---|---|
get_children |
Get children of an instance (default: game) |
find_instances |
Search for instances by name pattern or ClassName |
get_properties |
Get properties and attributes of an instance |
get_hidden_properties |
Get hidden/internal properties using executor functions |
Script Operations
| Tool | Description |
|---|---|
read_script |
Read/decompile the source code of a script |
execute_script |
Execute Lua code in the Roblox context |
Remote Spy
| Tool | Description |
|---|---|
remote_spy_start |
Start monitoring RemoteEvent/RemoteFunction calls |
remote_spy_stop |
Stop the remote spy |
remote_spy_get_logs |
Get collected remote spy logs |
fire_remote |
Fire a RemoteEvent or invoke a RemoteFunction |
Advanced/Debug
| Tool | Description |
|---|---|
getgc_find |
Search Lua garbage collector for functions/tables |
get_connections |
Get all connections on an event/signal |
get_upvalues |
Get upvalues of a function |
Tool Examples
Get Children of Workspace
Use get_children with path "game.Workspace"
Find All Parts
Use find_instances with query "" and className "Part"
Read a Script
Use read_script with path "game.ReplicatedStorage.SomeModule"
Execute Code
Use execute_script with code "print(game.Players.LocalPlayer.Name)"
Monitor Remotes
1. Use remote_spy_start (optionally with filter "Shop")
2. Play the game normally
3. Use remote_spy_get_logs to see captured calls
4. Use remote_spy_stop when done
Fire a Remote
Use fire_remote with path "game.ReplicatedStorage.MyRemote" and args ["hello", 123]
Executor Compatibility
The Lua client checks for WebSocket support from various executors:
- ✅ Synapse X (
syn.websocket) - ✅ KRNL (
WebSocket) - ✅ Fluxus (
fluxus.websocket) - ✅ Solara (
WebSocket) - ✅ Any executor with global
WebSocket
Some advanced features require additional executor functions:
| Feature | Required Function |
|---|---|
| Script decompilation | decompile() |
| Remote spy | hookmetamethod() |
| GC search | getgc(), getinfo() |
| Get connections | getconnections() |
| Get upvalues | getupvalues() |
| Hidden properties | gethiddenproperty() |
Development
Run in Development Mode
npm run dev
Build
npm run build
Project Structure
mcp/
├── src/
│ └── index.ts # MCP server source
├── build/
│ └── index.js # Compiled server
├── client.lua # Roblox Lua client
├── package.json
├── tsconfig.json
└── README.md
Troubleshooting
"No Lua client connected"
- Make sure you've executed
client.luain your Roblox executor - Check that the WebSocket port (8888) is not blocked by firewall
- Verify your executor supports WebSocket
"Port 8888 is already in use"
Another instance of the server is running. Kill it or restart your computer.
"WebSocket not supported on this executor"
Your executor doesn't have WebSocket support. Try a different executor.
Connection drops frequently
The client auto-reconnects after 5 seconds. If issues persist, check your network or executor stability.
Security Notice
⚠️ This tool is intended for educational and development purposes only. Using script executors may violate Roblox's Terms of Service and could result in account termination.
License
ISC
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。