mcp-serotonin
Provides tools for interacting with the Roblox game environment via the Serotonin Lua runtime, enabling game object inspection, entity tracking, memory reading, and script execution.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-serotoninlist all players in the game"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-serotonin
What is this
Tired of writing ESP blind, guessing whether entity.GetParts works in this mode, or watching the Cheat crash because game.PlaceID is apparently cursed?
This is an MCP server that bridges any MCP-capable LLM agent (Claude Code, Cursor, Cline, Continue…) to the Serotonin Lua runtime. The agent sees the live game - walks the Workspace tree, reads bones and positions, projects world coords to screen, reads memory - then writes Lua tailored to your mode instead of generic templates.
As of v0.3.0 the transport is file-based IPC, so it keeps working with the Serotonin menu closed - no more "open the menu or nothing fires", no more stalls under load.
Why this instead of Studio / debuggers
Roblox Studio - can't attach to a live public server, only your own place files
Ghidra / x64dbg - see bytes, not game objects; reverse the whole tree before asking
"who's alive?"
CheatEngine - scans values, can't walk the instance graph or draw overlays
Script executors - give you Lua, but you write blind and retry on crashmcp-serotonin gives an LLM agent live access to all of that at once - tree, entity snapshot, bones, screen projection, memory, arbitrary Lua. The agent verifies what's in the mode before coding, tests hypotheses with eval, and ships scripts that work on the first load.
How it works
MCP client <-- stdio --> server.py <-- files --> bridge.lua <--> Serotonin <--> Roblox
agent/cmd.json
agent/result.jsonserver.py writes the next command to C:\Serotonin\files\agent\cmd.json (atomically - temp + replace), bridge.lua reads it on its onUpdate frame, runs it on the game thread, serializes the result (Instances become handles you can pass back; Vector3/Color3 keep their types) and writes agent/result.json. One command at a time, serialized end-to-end - parallel evals stacking inside Serotonin crash the Cheat reliably. No sockets and no async HTTP callbacks: Serotonin only pumps HTTP callbacks while the menu renders, so the old transport stalled with the menu closed; synchronous file IO on onUpdate does not.
Crash protection
Some Lua expressions in Serotonin trigger native C++ exceptions that pcall can't catch - they kill the Cheat DLL. Reading _G, game.DataModel, game.PlaceID, game.LocalPlayer.Backpack, calling Color3:ToHSV() - all confirmed crashers. This release ships with:
A safe-mode pre-flight in
server.pythat checks every op againstcrash_blacklist.jsonbefore it leaves the Python process. In safe mode (default: on) blocked ops never reach the Cheat.A class-based property allowlist in
bridge.lua- only documented properties are read viasafe_inspect/dive. Undocumented fields are a known crash vector (Serotonin's proxy tries to resolve them via raw memory and faults on unknown offsets).A per-op read/time budget plus a
HEAVY_SKIPsubtree list, so a tree walk never materialises the wholeGetDescendantsgraph in one native call (the old AV / frame-stall path on big trees).A
/crash_reportendpoint that auto-extracts blacklist rules when you feed it the last-known-bad op. Learn once, never repeat.
Requirements
Windows 10/11 + Serotonin
Python 3.10+
mcp,aiohttp(seerequirements.txt)
Install
git clone https://github.com/DeftSolutions-dev/mcp-serotonin.git
cd mcp-serotonin
pip install -r requirements.txtDrop bridge.lua into your Serotonin scripts folder - usually:
C:\Serotonin\scripts\bridge.lua(The Scripting tab has an "Open Scripts Folder" button.)
Hook it up to your MCP client
The server speaks stdio, so the config shape is the same for every client. Point it at python C:/path/to/mcp-serotonin/server.py.
Most clients read a JSON file that looks like:
{
"mcpServers": {
"serotonin-bridge": {
"command": "python",
"args": ["C:/path/to/mcp-serotonin/server.py"],
"env": { "PYTHONUNBUFFERED": "1" }
}
}
}Put it wherever your client expects it (project-local .mcp.json, user-level config, IDE settings). .mcp.json.example in this repo is the same file, ready to copy.
Run it
Launch Roblox + Serotonin.
In the Scripting tab, Load
bridge.lua. You should see:[serotonin-bridge v3] file-IPC loaded - agent/cmd.json <-> agent/result.json (menu-independent)Start your MCP client - it'll spawn
server.pyover stdio on demand.Call
serotonin_ping. If you get"pong", you're done. The Serotonin menu can stay closed - the bridge runs offonUpdate, not the menu render loop.
If it times out, the bridge isn't loaded. Reload the Lua script and check the Cheat console for errors.
Tools (31 wrappers)
Instance / world exploration
Tool | What it does |
| Liveness check. |
| Run arbitrary Lua. Instances / Vector3 / Color3 get serialized automatically. Blocked patterns don't reach the Cheat in safe mode. |
| Properties, Attributes, Children for one Instance. Takes a dot-path or a handle. |
| Walk descendants with Name substring + optional ClassName filter (bounded, skips crash-prone subtrees). |
| Recursive Name/ClassName dump up to N levels. |
| All descendants of a specific ClassName. |
| Find a player Model in |
| Nearest instance of a class within a radius. Origin defaults to LocalPlayer. |
| ClassName histogram for a subtree. |
| All |
Entity / parts / players
Tool | What it does |
|
|
| Entity fields + live HumanoidRootPart + screen projection. Prefer this. |
|
|
|
|
| Full per-part dump for one index: pos/size/rot + extras + |
| Position/Size/Rotation for named bones of a player index. |
Screen / projection
Tool | What it does |
|
|
| Window size, camera, mouse, delta time, menu state. |
Memory
Tool | What it does |
|
|
|
|
|
|
|
|
|
|
File sandbox (C:\Serotonin\files)
Tool | What it does |
|
|
|
|
|
|
| One-shot metadata op: |
Audio (safe subset)
Tool | What it does |
|
|
|
|
audio.PlaySound is intentionally not wrapped because non-WAV input crashes the Cheat with a native SEH exception. Drive PlaySound through serotonin_eval only when you control the bytes (e.g. file.read of a known-good .wav).
UI (drive the Cheat menu)
Tool | What it does |
|
|
|
|
HTTP endpoints (for shell / debugging)
The file channel is the transport. On top of the MCP tools, server.py still runs a small HTTP server so you can drive the bridge directly with curl (it shares the same file IPC underneath):
Method | Path | Purpose |
POST |
| Run one op ( |
GET / POST |
| Get or toggle ( |
GET |
| Full blacklist dump. |
POST |
| Patch ( |
POST |
| Re-read |
POST |
| Report a crash ( |
GET |
| Server status. |
Set SEROTONIN_HTTP_ONLY=1 to start only the HTTP server (skip stdio MCP) for shell debugging.
Things that bite (and how this release handles them)
The menu used to gate the transport. Serotonin only pumps http.Get / http.Post completion callbacks while the menu renders, so the old HTTP bridge silently stalled with the menu closed (commands queued, nothing came back). v0.3.0 moves the transport to plain files read/written synchronously on onUpdate, so it no longer depends on the menu at all.
Memory types. The verified accepted types are: byte, short, ushort, int, uint, int64, uint64, float, double, bool, string, ptr, pointer. Tested working against memory.GetBase(). The old int8/16/32 shortcuts are not accepted.
_G is a native crasher. Not just nil - even type(_G) inside pcall takes down the DLL. Blacklisted as regex \b_G\b. Use getfenv(1) if you need the env table.
game.GetService uses dot syntax, not colon. game.GetService("Players") works; game:GetService(...) errors. The Lua game is a sandbox proxy table, not an Instance userdata - it also has no GetChildren, so tree walks scan via GetService(...).
Entity API returns userdata, not indices. Docs say entity.GetPlayers() returns integers; it returns userdata objects. Access fields as p.Name, p.Health; call bone methods as p:GetBonePosition("HumanoidRootPart").
entity.Position is often stale. In FFA / Tank-style modes the cached position stays at (0,0,0). Use p:GetBonePosition("HumanoidRootPart") for the live value. serotonin_players_full does this for you.
Documented-but-broken. Vector3:FuzzyEq doesn't exist (Lua error). Color3:ToHSV() crashes (native). game.GetFFlag / game.SetFFlag crash. game.LocalPlayer.Backpack and ~27 other undocumented LocalPlayer.* fields crash. All blacklisted.
audio.PlaySound crashes on any non-WAV string, cheat.LoadString raises "C++ exception" on every call - both blacklisted. Use loadstring / load instead of cheat.LoadString.
Don't parallelize eval. Two simultaneous evals crash Serotonin. The server holds a semaphore and the bridge keeps a single command slot, so calls are serial end-to-end; stay on the tools and you're safe.
Configuration
Env vars:
SEROTONIN_HTTP_HOST(default127.0.0.1)SEROTONIN_HTTP_PORT(default8765)SEROTONIN_HTTP_ONLY=1- start only the HTTP server, skip stdio MCP. Useful forcurldebugging.
IPC files (created automatically under the Serotonin sandbox):
C:\Serotonin\files\agent\cmd.json- server -> bridge (one command, written atomically)C:\Serotonin\files\agent\result.json- bridge -> server (one result)
Tunables in bridge.lua (top of file, CFG table):
op_budget_max- max native property reads per op before a walk aborts with partial data (default 15000)op_time_max_ms- soft per-op deadline (default 8000)max_depth- default serialization depth (default 3)debug- print per-command lines to the Cheat console
Credits
Crash diagnosis and the file-based IPC approach: mixercodes. His mcp-serotonin-v2 found the holes and pinned the real root cause - the menu-closed / async HTTP-callback stall - and the file-based transport this v0.3.0 release ships is his approach. The crash fixes here are effectively his findings and implementation ported back into this bridge. Thanks for the help. 🙏
License
MIT.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DeftSolutions-dev/mcp-serotonin'
If you have feedback or need assistance with the MCP directory API, please join our Discord server