Pull this reference into your tools
Three different ways to ingest the docs, in order of how much glue code you have to write.
| You want | Use this | Glue you write |
|---|---|---|
| Full doc set as one big markdown blob to paste into a context window | llms-full.md | none |
| Index of pages with one-line summaries to point a fetch-only client at | llms.txt | none |
| Live MCP tools so the agent can search and pull pages on demand | mcp-serotonin-docs | one config line |
All three are public, free, and require no authentication.
Single-file dump (llms-full.md)
The entire reference (all libraries + all examples + crash triggers + userdata) in one large markdown file, suitable for pasting straight into a model's context window.
https://deftsolutions-dev.github.io/serotonin-api-docs/llms-full.md
Use it when you want the consumer to know the whole API up-front and never need to re-fetch.
Index file (llms.txt)
Conforms to the llmstxt.org spec. Contains the project description plus a flat list of all documentation pages with links and one-line summaries.
https://deftsolutions-dev.github.io/serotonin-api-docs/llms.txt
Use it when the consumer should fetch only the pages it actually needs. Pair with a generic fetch-capable MCP server such as @modelcontextprotocol/server-fetch or any HTTP client.
MCP server (mcp-serotonin-docs)
A stdio MCP server published as an npm package. Wraps the docs as four tools an MCP-capable client can call directly. No remote infrastructure: npx pulls the package, the server runs locally on the consumer's machine, every tool call fetches the raw .md from this repo's GitHub Pages site.
Tools the server exposes
| Tool | Inputs | Output |
|---|---|---|
list_pages | locale? ("en" / "ru") | Array of {slug, title, section} for every doc page |
read_page | slug, locale? | Full markdown body of one page |
search_pages | query, locale? | Pages whose title or body matches, with a snippet |
get_function | library, name, locale? | Just the section for one function (e.g. memory.Read, ui.SetValue) |
Install via the navbar
Open any page on this site, click the Actions button next to the breadcrumbs, and pick:
- Install in VSCode: opens VSCode and pre-fills the MCP install dialog.
- Command for Codex: copies
codex mcp add serotonin-docs -- npx -y mcp-serotonin-docsto your clipboard.
Install via terminal
VSCode (with the MCP extension):
code --add-mcp '{"name":"serotonin-docs","command":"npx","args":["-y","mcp-serotonin-docs"]}'
Codex:
codex mcp add serotonin-docs -- npx -y mcp-serotonin-docs
Cursor / Cline / generic MCP client (.mcp.json, ~/.cursor/mcp.json, etc.):
{
"mcpServers": {
"serotonin-docs": {
"command": "npx",
"args": ["-y", "mcp-serotonin-docs"]
}
}
}
Typical agent flow
search_pages({ query: "PlaySound" })to locate the page.get_function({ library: "audio", name: "PlaySound" })to read just that function's section.- Or
read_page({ slug: "libraries/audio" })for the whole page.
Russian locale: pass { locale: "ru" } to any tool.
Source
The package source lives in the mcp-server/ subdirectory of this repo. Tagging mcp-v* triggers an auto-publish to npm via GitHub Actions.
Recommended prompt to attach the docs
You are writing scripts for the Serotonin Lua sandbox. The complete and
runtime-verified API reference lives at:
https://deftsolutions-dev.github.io/serotonin-api-docs/
For full context in a single fetch:
https://deftsolutions-dev.github.io/serotonin-api-docs/llms-full.md
Conventions you must respect:
- LuaJIT 2.0.3 sandbox (implements Lua 5.1 - _VERSION reports "Lua 5.1";
jit, ffi, os, io, debug, buffer, string.buffer, raknet all stripped).
- Compound function names have PascalCase + camelCase + snake_case
(e.g. ui.NewCheckbox / ui.newCheckbox / ui.new_checkbox).
Single-word names also have a lowercase form (memory.Read / memory.read).
The `file` library is lowercase-canonical (file.read, file.write, ...).
Multi-letter abbreviations like `fromRGB`, `ToHSV`, `SetFFlag` only have
PascalCase + camelCase (no working snake_case).
SCREAMING_SNAKE_CASE is NEVER bound (0 / 177 verified).
Aliases are distinct Lua callables; never compare via ==.
- draw.* must be called inside cheat.Register("paint", fn) (alias onPaint).
- Never pass non-WAV strings to audio.PlaySound, never call
cheat.LoadString in this build (raises uncatchable C++ exception),
never read _G or undocumented LocalPlayer fields. They native-crash.
- mouse.Click / Press / Release accept Windows VK codes (1=L, 2=R,
4=M, 5=X1, 6=X2) or "mouse4"/"mouse5", NOT "left"/"right".
mouse.SetPosition / GetPosition do NOT exist in this build -
use game.SilentAim(x, y) instead.
- http exposes only Get and Post in this build. Patch/Put/Delete
are NOT bound.
- memory.IsValid IS bound and verified. Always gate Read/Write with it.
- ui.SetValue for Dropdown/Listbox takes a 1-based numeric index, NOT
the option string. Multiselect takes {[1]=bool, [2]=bool, ...}.
Colorpicker takes {r,g,b,a} integer table, NOT a Color3 userdata.
- buffer and raknet tables are NOT bound in current build - both
return nil at the global. Doc pages for them have been removed.
- memory.Read accepts 17 type strings: byte, short, ushort, int, uint,
int64, uint64, float, double, bool, string, ptr, pointer, vector2,
vector3, color3, cframe. Anything else (dword, qword, long, longlong,
int8/16/32, uint8/16/32) raises "Invalid memory type for read: '<name>'".
color3 is multi-return r, g, b (0..255), not a single userdata.
- Instance:IsA compares ClassName equality, not inheritance -
ws:IsA("Instance") is FALSE. Check ClassName directly for "is part?"
style queries (Part, MeshPart, WedgePart, TrussPart, CornerWedgePart).
- cheat.Register events: paint (alias onPaint, fires per-frame even
when the menu is closed), onUpdate (~10ms cache thread), onSlowUpdate
(1 second), shutdown (on unload), newPlace (on teleport).
The official Serotonin docs at serotonin-1.gitbook.io are stale. Prefer
this reference whenever the two conflict.