
Sounio Compiler
io.github.agourakis82由 GitHub 帳號 agourakis82 發布v0.1.0更新於 Oct 24, 2026
Check, compile, run, and test Sounio programs locally.
概覽
本機 MCP 伺服器,讓助理呼叫 Sounio 編譯器對 .sio 程式做型別檢查、編譯、執行與測試。
- 可以做什麼
- 對 .sio 檔案做型別檢查,回傳含行列位置與備註的正規化診斷資訊
- 將檢查通過的檔案編譯成本機產物,目標可選 elf、macho、ptx、metal 或 wasm
- 執行程式並擷取標準輸出、標準錯誤與結束碼,支援逾時
- 依 run-pass、compile-fail 等註解執行 Sounio 測試檔案或目錄
- 以資源形式讀取標準函式庫模組說明與編譯器錯誤解釋
- 適用情境
- 適合助理撰寫或修改 Sounio 原始碼時,需要真實編譯器參與檢查、修正、再檢查的循環,或在本機執行 Sounio 測試與範例的情境。
- 執行需求
- 以本機 stdio 程序執行,從 PyPI 安裝(pip install sounio-mcp-server),並以 python -m sounio_mcp.server 啟動。需要本機 Sounio 程式庫,並透過其啟動腳本解析到 souc 編譯器;原始碼路徑必須位於 /workspace/sounio 內。未宣告驗證、權杖或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sounio Compiler,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Sounio MCP Server
sounio-mcp-server exposes the checked Sounio compiler to agentic tools over
local Model Context Protocol stdio transport. It is intentionally local-only:
no HTTP transport, no OAuth, no token handling, and no remote execution path.
Install
Claude Code:
The server resolves souc through scripts/lib/resolve_souc.sh, which in this
checkout resolves to the checked self-hosted launcher (bin/souc on supported
hosts). The server rejects source paths outside /workspace/sounio.
Tool calls return both MCP text content and structuredContent. The text content
keeps the prompt's shell examples simple; structuredContent lets typed MCP
clients consume the result without reparsing JSON text.
Tools
sounio_check
Type-checks a .sio file and returns diagnostics normalised from
souc check --json.
Example:
The response includes two diagnostic views:
diagnostics: agent-friendly records with string severity, one-basedline/column, spans, related notes, and warnings.diagnostic_envelope: the CC-1/CC-2 sharedsounio.diagnostic.v1envelope validated againsttools/shared/diagnostic_schema.json.
sounio_compile
Runs sounio_check, then compiles a valid file to a local artefact.
Example:
Targets are accepted as elf, macho, ptx, metal, or wasm. The current
checked launcher is strongest for host-native ELF; other targets are passed
through to the compiler target flag and reported honestly if unsupported.
sounio_run
Runs souc run, captures stdout/stderr/exit code, and reports compile_error,
runtime_error, timeout, or ok.
Example:
Environment overrides are allowed only for non-sensitive keys. Keys containing tokens, secrets, credentials, proxies, or auth material are rejected.
sounio_test
Runs a Sounio test directory or file programmatically using the checked compiler.
Example:
The test runner understands the existing //@ run-pass, //@ compile-fail,
//@ check-only, //@ expect-stdout, //@ expect-stdout-contains,
//@ error-pattern, and //@ ignore annotations.
Resources
sounio://stdlib/{module}returns stdlib README/source context.sounio://errors/{error_code}returns compiler error explanations traced to current compiler source or committed compile-failure evidence.
Examples:
Error -> Fix Loop
The loop is deliberately thin:
- Agent writes or edits a
.siofile. - Agent calls
sounio_check. - Diagnostics are injected into the next prompt.
- Agent revises the file.
- Agent repeats until diagnostics are empty or the iteration budget is reached.
The reproducible local demonstration is:
Current fixture benchmark:
- fixtures: 20
- agent model:
deterministic-fixture-agent-v0.1 - seed:
1729 - convergence rate:
1.0 - average iterations:
1.0
This is a local recipe for the LLMloop pattern, not a claim about a hosted model. It exists so Claude Code, Cursor, ChatGPT via MCP, and CLI agents can close the same check/fix/re-check loop using the real Sounio compiler.
Cross-Agent Use
- CC-1 owns
tools/shared/diagnostic_schema.json; MCP consumes the samesouc check --jsonshape and keeps the LSP-compatiblerangefields. - Cx-1 should use
sounio_checkas the canonical validation method for generated dataset examples. - Cx-2 can use
sounio_runas the HumanEval/MultiPL-E execution harness once translated.siofiles are produced.
Quality Notes
- No compiler binary is modified.
- No remote MCP transport is implemented.
- Error catalogue entries are trace-backed; unknown codes return an explicit "not promoted yet" resource instead of invented explanations.
- The checked launcher's
compilecompatibility mode may exit zero even when an artefact is not emitted, sosounio_compileverifies output existence. - The focused Python gate covers direct tools, schema validation, one-shot
JSON-RPC, and an actual
mcpPython SDK client session over stdio.
來源:tools/mcp/README.md,提交 9dc32e1
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分