Model Context Protocol server exposing the Sounio compiler over local stdio.
Project description
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
pip install -e tools/mcp
python -m sounio_mcp.server --transport stdio
Claude Code:
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:
{
"source_path": "tests/fixtures/broken_dose.sio"
}
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:
{
"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:
{
"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:
{
"test_pattern": "tests/run-pass",
"test_filter": "hello"
}
The test runner understands the existing //@ run-pass, //@ compile-fail,
//@ check-only, //@ expect-stdout, //@ 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:
sounio://stdlib/stats
sounio://stdlib/clinical
sounio://errors/E070
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:
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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sounio_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: sounio_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b7fb7e8993ff9e86542f5b7734a6f7c6378cf6c150d791ba2ca651df20837e1
|
|
| MD5 |
88491b3ee7e567343fb5783a4bca2c0f
|
|
| BLAKE2b-256 |
79bda426b25a780f73bf297db08b8ff5c5fa85feb07c819aa2fc6b8f4c14ce89
|
Provenance
The following attestation bundles were made for sounio_mcp_server-0.1.0.tar.gz:
Publisher:
publish-sounio-mcp.yml on Sounio-lang/sounio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sounio_mcp_server-0.1.0.tar.gz -
Subject digest:
6b7fb7e8993ff9e86542f5b7734a6f7c6378cf6c150d791ba2ca651df20837e1 - Sigstore transparency entry: 1563924220
- Sigstore integration time:
-
Permalink:
Sounio-lang/sounio@ca70ab982b165e25fb8b634b8a16f55f94f6c781 -
Branch / Tag:
refs/tags/sounio-mcp-server-v0.1.0 - Owner: https://github.com/Sounio-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sounio-mcp.yml@ca70ab982b165e25fb8b634b8a16f55f94f6c781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sounio_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sounio_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c839de1c97556e1ad2c388964cd56d8472eeff71b8f648823b206d0b85937f3
|
|
| MD5 |
e5248d10f92481e25afc894d2cf583b9
|
|
| BLAKE2b-256 |
65ab8143167b9fab624780d94447f32440c03bf2641c82b709b5a45801ab2422
|
Provenance
The following attestation bundles were made for sounio_mcp_server-0.1.0-py3-none-any.whl:
Publisher:
publish-sounio-mcp.yml on Sounio-lang/sounio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sounio_mcp_server-0.1.0-py3-none-any.whl -
Subject digest:
5c839de1c97556e1ad2c388964cd56d8472eeff71b8f648823b206d0b85937f3 - Sigstore transparency entry: 1563924255
- Sigstore integration time:
-
Permalink:
Sounio-lang/sounio@ca70ab982b165e25fb8b634b8a16f55f94f6c781 -
Branch / Tag:
refs/tags/sounio-mcp-server-v0.1.0 - Owner: https://github.com/Sounio-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sounio-mcp.yml@ca70ab982b165e25fb8b634b8a16f55f94f6c781 -
Trigger Event:
push
-
Statement type: