Interop

AI Agents and MCP

A single fetchable file for teaching assistants to write valid Topaz code, alongside an MCP server that verifies assistant output.

Outcome: point a fetch-capable or tool-enabled assistant at this language.

Prerequisite: none for the first section. The MCP server needs the toolchain installed as described in First Program.

Start with one fetch

For an assistant that can retrieve a URL but has no tools configured, the widest common surface is a single self-contained file.

https://topaz.ooo/agents.md

It contains the structure of a file, the forms, the host/profile boundary, and the section that matters most for a model familiar with other languages: an explicit list of non-forms. It warns against Vec<T>, async, try, class syntax, and treating null as universal absence, while preserving the supported T | null data-boundary form. Naming those distinctions prevents confident guesses from becoming invalid source.

Several machine surfaces sit beside it. https://topaz.ooo/llms.txt is the compact index, while https://topaz.ooo/llms-full.txt contains the complete English manual as plain Markdown. Every English page is also available at https://topaz.ooo/docs/<slug>.md, with its title, source route, and covered specification sections preserved in frontmatter. https://topaz.ooo/version.json states which version answers.

If you are configuring an assistant for someone else, giving it that one URL completes the setup.

The problem the tools solve

The reference supplies canonical forms. topaz_check closes the authoring loop with exact compiler diagnostics, and topaz_run returns real execution output.

An assistant can write, receive exact source-position diagnostics, and correct its program in the same loop. The reference, checker, and runner connect canonical syntax to observed compiler and runtime results.

Four published tools

ToolWhat it answers
topaz_specWhat is the exact form for this part of the language?
topaz_examplesShow me verified code for this concept.
topaz_checkIs what I just wrote correct, and if not, exactly where?
topaz_runWhat does this program return inside the no-capability run boundary?

topaz_check returns the compiler's own diagnostics, codes, and source positions without rewriting them. topaz_run first performs that check and then starts a fresh worker. Both tools report the exact installed toolchain and compiler selection that answered, so an assistant can correct its output from evidence rather than a paraphrase.

topaz_check also accepts the optional input profile: "agent-pack". A profiled call evaluates the same installed compiler with the Agent Pack rules, returns schema topaz.mcp-check-result/v2 with profile: "agent-pack", and identifies each profile denial in the diagnostic's data.profileRule. Omitting profile preserves the unprofiled topaz.mcp-check-result/v1 response.

Execution boundary

Each topaz_run call starts the hidden worker in the same installed Topaz executable with a fresh no-capability host. It has no filesystem, network, discovery, callback, component, or fallback route. The server admits two active runs, queues none, applies a five-second wall limit and a one MiB response limit, and kills and reaps cancelled workers or workers exceeding those limits. Submitted source is sent through stdin and is neither logged nor retained.

This authoring execution boundary is available on every supported native Topaz target inside the installed executable. It uses the no-capability host described above; operating-system isolation is outside this boundary. Submit trusted authoring code.

Machine-readable descriptor

Clients and crawlers can read the server description directly.

https://topaz.ooo/mcp.json

It lists the four tools, their inputs, the built-in command, resource boundary, and installed self-check values in structured form.

Current status

Topaz 5.18.1 includes the MCP server and worker in the native topaz executable. Installing Topaz installs the MCP server. There is no separate archive, checksum, server path, worker path, or admission path.

Install and connect

Install Topaz, then configure this local stdio command.

JSON
{
  "command": "topaz",
  "args": ["mcp", "serve"]
}

After connecting, the client must discover exactly topaz_spec, topaz_examples, topaz_check, and topaz_run. The verification block in mcp.json provides a known reference section, example concept, clean source check, and pure run with value 42. These let a client confirm the installed server instead of trusting configuration alone.

Ready to continue when

You can use exact reference material, repair a program from compiler diagnostics, and run pure source through the installed no-capability worker.

For what a program can and cannot reach, see Interop Boundaries. For the forms an assistant will be looking up, see Syntax at a Glance.