tlaplus-mcp has 54,437 recorded weekly downloads on npm, an increase of 75507% over the past 30 days, ranking #757 of 3,247 tracked listings.
About tlaplus-mcp
tlaplus-mcp
A TLA+ model checking MCP server that provides syntax checking (SANY), PlusCal translation, and TLC model checking via the Model Context Protocol.
Requirements
- Node.js >= 18
- pnpm 10.30.3 (for development)
- Java >= 17 (required to run
tla2tools.jar)
Setup
pnpm install
pnpm run build
Development Commands
pnpm run dev # Development mode (tsx watch)
pnpm run build # TypeScript build
pnpm test # Run tests
pnpm run pack:check # Check package contents
MCP Client Configuration
Local build:
{
"mcpServers": {
"tlaplus": {
"command": "node",
"args": ["/absolute/path/to/tlaplus-mcp/build/index.js"]
}
}
}
Via pnpm:
{
"mcpServers": {
"tlaplus": {
"command": "pnpm",
"args": ["dlx", "tlaplus-mcp"]
}
}
}
Tools
Tool arguments are limited to 10,000 total object keys and array elements per call. Calls exceeding this limit are rejected before schema validation or tool execution.
sany_parse
Parse and syntax-check a TLA+ specification using SANY.
Parameters:
| Name | Type | Description |
|---|---|---|
spec | string (required) | TLA+ specification source code |
Example input:
---- MODULE Counter ----
EXTENDS Naturals
VARIABLE count
Init == count = 0
Next == count' = count + 1
====
Example output (abbreviated; ... marks omitted text):
{
"valid": true,
"errors": [],
"rawOutput": "..."
}
pluscal_translate
Translate a PlusCal algorithm embedded in a TLA+ specification into TLA+.
Parameters:
| Name | Type | Description |
|---|---|---|
spec | string (required) | TLA+ specification containing PlusCal algorithm |
Example input:
---- MODULE SimpleAlg ----
EXTENDS Integers
(* --algorithm SimpleAlg {
variable x = 0;
{ start: x := x + 1; }
} *)
====
Example output (abbreviated; ... marks omitted text):
{
"success": true,
"translated": "---- MODULE SimpleAlg ----\n...",
"errors": [],
"rawOutput": "..."
}
tlc_check
Run the TLC model checker on a TLA+ specification to verify invariants and temporal properties.
Specifications can use modules such as Json to read and overwrite host files accessible to the Java process, including files outside the temporary working directory. Repeating the same call can cause additional changes. Accordingly, tlc_check declares readOnlyHint: false, destructiveHint: true, idempotentHint: false, and openWorldHint: true. These annotations describe behavior; they do not restrict file access.
Parameters:
| Name | Type | Description |
|---|---|---|
spec | string (required) | TLA+ specification source code |
config | object (required) | TLC model checking configuration |
config.init | string | Init predicate name (e.g. "Init") |
config.next | string | Next predicate name (e.g. "Next") |
config.specification | string | SPECIFICATION name (alternative to init/next) |
config.checkDeadlock | boolean | Whether to check for deadlock (default: true) |
config.invariants | string[] | Invariant names to check |
config.properties | string[] | Temporal property names to check |
config.constants | Record<string, string> | CONSTANT assignments (e.g. {"N": "3"}) |
config.symmetry | string | SYMMETRY set name |
config.stateConstraint | string | State constraint expression |
workers | number | Number of worker threads (default: 1) |
dumpTrace | boolean | Dump counterexample trace as JSON (default: false) |
Reproducible examples: bounded counter
The same model is checked in both examples. It starts at zero, increments to
three, and then stays at three. TypeOK holds in every reachable state;
BelowThree deliberately fails when x = 3.
Pass each JSON object below as the arguments to tlc_check. The spec field
contains the complete TLA+ source; no separate file is needed. Both examples use
one worker and keep the default deadlock check enabled.
The outputs are actual results from the bundled TLC, shown as excerpts of the
JSON inside the MCP response's content[0].text. rawOutput and trace label
fields are omitted. The MCP response has isError: false for the successful
check and isError: true for the intentional invariant violation. State counts
and diagnostic labels may change with TLC versions or execution settings.
Example input (success):
{
"spec": "---- MODULE BoundedCounter ----\nEXTENDS Naturals\nVARIABLE x\nInit == x = 0\nNext == x' = IF x < 3 THEN x + 1 ELSE x\nTypeOK == x \\in 0..3\nBelowThree == x < 3\n====",
"config": {
"init": "Init",
"next": "Next",
"invariants": [
"TypeOK"
]
},
"workers": 1,
"dumpTrace": false
}
Example output (success, excerpt):
{
"success": true,
"states": {
"found": 5,
"distinct": 4,
"depth": 4
},
"violation": null,
"trace": []
}
Example input (intentional violation):
Only the invariant changes to BelowThree. The expected counterexample is
x = 0 → 1 → 2 → 3, showing why x < 3 does not hold.
{
"spec": "---- MODULE BoundedCounter ----\nEXTENDS Naturals\nVARIABLE x\nInit == x = 0\nNext == x' = IF x < 3 THEN x + 1 ELSE x\nTypeOK == x \\in 0..3\nBelowThree == x < 3\n====",
"config": {
"init": "Init",
"next": "Next",
"invariants": [
"BelowThree"
]
},
"workers": 1,
"dumpTrace": false
}
Example output (violation, excerpt):…
Description from the npm listing.
- tlaplus
- mcp
- model-context-protocol
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (121)Similar npm MCP servers plugins
All 20 tlaplus-mcp alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/tlaplus-mcp. First seen Nov 29, 2026; last successful collection Dec 6, 2026. See the methodology.