{
  "markdown": "# tolk-mcp-server\n\nMCP server for the [Tolk](https://docs.ton.org/v3/documentation/smart-contracts/tolk/overview) smart contract compiler. Compile, validate, and explore TON smart contracts from any MCP-compatible AI assistant (Claude Desktop, Cursor, Windsurf, etc.).\n\n## Features\n\n**Tools:**\n- `get_compiler_version` — Returns the Tolk compiler version\n- `compile_tolk` — Compiles Tolk source code to Fift + BoC with full compiler options (optimization level, stack comments, experimental flags)\n- `check_tolk_syntax` — Quick syntax validation without full output\n\n**Resources:**\n- `tolk://reference` — Tolk language quick reference (syntax, types, differences from FunC)\n- `tolk://examples/hello-world` — Counter contract example\n- `tolk://examples/wallet` — Wallet contract example\n- `tolk://examples/jetton` — Jetton (token) contract skeleton\n\n**Prompts:**\n- `write_smart_contract` — Guided prompt for writing a new TON smart contract\n- `review_smart_contract` — Guided prompt for security review and optimization analysis\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"tolk\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"tolk-mcp-server\"]\n    }\n  }\n}\n```\n\n### Cursor / Windsurf\n\nAdd to your MCP settings:\n\n```json\n{\n  \"tolk\": {\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"tolk-mcp-server\"]\n  }\n}\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/oxgeneral/tolk-mcp-server.git\ncd tolk-mcp-server\nnpm install\nnpm run build\nnpm start\n```\n\n## Usage Examples\n\n### Compile a contract\n\n```\n> Use the compile_tolk tool to compile this contract:\n\nfun onInternalMessage(myBalance: int, msgValue: int, msgFull: cell, msgBody: slice) {\n}\n\nget fun hello(): int {\n    return 42;\n}\n```\n\nThe tool returns:\n- Fift assembly code\n- BoC (Bag of Cells) in base64 — ready for deployment\n- Code hash — unique identifier of the compiled code\n- Warnings (if any)\n\n### Check syntax quickly\n\n```\n> Use check_tolk_syntax to validate my contract before deploying\n```\n\nReturns OK + code hash, or a detailed error with line/column info.\n\n### Multi-file contracts\n\nPass all files in the `sources` parameter:\n\n```json\n{\n  \"entrypointFileName\": \"main.tolk\",\n  \"sources\": {\n    \"main.tolk\": \"import \\\"./utils.tolk\\\";\\nfun onInternalMessage(...) { ... }\",\n    \"utils.tolk\": \"fun helper(): int { return 1; }\"\n  }\n}\n```\n\nStandard library imports (`@stdlib/*`) are resolved automatically by the compiler.\n\n## Compiler Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `optimizationLevel` | 0-2 | 2 | 0 = none, 1 = basic, 2 = full |\n| `withStackComments` | bool | false | Add stack layout comments to Fift output |\n| `experimentalOptions` | string | \"\" | Space-separated experimental compiler flags |\n\n## Requirements\n\n- Node.js >= 18\n- No external dependencies beyond npm packages\n\n## Development\n\n```bash\nnpm install\nnpm run dev    # Run with tsx (hot reload)\nnpm run build  # Compile TypeScript\nnpm test       # Run tests\n```\n\n## License\n\nMIT\n",
  "bytes": 3028,
  "sha": "d2586d756249f7bb356e7d6f5092452b57deaaf795ad5b0437e402f391bdd570",
  "repo_slug": "oxgeneral/tolk-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_oxgeneral_tolk_mcp_server_c06505b7/readme"
}