TOLK Compiler MCP Server
Compiles Tolk smart contracts for TON, producing FIFT assembly and BOC bytecode.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TOLK Compiler MCP Server
An MCP (Model Context Protocol) server that wraps the TON Tolk compiler, enabling AI agents to compile Tolk smart contracts directly.
Bounty: ton-society/grants-and-bounties#1200 — $500
What It Does
Give any AI agent the ability to compile TON smart contracts written in Tolk. The agent can write code, compile it, and get the resulting FIFT assembly and BOC bytecode — all without leaving the conversation.
Related MCP server: tolk-mcp-server
Tools
Tool | Description |
| Returns the Tolk compiler version |
| Compiles Tolk source → FIFT code + BOC bytecode |
| Lists available standard library modules |
compile_tolk Parameters
Param | Type | Default | Description |
| string | required | Tolk source code |
| string |
| Entrypoint filename |
| int | 2 | 0-2, controls stack optimizer |
| bool | false | Include stack comments in FIFT |
| bool | false | Include source line comments |
Response (success)
{
"status": "success",
"fift_code": "PROGRAM{ ... }END>c\n",
"code_boc_base64": "te6ccgEBAgEAGgAB...",
"code_hash_hex": "F30B38CAC72F065A...",
"tolk_version": "1.3.0"
}Response (error)
{
"status": "error",
"error": "main.tolk:1:12: error: expected parameter list, got `{`"
}Example Usage
Agent: "Write me a simple TOLK counter contract"
User: "Sure, here's one..."
Agent calls: compile_tolk with the source code
→ Gets back FIFT code + BOC bytecode
→ Can provide deployment link or verify it compilesInstallation
Prerequisites
Python 3.11+
Node.js (for tolk-js WASM runtime)
mcpPython package
Setup
# Clone
git clone <repo-url>
cd tolk-mcp-server
# Install Node.js dependency
npm install
# Install Python dependency
pip install mcpWith Claude Desktop
Add to your MCP config:
{
"mcpServers": {
"tolk-compiler": {
"command": "python3",
"args": ["/path/to/tolk-mcp-server/server.py"]
}
}
}Standalone
python3 server.pyArchitecture
AI Agent → MCP Protocol → server.py → @ton/tolk-js CLI → Tolk WASM Compiler
↓
FIFT + BOC bytecodeThe server uses the @ton/tolk-js CLI under the hood. Source code is written to a temp directory, compiled via the CLI, and the JSON output is parsed and returned as MCP tool results.
Standard Library
Tolk includes 8 standard library modules embedded in the compiler — no additional files needed:
common— common utilitiesexotic-cells— exotic cell operationsgas-payments— gas and payment helperslisp-lists— list data structuresreflection— type reflectionstrings— string handlingtvm-dicts— TVM dictionary operationstvm-lowlevel— low-level TVM operations
Import them directly in your Tolk code — the compiler resolves them automatically.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI agent tools: translation (95+ langs), crypto research, compliance, summarization.
17 pay-per-call web, finance, legal and onchain tools for AI agents. USDC on Base via x402/MPP.
ERC-8004 agent identity, on-chain subscriptions, reputation, A2A tasks and chat over 53 tools.
Verified EVM, Aptos and finance tools for AI agents; gas for 14 chains. Pay per call (x402).
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for the Tolk smart contract compiler on the TON blockchain. Compile, syntax check, deploy link generation, language docs, stdlib, and contract prompts.482 npm2MIT
- AlicenseAqualityNot gradedmaintenanceEnables LLMs to compile and verify Tolk smart contract code for the TON blockchain.21MIT
- AlicenseAqualityDmaintenanceCompile, validate, and explore TON smart contracts using the Tolk compiler from any MCP-compatible AI assistant.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to audit, migrate, scaffold, and manage TON smart contracts using the TON Dev Skills platform.2 npm1MIT