
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 分