Tolk MCP Server

io.github.oxgeneral由 GitHub 帳號 oxgeneral 發布v1.0.0更新於 Oct 24, 2026

MCP server for the Tolk smart contract compiler. Compile, validate, and explore TON contracts.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

讓助理編譯、檢查語法並探索 TON 區塊鏈的 Tolk 智慧合約。

可以做什麼
把 Tolk 智慧合約編譯器包裝成 MCP 工具:get_compiler_version 回傳編譯器版本,compile_tolk 將 Tolk 原始碼編譯成 Fift 組譯碼、base64 編碼的 BoC 與程式碼雜湊,check_tolk_syntax 則做快速語法驗證並提供行列錯誤資訊。它也提供 Tolk 語言參考,以及 hello-world、wallet、jetton 範例等資源,還有用來撰寫與審查合約的引導提示。編譯選項包含最佳化等級、堆疊註解與實驗性旗標。
適用情境
適合用 Tolk 開發 TON 智慧合約、希望助理在對話中直接編譯或驗證程式碼的情境。可用於合約撰寫、部署前的快速語法檢查,以及審查或最佳化現有合約。
執行需求
透過 stdio 在使用者本機執行,需要 Node.js 18 或更新版本;README 建議以 npx 啟動,或從原始碼執行 npm install 與 npm run build 建置。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
編譯結果包含可部署的 BoC 程式碼與程式碼雜湊,上鏈部署前應自行審查產生的合約。README 中的審查提示僅供輔助,不能取代獨立的安全稽核。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tolk MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

tolk-mcp-server

MCP server for the Tolk smart contract compiler. Compile, validate, and explore TON smart contracts from any MCP-compatible AI assistant (Claude Desktop, Cursor, Windsurf, etc.).

Features

Tools:

  • get_compiler_version — Returns the Tolk compiler version
  • compile_tolk — Compiles Tolk source code to Fift + BoC with full compiler options (optimization level, stack comments, experimental flags)
  • check_tolk_syntax — Quick syntax validation without full output

Resources:

  • tolk://reference — Tolk language quick reference (syntax, types, differences from FunC)
  • tolk://examples/hello-world — Counter contract example
  • tolk://examples/wallet — Wallet contract example
  • tolk://examples/jetton — Jetton (token) contract skeleton

Prompts:

  • write_smart_contract — Guided prompt for writing a new TON smart contract
  • review_smart_contract — Guided prompt for security review and optimization analysis

Quick Start

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "tolk": {      "command": "npx",      "args": ["-y", "tolk-mcp-server"]    }  }}

Cursor / Windsurf

Add to your MCP settings:

json
{  "tolk": {    "command": "npx",    "args": ["-y", "tolk-mcp-server"]  }}

From Source

bash
git clone https://github.com/oxgeneral/tolk-mcp-server.gitcd tolk-mcp-servernpm installnpm run buildnpm start

Usage Examples

Compile a contract

> Use the compile_tolk tool to compile this contract:
fun onInternalMessage(myBalance: int, msgValue: int, msgFull: cell, msgBody: slice) {}
get fun hello(): int {    return 42;}

The tool returns:

  • Fift assembly code
  • BoC (Bag of Cells) in base64 — ready for deployment
  • Code hash — unique identifier of the compiled code
  • Warnings (if any)

Check syntax quickly

> Use check_tolk_syntax to validate my contract before deploying

Returns OK + code hash, or a detailed error with line/column info.

Multi-file contracts

Pass all files in the sources parameter:

json
{  "entrypointFileName": "main.tolk",  "sources": {    "main.tolk": "import \"./utils.tolk\";\nfun onInternalMessage(...) { ... }",    "utils.tolk": "fun helper(): int { return 1; }"  }}

Standard library imports (@stdlib/*) are resolved automatically by the compiler.

Compiler Options

OptionTypeDefaultDescription
optimizationLevel0-220 = none, 1 = basic, 2 = full
withStackCommentsboolfalseAdd stack layout comments to Fift output
experimentalOptionsstring""Space-separated experimental compiler flags

Requirements

  • Node.js >= 18
  • No external dependencies beyond npm packages

Development

bash
npm installnpm run dev    # Run with tsx (hot reload)npm run build  # Compile TypeScriptnpm test       # Run tests

License

MIT

來源:README.md,提交 b489bcf

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。