MCP & AI

The package ships an MCP server, so there is nothing extra to install. Register it and your editor's assistant gains thirty-seven tools: it can run the shipped calculators and get real numbers back, work in an instrumented sandbox, decode a save, pull wiki pages, and trace and validate what it produced — rather than writing game maths from memory and hoping.

Register It

You need thetowersdk installed in the project first — the server runs from inside it, which is why the path is under node_modules. Run this from the project root.

Claude Code

One command, from your project directory:

claude mcp add thetowersdk -- node ./node_modules/thetowersdk/mcp/server.mjs

Cursor, Copilot, and anything else

Add the server to the editor's MCP config file — .cursor/mcp.json in the project for Cursor, or the MCP section of your editor's settings. Restart the MCP session after saving, since most editors read this once at startup.

{
  "mcpServers": {
    "thetowersdk": {
      "command": "node",
      "args": ["./node_modules/thetowersdk/mcp/server.mjs"]
    }
  }
}

Ask the assistant to list the tools it has once it reconnects. If list_exports is among them, the server is registered.

Thirty-Seven Tools

Enough that an assistant can compute, run and check its work rather than only look things up. The groups below are what it gets.

Run The Calculators Directly

The assistant does not have to derive game maths, or write it and hope. It can call the shipped formula and get the number the SDK itself returns.

  • calc_list — every declared calculator, with what each reads and produces. The first call to make before writing any maths, so an established formula is used rather than a second one invented alongside it
  • calc_describe — one calculator in full: parameters with their units, the invariants its output must satisfy, and where its source lives
  • calc_run — run it on real arguments and get the shipped function's answer. An unknown handle, a missing parameter or a wrong type is refused rather than answered with a plausible number
  • calc_chart — which formula produces a given chart's numbers. An empty list is a real answer: that chart is a measured table nothing computes
  • calc_graph — which calculators call which, and which produce values others read. Answers "what feeds this number?" without opening the source

A Sandbox To Work In

sdk_sandbox_run is a scratchpad: an instrumented space where the assistant can load the kernel, decode a fixture save, evaluate a citation, or dry-run a repair and see what happens — without touching your project. It never applies an inventive fix; it shows you the result and leaves the decision with you.

Read The Package And A Save

  • list_exports / get_export — what exists, one table previewed rather than dumped
  • describe_schema — a table's declared shape, not one guessed from a sample row
  • decode_save / run_extractor — what is in a playerInfo.dat
  • define_term — what an acronym means, and whether it is ambiguous
  • plan_effective_path — a path, with the candidates it excluded and why
  • wiki_search / wiki_page — how a mechanic behaves, in the community's own words

Check Its Own Work

The part that makes the rest trustworthy: the assistant can trace and validate its own output rather than declare itself finished.

  • sdk_debug_trace, _snapshot, _watch, _validate — run a mechanics export with instrumentation and get a structured trace back, so a wrong number can be followed to where it went wrong
  • trust_coverage_report / trust_drift_check — what is covered, what is silently uncovered, and what has moved since it was last checked
  • sdk_lsp_diagnostics — kernel, doctor and save-graph diagnostics in one call

Work With The Mechanics Graph

  • sdk_graph_get / sdk_graph_context — the graph, or just the neighbourhood around one mechanic
  • sdk_graph_mutate / sdk_graph_validate — record what was learned, and have it checked before it lands
  • sdk_graph_render — the graph as a Mermaid diagram, not an image
  • sdk_kernel_load, sdk_registry_get, sdk_save_graph_get, sdk_planner_compile, sdk_docs_generate — the substrate underneath, for compiling a planner or regenerating the mechanics map

The Tower Oracle

A knowledge graph of game mechanics: nodes are mechanics, edges are the relationships between them, and every claim records its source. It answers how a mechanic behaves, what it interacts with, and the specific ways it has been misread before.

  • oracle_trapscall first. Every known way this mechanic has been got wrong
  • oracle_expand — what an acronym means, from a closed set (GT+, CF, DW)
  • oracle_brief / oracle_get / oracle_search — orientation, one node, or find it by phrasing
  • oracle_map — how a mechanic connects to the rest of the game
  • oracle_footguns / oracle_coverage / oracle_contradictions

Every claim carries a claimType of objective or sentiment, so measured values and community opinion stay distinguishable. oracle_coverage reports how well a compartment is covered, and oracle_contradictions surfaces claims that disagree, ranked by source authority.

The Sheet Oracle

Reads a live Google Sheet through MCP, so an assistant can work from a spreadsheet's own calculations. Point it at any sheet shared with your service account.

  • sheet_info — sheet id, version, writable flag. Call first
  • eval_formula — evaluate a formula in the sheet and return what it computes
  • read_range — values or formulas in A1 notation
  • list_lambdas — named functions and their parameter order
  • inspect_tab_ui — the live label and value control panel for a tab
  • write_cells — set inputs to a known state before reading a result

Registering a Service Account

The sheet tools reach a spreadsheet as a Google Cloud service account, the same identity the thetowersdk/sheets client uses. The walkthrough lives with the spreadsheet docs so there is one copy of it: Connecting with a service account.

One thing worth knowing before you debug anything else: an unshared sheet reads as an empty range, not a permissions error. Check the sharing first.

Knowledge Graph → · TowerAI →