Tolk MCP Server

io.github.oxgeneralPublished by GitHub account oxgeneralv1.0.0Updated Oct 24, 2026

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

VerifiedSTDIODesktop onlyDeveloper ToolsAI & ML

Overview

AI-generated overview

Lets an assistant compile, syntax-check, and explore Tolk smart contracts for the TON blockchain.

What you can do
Wraps the Tolk smart contract compiler as MCP tools: get_compiler_version reports the compiler version, compile_tolk turns Tolk source into Fift assembly, a base64 BoC, and a code hash, and check_tolk_syntax does fast validation with line and column errors. It also exposes resources such as a Tolk language reference and hello-world, wallet, and jetton examples, plus guided prompts for writing and reviewing contracts. Compiler options include optimization level, stack comments, and experimental flags.
When to use it
Useful when working on TON smart contracts in Tolk and you want the assistant to compile or validate code without leaving the chat. It fits contract authoring, quick syntax checks before deployment, and reviewing or optimizing existing contracts.
Requirements
Runs locally over stdio and needs Node.js 18 or newer; the README suggests launching it with npx, or building from source with npm install and npm run build. No accounts, API keys, or environment variables are declared.
Before you install
Compilation output includes deployable BoC code and a code hash, so review generated contracts before deploying them on-chain. The README's review prompt is guidance only and is not a substitute for an independent security audit.

Installation

In SourceWeft

  1. Open Tolk MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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

Source: README.md at commit b489bcf

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.