iz-tolk-mcp — Tolk Compiler for TON

编码与调试

by izzzzzi

Tolk smart contract compiler for TON — compile, check, and deploy from AI assistants

什么是 iz-tolk-mcp — Tolk Compiler for TON?

Tolk smart contract compiler for TON — compile, check, and deploy from AI assistants

README

<div align="center">

iz-tolk-mcp

MCP server for the Tolk smart contract compiler — compile, check, and deploy TON blockchain smart contracts from any AI assistant

CI npm version npm downloads License: MIT TypeScript Node.js

🇷🇺 Русский | 🇬🇧 English

<br />

MCP server that brings the Tolk smart contract compiler directly into AI assistants like Claude — write, compile, check, and deploy TON contracts without leaving the conversation.

</div>

📖 Overview

iz-tolk-mcp is a Model Context Protocol (MCP) server that integrates the Tolk smart contract compiler into AI assistants, enabling a seamless write-compile-deploy workflow for TON blockchain development.

  • Tolk is the next-generation smart contract language for the TON blockchain, designed as a modern successor to FunC with familiar syntax (C/TypeScript-like), type safety, and cleaner semantics.
  • MCP (Model Context Protocol) is an open standard that lets AI assistants use external tools, access data sources, and follow guided workflows — turning them into capable development environments.

✨ Features

FeatureDescription
🔨 4 MCP Toolscompile_tolk, check_tolk_syntax, get_compiler_version, generate_deploy_link
📄 6 MCP ResourcesLanguage guide, stdlib reference, changelog, FunC migration guide, example contracts
💬 3 MCP PromptsGuided workflows for writing, reviewing, and debugging smart contracts
⚙️ Full Compiler OptionsOptimization levels (0-2), stack comments, path mappings, multi-file compilation
📦 Multi-file SupportCompile projects with multiple .tolk source files, @stdlib/* and @fiftlib/* imports
🔗 Deployment LinksGenerate ton:// deeplinks and Tonkeeper URLs for wallet deployment
🚀 Zero ConfigurationRuns via npx with no external dependencies beyond Node.js

🚀 Quick Start

bash
npx iz-tolk-mcp

The server communicates over stdio and is designed to be launched by an MCP client.


📦 Installation

Using npx (no install needed)

MCP clients launch the server automatically — just add it to your configuration (see below).

Global install

bash
npm install -g iz-tolk-mcp

From source

bash
git clone https://github.com/izzzzzi/izTolkMcp.git
cd izTolkMcp
npm install
npm run build

Requirement: Node.js >= 18


🔧 MCP Client Configuration

<details> <summary><b>Claude Desktop</b></summary>

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "tolk": {
      "command": "npx",
      "args": ["-y", "iz-tolk-mcp"]
    }
  }
}
</details> <details> <summary><b>Claude Code</b></summary>
bash
claude mcp add tolk -- npx -y iz-tolk-mcp
</details> <details> <summary><b>Cursor</b></summary>

Add to .cursor/mcp.json:

json
{
  "mcpServers": {
    "tolk": {
      "command": "npx",
      "args": ["-y", "iz-tolk-mcp"]
    }
  }
}
</details> <details> <summary><b>Windsurf</b></summary>

Add to ~/.windsurf/mcp.json:

json
{
  "mcpServers": {
    "tolk": {
      "command": "npx",
      "args": ["-y", "iz-tolk-mcp"]
    }
  }
}
</details> <details> <summary><b>VS Code (Copilot)</b></summary>

Add to .vscode/mcp.json:

json
{
  "servers": {
    "tolk": {
      "command": "npx",
      "args": ["-y", "iz-tolk-mcp"]
    }
  }
}
</details> <details> <summary><b>Local build (any client)</b></summary>
json
{
  "mcpServers": {
    "tolk": {
      "command": "node",
      "args": ["/absolute/path/to/izTolkMcp/dist/cli.js"]
    }
  }
}
</details>

🛠️ MCP Tools

🔍 get_compiler_version

Returns the version of the Tolk compiler bundled in @ton/tolk-js (WASM).

ParameterTypeRequiredDescription
(none)——No parameters

🔨 compile_tolk

Compiles Tolk smart contract source code. Returns Fift output, BoC (Bag of Cells) in base64, code hash, and compiler version.

ParameterTypeRequiredDescription
entrypointFileNamestring✅The main .tolk file to compile (e.g., "main.tolk")
sourcesobject✅Map of filename -> source code. Must include the entrypoint file.
optimizationLevelnumber—Optimization level 0-2 (default: 2)
withStackCommentsboolean—Include stack layout comments in Fift output
pathMappingsobject—Maps @alias prefixes to folder paths for import resolution

✅ check_tolk_syntax

Checks Tolk source code for syntax and type errors without returning full compilation output. Faster feedback loop for iterative development.

ParameterTypeRequiredDescription
entrypointFileNamestring✅The main .tolk file to check
sourcesobject✅Map of filename -> source code
pathMappingsobject—Maps @alias prefixes to folder paths for import resolution

🔗 generate_deploy_link

Generates TON deployment deeplinks for a compiled contract. Computes the deterministic contract address and returns ton:// and Tonkeeper links ready for wallet deployment.

ParameterTypeRequiredDescription
codeBoc64string✅Base64-encoded BoC of compiled contract code (from compile_tolk)
initialDataBoc64string—Base64-encoded BoC for initial data cell (default: empty cell)
workchainnumber—Target workchain ID (default: 0)
amountstring—Deploy amount in nanoTON (default: "50000000" = 0.05 TON)

📄 MCP Resources

ResourceURIDescription
📘 language-guidetolk://docs/language-guideComplete Tolk language syntax reference
📗 stdlib-referencetolk://docs/stdlib-referenceStandard library modules and functions reference
📋 changelogtolk://docs/changelogTolk compiler version history from v0.6 to latest
🔄 tolk-vs-functolk://docs/tolk-vs-funcFunC to Tolk migration guide — key differences and comparison
📝 example-countertolk://examples/counterSimple counter smart contract example in Tolk
💎 example-jettontolk://examples/jettonJetton (fungible token) minter contract example in Tolk

💬 MCP Prompts

write_smart_contract

Guided workflow for writing a new Tolk smart contract on TON. Injects the language reference and a relevant example contract into the conversation context.

ArgumentTypeRequiredDescription
descriptionstring✅Description of what the smart contract should do
contractTypestring—"counter" | "jetton" | "nft" | "wallet" | "custom" (default: "custom")

review_smart_contract

Security-focused review of a Tolk smart contract. Checks for access control, message handling, integer overflow, gas management, storage integrity, and TON-specific vulnerabilities.

ArgumentTypeRequiredDescription
codestring✅The Tolk smart contract source code to review

debug_compilation_error

Diagnose and fix a Tolk compilation error. Analyzes the error against the language reference and provides corrected code.

ArgumentTypeRequiredDescription
errorMessagestring✅The compilation error message from the Tolk compiler
codestring✅The Tolk source code that failed to compile

💡 Usage Examples

Once configured, interact with the Tolk MCP server through natural language in your AI assistant:

Compile a contract:

"Compile this Tolk smart contract:"

tolk
import "@stdlib/tvm-dicts";

fun onInternalMessage(myBalance: int, msgValue: int, msgFull: cell, msgBody: slice) {
    // handle messages
}

Write a new contract from scratch:

"Write a simple counter contract for TON that stores a number and lets anyone increment it. Include a getter to read the current value."

Review an existing contract:

"Review this contract for security issues" (paste code)

Debug a compilation error:

"I'm getting this error when compiling: unexpected token 'fun' — here's my code:" (paste code)

Generate a deploy link:

"Generate a deployment link for the contract we just compiled."


📁 Project Structure

code
src/
├── index.ts        — Server initialization and stdio transport
├── tools.ts        — 4 MCP tools (compile, check, version, deploy)
├── resources.ts    — 6 MCP resources (docs, examples)
├── prompts.ts      — 3 MCP prompts (write, review, debug)
└── content/        — Bundled documentation and example contracts
    ├── language-guide.md
    ├── stdlib-reference.md
    ├── changelog.md
    ├── tolk-vs-func.md
    ├── example-counter.tolk
    └── example-jetton.tolk

Key dependencies:

  • @modelcontextprotocol/sdk — MCP server framework
  • @ton/tolk-js — Tolk compiler (WASM, runs locally)
  • @ton/core — TON primitives for address computation and cell serialization
  • zod — Schema validation for tool parameters

🧑‍💻 Development

bash
npm install          # Install dependencies
npm run build        # Compile TypeScript + copy content files
npm run dev          # Run with tsx (hot reload for development)
npm test             # Run test suite (vitest)
npm run lint         # Check for lint errors
npm run lint:fix     # Fix lint errors automatically
npm run format       # Format code with Biome

Pre-commit hooks enforce code quality automatically:

  • Biome — fast linter and formatter for TypeScript
  • Husky — Git hooks manager
  • lint-staged — runs checks only on staged files

常见问题

iz-tolk-mcp — Tolk Compiler for TON 是什么?

Tolk smart contract compiler for TON — compile, check, and deploy from AI assistants

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

✎ 在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描176.4k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

✎ 借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描176.4k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

✎ 想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描176.4k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

✎ 这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
89.7k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

✎ 它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
60.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

✎ 这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.9k

评论