tlaplus-mcp
Exposes the TLA+ toolchain (TLC, SANY, PlusCal, TLATeX) as structured JSON tools via the Model Context Protocol, enabling AI assistants to parse, check, simulate, and typeset TLA+ specifications.
README
tlaplus-mcp
MCP server that exposes the TLA+ toolchain (TLC, SANY, PlusCal, TLATeX) as structured JSON tools over the Model Context Protocol.
Any MCP client tlaplus-mcp TLA+ toolchain
┌────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Claude Code│ │ tla_parse │ │ TLC (checker) │
│ Cursor │───MCP────▶│ tlc_check │───Java───▶│ SANY (parser) │
│ custom app │ (stdio) │ tlc_simulate │ │ PlusCal │
└────────────┘ │ tla_evaluate │ │ TLATeX │
│ pcal_translate │ └──────────────────┘
│ tlc_coverage │
│ tla_state_graph │
│ tlc_trace_spec │
│ tla_tex │
│ │
│ tla://specs │
│ tla://spec/{f} │
│ tla://output │
└──────────────────┘
Installation
npx -y @richashworth/tlaplus-mcp
Configure in Claude Code
Add to your MCP server config (.claude/settings.json or per-project .mcp.json):
{
"mcpServers": {
"tlaplus": {
"command": "npx",
"args": ["-y", "@richashworth/tlaplus-mcp"]
}
}
}
The server auto-downloads tla2tools.jar to ~/.tlaplus-mcp/lib/ on first use. Set TLC_JAR_PATH to override.
Prerequisites
- Node.js 18+
- Java 11+ on
PATH(runs TLC and SANY) - LaTeX (optional, for
tla_texonly)
Tools
| Tool | Description |
|---|---|
tla_parse |
Syntax-check a TLA+ module with SANY |
tlc_check |
Run TLC model checker (exhaustive) |
tlc_simulate |
Run TLC in random simulation mode |
tla_evaluate |
Evaluate a constant TLA+ expression |
pcal_translate |
Translate PlusCal to TLA+ |
tlc_generate_trace_spec |
Generate a trace exploration spec from a counterexample |
tlc_coverage |
Run TLC with action coverage reporting |
tla_tex |
Typeset a spec as PDF via TLATeX |
tla_state_graph |
Parse a TLC DOT state graph into structured JSON |
All tools return structured JSON with a raw_output field for fallback. Errors are returned as isError responses so the LLM can adapt.
Resources
| URI | Description |
|---|---|
tla://specs |
List .tla and .cfg files in the workspace |
tla://spec/{filename} |
Read a specific spec file |
tla://output/latest |
Read the most recent TLC output log |
Configuration
| Environment variable | Description | Default |
|---|---|---|
TLC_JAR_PATH |
Path to tla2tools.jar |
Auto-download to ~/.tlaplus-mcp/lib/ |
TLC_JAVA_OPTS |
JVM options | -Xmx4g -XX:+UseParallelGC |
TLC_TIMEOUT |
Max seconds per TLC run | 300 |
TLC_WORKSPACE |
Base directory for specs | Current working directory |
Development
npm run dev # Watch mode (recompile on change)
npm test # Run all tests (unit + integration)
npm run build # Production build
npm run lint # Run ESLint
npm run format:check # Check Prettier formatting
A pre-commit hook (husky + lint-staged) runs ESLint and Prettier on staged files automatically. CI also gates on both.
Testing
The project has two layers of tests:
Unit tests (src/**/*.test.ts alongside source files) — test individual parsers and tool handlers in isolation with mocked Java/filesystem calls.
Integration tests (src/integration.test.ts) — use the MCP SDK's Client + InMemoryTransport to exercise the full protocol round-trip (client → transport → server → tool handler → response) without needing Java installed. These verify tool registration, schema validation, and response shapes.
npm test # Run everything
npx vitest run src/integration.test.ts # Integration tests only
npx vitest run src/parsers/ # Parser unit tests only
npx vitest run src/tools/ # Tool handler unit tests only
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。