Sounio Compiler

io.github.agourakis82由 GitHub 帳號 agourakis82 發布v0.1.0更新於 Oct 24, 2026

Check, compile, run, and test Sounio programs locally.

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

概覽

AI 產生的概覽

本機 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 內。未宣告驗證、權杖或環境變數。
安裝前請注意
它會在本機執行編譯與程式執行,執行不受信任的 .sio 程式碼有本機執行風險。執行時的环境變數覆寫僅限非敏感鍵,含權杖、密鑰、憑證、代理或驗證資訊的鍵會被拒絕。編譯相容模式可能未產生產物卻回傳零結束碼,因此會檢查產物是否存在。不會將資料送往遠端服務。

安裝

在 SourceWeft 中

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

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

bash
pip install -e tools/mcppython -m sounio_mcp.server --transport stdio

Claude Code:

bash
claude --mcp-server sounio=python:-m:sounio_mcp.server

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:

json
{  "source_path": "tests/fixtures/broken_dose.sio"}

The response includes two diagnostic views:

  • diagnostics: agent-friendly records with string severity, one-based line/column, spans, related notes, and warnings.
  • diagnostic_envelope: the CC-1/CC-2 shared sounio.diagnostic.v1 envelope validated against tools/shared/diagnostic_schema.json.

sounio_compile

Runs sounio_check, then compiles a valid file to a local artefact.

Example:

json
{  "source_path": "examples/hello.sio",  "target": "elf",  "optimization": "default"}

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:

json
{  "source_path": "examples/hello.sio",  "args": [],  "timeout_sec": 30}

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:

json
{  "test_pattern": "tests/run-pass",  "test_filter": "hello"}

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:

text
sounio://stdlib/statssounio://stdlib/clinicalsounio://errors/E070

Error -> Fix Loop

The loop is deliberately thin:

  1. Agent writes or edits a .sio file.
  2. Agent calls sounio_check.
  3. Diagnostics are injected into the next prompt.
  4. Agent revises the file.
  5. Agent repeats until diagnostics are empty or the iteration budget is reached.

The reproducible local demonstration is:

bash
PYTHONPATH=tools/mcp python3 tools/mcp/examples/llmloop_recipe.py \  --fixtures 'tests/fixtures/broken/*.sio' \  --max-iter 10 \  --seed 1729

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 same souc check --json shape and keeps the LSP-compatible range fields.
  • Cx-1 should use sounio_check as the canonical validation method for generated dataset examples.
  • Cx-2 can use sounio_run as the HumanEval/MultiPL-E execution harness once translated .sio files 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 compile compatibility mode may exit zero even when an artefact is not emitted, so sounio_compile verifies output existence.
  • The focused Python gate covers direct tools, schema validation, one-shot JSON-RPC, and an actual mcp Python SDK client session over stdio.

來源:tools/mcp/README.md,提交 9dc32e1

工具

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

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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