Skip to content

Bounty #1200: MCP Server for Tolk Compiler#1214

Open
izzzzzi wants to merge 1 commit intoton-society:mainfrom
izzzzzi:bounty-1200-iz-tolk-mcp
Open

Bounty #1200: MCP Server for Tolk Compiler#1214
izzzzzi wants to merge 1 commit intoton-society:mainfrom
izzzzzi:bounty-1200-iz-tolk-mcp

Conversation

@izzzzzi
Copy link
Copy Markdown

@izzzzzi izzzzzi commented Feb 27, 2026

Submission for Bounty #1200

Repository: https://github.com/izzzzzi/izTolkMcp
npm: https://www.npmjs.com/package/iz-tolk-mcp

Implementation

Full MCP server for the Tolk compiler wrapping @ton/tolk-js, published to npm as iz-tolk-mcp.

4 Tools:

  • get_compiler_version — returns Tolk compiler version
  • compile_tolk — compiles Tolk source code to Fift + BoC with all compiler options (optimization level, stack comments). Supports multi-file contracts with sources map and automatic @stdlib/* resolution
  • check_tolk_syntax — quick syntax/type validation without full output, for faster iteration
  • generate_deploy_link — computes deterministic contract address and generates ton:// deeplinks and Tonkeeper URLs for wallet deployment

6 Resources:

  • tolk://docs/language-guide — complete Tolk language syntax reference
  • tolk://docs/stdlib-reference — standard library modules and functions
  • tolk://docs/changelog — compiler version history from v0.6 to latest
  • tolk://docs/tolk-vs-func — FunC to Tolk migration guide
  • tolk://examples/counter — counter contract example
  • tolk://examples/jetton — Jetton (fungible token) minter example

3 Prompts:

  • write_smart_contract — guided workflow that injects language reference + relevant example, then iteratively compiles until error-free
  • review_smart_contract — security-focused review covering access control, gas management, integer overflow, TON-specific attack vectors
  • debug_compilation_error — diagnoses compilation errors against the language reference and provides fixes

Quality

  • 33 tests passing (vitest) — direct tolk-js tests, MCP integration tests via InMemoryTransport, edge cases
  • Full input validation (file count limits, total size limits, entrypoint checking)
  • Path normalization for fsReadCallback
  • TypeScript with ESM
  • CI/CD with GitHub Actions, semantic-release, Dependabot
  • Code quality enforced by Biome linter + Husky pre-commit hooks
  • Bilingual README (English + Russian)

Quick Start

npx iz-tolk-mcp

Configuration for any MCP client:

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

Beyond the Base Requirements

The bounty asks for getTolkCompilerVersion() and runTolkCompiler(). This implementation adds:

  • check_tolk_syntax tool for faster development iteration
  • generate_deploy_link tool that computes contract addresses and generates wallet-ready deployment deeplinks
  • 6 documentation resources (language guide, stdlib, changelog, migration guide, 2 example contracts)
  • 3 guided prompts for writing, reviewing, and debugging smart contracts
  • Multi-file contract support with @stdlib/* auto-resolution
  • Input validation (file count, total size, entrypoint existence)
  • 33 tests covering all tools, resources, prompts, and edge cases
  • Published to npm with automated CI/CD pipeline

Wallet address for reward

UQBGH3T-zRXKgfKEZDysIiQSKfg1lIS0nwyZp5V5El2w1UDp

@zhdtty
Copy link
Copy Markdown

zhdtty commented Feb 28, 2026

👋 I'm @zhdtty and I'm interested in working on this.

Ready to contribute. Let me know the next steps!

@zhuzhushiwojia
Copy link
Copy Markdown

我来认领!熟悉 Tolk 编译器和 MCP 协议。SOL 钱包:9xsvaaYbVrRuMu6JbXq5wVY9tDAz5S6BFzmjBkUaM865

@zhuzhushiwojia
Copy link
Copy Markdown

🦞 Claiming this bounty!

Developer: @zhuzhushiwojia
Wallet: TMLkvEDrjvHEUbWYU1jfqyUKmbLNZkx6T1 (USDT TRC20)

ETA: PR within 72 hours

Experienced with MCP servers and TON ecosystem. Ready to deliver! 🚀

@zhuzhushiwojia
Copy link
Copy Markdown

🎯 Bounty Claim

I am claiming this bounty.

Wallet Address

  • SOL: 9xsvaaYbVrRuMu6JbXq5wVY9tDAz5S6BFzmjBkUaM865

Plan

Will implement MCP Server for Tolk Compiler:

  • Model Context Protocol integration
  • Tolk language server features
  • Code completion and analysis
  • Documentation integration

Starting work immediately. ETA: 4-6 days.

cc: @ton-society

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants