Learn

Contents

Using eLucid8 with AI coding agents

This page is for people who write eLucid8 with the help of an AI coding agent: a model that edits files and runs commands for you, such as Claude Code, Codex or Cursor. It says what to give the agent, how it can check its own work, where agents go wrong, and what checks cannot catch.

Every program, command, error message and output on this page is real: a test runs them with the site's compiler and the elucid8 command, and compares every output with the page.

The rule: show only programs the compiler accepted

An assistant working with eLucid8 follows one rule, written the same way wherever it reads about the language (this page, llms.txt, the AGENTS.md in every Download, and the playground's program writer):

Never show a program you have not compiled; show exactly the text the compiler accepted; if it fails, fix it and compile again; after three failures, show the compiler's error rather than a guess.

How each way of working follows it:

A program that compiles can still answer a different question from the one intended: section 3 says how to check its answers too.

1. The problem

Models learn languages from the code they have read. They have read a great deal of Python, SQL and JavaScript, and almost no eLucid8. Asked to write it, an agent guesses from the languages it knows:

The guesses often look plausible. Some are rejected by the compiler; others compile and give a different answer from the one intended. So an agent needs two things: the language, and a way to check what it wrote.

2. Give the agent the language

3. The loop an agent can run on its own

An agent can check its work without a person, in four steps:

  1. Compile. The elucid8 command compiles offline, from 0.19.0: ./elucid8 compile program.el8 -o plan.json writes the plan (its engineVersion names the compiler) and prints an error as program.el8:LINE:COLUMN: message, with exit code 1; and run, check, info and serve take the program itself where they take a plan. The site also compiles programs for anyone, with no sign-in: send the program's text to https://elucid8-lang.org/api/compile and it answers with the same plan (its engineVersion names the site's compiler). In a Unix shell (on Windows, Git Bash or WSL):

    curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @program.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }

    It replaces plan.json only when the program compiles. A compile error exits with status 1, leaves plan.json as it was, and prints the error as JSON after curl's own line: {"error":{"message":…,"line":LINE,"column":COLUMN}}, the message, line and column elucid8 compile gives. The compiler stops at the first error, so a program with three mistakes takes three rounds. The site takes programs up to 64 KB, 30 compiles a minute from one address, and keeps counts only (section 6).

  2. Check. ./elucid8 check plan.json --config deploy.json reads the plan, the configuration and every data file, and checks every binding and query without computing anything. It catches an input with no data, a misspelt query, a file with a bad row.

  3. Run as data. ./elucid8 run plan.json --config deploy.json --format frame writes each query's answer as one JSON object: values (with null where there is no value), kinds (0 a value, 1 eod, 2 an error), ts (timestamps) and errors. An agent can read it, or compare it with a file of expected values, without parsing text meant for people.

  4. Compare with known answers. The step that matters most. The agent compares the answers with values worked out by hand, or given by you, for a few points, including the edges: the start of each dimension, where the data starts and ends, and where an answer should be eod.

Exit codes tell the agent what happened: 0 every query completed (eod and error outcomes are answers, not failures), 1 a query stopped with a program error, 2 a usage error, 3 an invalid plan, configuration, data file or query, 4 the results could not be written.

For a person looking at why a value is what it is, the playground's demand tree shows every value a query demanded and how each was obtained. Paste the program into the playground (its question is answered by itself) and press Why? beside the answer.

4. A worked session

This session is an illustration written for this page, not the transcript of a particular model. The mistakes are typical of agents writing a language they have not seen. Every program, command and output in it is real, and checked by the test.

The task, given to the agent:

Read https://elucid8-lang.org/llms.txt. Then write an eLucid8 program, alert.el8, for a temperature sensor read once a minute: temp.csv holds the readings, with t the minute, from 0. alert should be true when the average of the last ten readings (this minute and the nine before) is at least 3 degrees above what it was an hour earlier. Compile, check and run it, and show me alert for minutes 85 to 92 as a frame.

For testing, make temp.csv with 120 readings: 20 degrees until minute 59, then 21, rising by a degree every ten minutes. With that data the first alert is at minute 89: at minute 88 there is none.

The person gave the expected answer, worked out by hand: at minute 89 the last ten readings (minutes 80 to 89) are all 23, and an hour earlier they were all 20.

The agent makes the test data and the configuration first:

seq 0 119 | awk 'BEGIN { print "t,value" } { print $1 "," ($1 < 60 ? 20 : 21 + int(($1 - 60) / 10)) }' > temp.csv
{ "format": "elucid8-deploy/2",
  "inputs": { "temp": { "from": "temp.csv" } },
  "queries": ["alert[t = 85..92]"] }

First attempt. The agent writes the window as a Python slice, and the condition with &&. It also adds a guard of its own, to ignore the sensor's fault readings. The compiler stops at the first thing it cannot read, &&:

-- Alert when the 10-minute average rises 3 degrees in an hour.
temp = input("temp", t : 120)
avg10 = mean(temp[t-10:t])
rise = avg10 - avg10[t = t - 60]
-- Ignore the sensor's fault readings (-99).
alert = rise >= 3 && temp > -50
curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @alert.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }
curl: (22) The requested URL returned error: 422
{"error":{"message":"unexpected character \"&\"","line":6,"column":19}}

Second attempt. and, not &&. The compiler now reaches the slice, and says how an aggregate is written:

-- Alert when the 10-minute average rises 3 degrees in an hour.
temp = input("temp", t : 120)
avg10 = mean(temp[t-10:t])
rise = avg10 - avg10[t = t - 60]
-- Ignore the sensor's fault readings (-99).
alert = rise >= 3 and temp > -50
curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @alert.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }
curl: (22) The requested URL returned error: 422
{"error":{"message":"mean(…) is not a function: an aggregate over a region is written mean e over (d : …) end","line":3,"column":9}}

Third attempt. The reference shows aggregates over regions, so the agent writes mean temp over (t : …) end. It counts ten minutes back from #t, which is one reading too many; the compiler cannot know that. Now the program parses, and the compiler finds t used as a value: the current minute is #t.

-- Alert when the 10-minute average rises 3 degrees in an hour.
temp = input("temp", t : 120)
avg10 = mean temp over (t : #t - 10 .. #t) end
rise = avg10 - avg10[t = t - 60]
-- Ignore the sensor's fault readings (-99).
alert = rise >= 3 and temp > -50
curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @alert.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }
curl: (22) The requested URL returned error: 422
{"error":{"message":"unknown value t","line":4,"column":26}}

Fourth attempt. With #t, the program compiles, the folder checks, and it runs:

-- Alert when the 10-minute average rises 3 degrees in an hour.
temp = input("temp", t : 120)
avg10 = mean temp over (t : #t - 10 .. #t) end
rise = avg10 - avg10[t = #t - 60]
-- Ignore the sensor's fault readings (-99).
alert = rise >= 3 and temp > -50

Open in playground

curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @alert.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }
./elucid8 check plan.json --config deploy.json
./elucid8 run plan.json --config deploy.json --format frame
plan.json: plan version 26, 1 input, 0 outputs
input "temp": temp.csv (CSV), stored, version 2ec22fcf917d9fec; over t : 120 (whole numbers; 120 rows); a missing point is missing data (no end of data: inside its bounds a missing point is missing data)
  columns: t (coordinate), value (value)
ok
{"name":"alert","axes":[{"name":"t","range":[85,92]}],"type":"boolean","values":[false,false,false,false,false,true,true,true],"kinds":[0,0,0,0,0,0,0,0],"kindNames":["value","eod","error"],"ts":{"axis":"t","values":[0,0,0,0,0,0,0,0]},"errors":{}}

Everything passed, but the answer is wrong. The cells run from minute 85, so the first true is minute 90, not 89. Only the comparison with the expected answer caught it. The agent asks for the average and the rise at minute 89:

./elucid8 run plan.json --config deploy.json --query 'avg10[t = 89]' --query 'rise[t = 89]'
{"name":"avg10","context":{"t":89},"outcome":{"kind":"value","value":22.90909090909091,"ts":0}}
{"name":"rise","context":{"t":89},"outcome":{"kind":"value","value":2.90909090909091,"ts":0}}

The average should be 23, the mean of ten readings of 23. 22.909… is 252 / 11: eleven readings, one of them 22. #t - 10 .. #t includes both ends, so it holds eleven minutes.

Fifth attempt. #t - 9 .. #t, ten readings:

-- Alert when the 10-minute average rises 3 degrees in an hour.
temp = input("temp", t : 120)
avg10 = mean temp over (t : #t - 9 .. #t) end
rise = avg10 - avg10[t = #t - 60]
-- Ignore the sensor's fault readings (-99).
alert = rise >= 3 and temp > -50

Open in playground

curl -sS --fail-with-body -H 'X-Elucid8-Client: agent/claude-code' --data-binary @alert.el8 -o plan.new https://elucid8-lang.org/api/compile && mv plan.new plan.json || { cat plan.new >&2 2>/dev/null; rm -f plan.new; false; }
./elucid8 run plan.json --config deploy.json --format frame
./elucid8 run plan.json --config deploy.json --query 'avg10[t = 89]' --query 'rise[t = 89]'
{"name":"alert","axes":[{"name":"t","range":[85,92]}],"type":"boolean","values":[false,false,false,false,true,true,true,true],"kinds":[0,0,0,0,0,0,0,0],"kindNames":["value","eod","error"],"ts":{"axis":"t","values":[0,0,0,0,0,0,0,0]},"errors":{}}
{"name":"avg10","context":{"t":89},"outcome":{"kind":"value","value":23,"ts":0}}
{"name":"rise","context":{"t":89},"outcome":{"kind":"value","value":3,"ts":0}}

The first alert is at minute 89, as expected, and the average and the rise there are those worked out by hand.

One more question. The person asks:

What does alert give in the first hour and a bit, before there is an hour of history?

./elucid8 run plan.json --config deploy.json --query 'alert[t = 58..62]' --format frame
{"name":"alert","axes":[{"name":"t","range":[58,62]}],"type":"boolean","values":[null,null,false,false,false],"kinds":[1,1,0,0,0],"kindNames":["value","eod","error"],"ts":{"axis":"t","values":[0,0,0,0,0]},"errors":{}}

Minutes 58 and 59 are eod (kind 1), not false: an hour before them is minute −2 or −1, and coordinates are never below 0, so there is no average there. eod is the honest answer: there is not enough history to say. From minute 60 the answer is defined, but until minute 68 the average an hour earlier is over fewer than ten readings: a window that reaches below 0 leaves those positions out. Whether the alert should wait for a full window, or say false before an hour of history, is a question for the person, not the agent; if so, the program must say so (for example if #t < 69 then false else …).

5. The traps agents fall into

The reference for AI tools lists them, with examples. The ones seen most:

6. Honest limits

7. Connect your assistant with MCP

elucid8 mcp comes with release 0.18.0 of the elucid8 command.

To try the tools without installing anything, add the hosted server at https://elucid8-lang.org/mcp (below): it compiles and runs small programs with small data given in the conversation.

Many assistants can use tools that a program on your computer offers, through the Model Context Protocol (MCP). elucid8 mcp is such a program: the assistant starts it (or reaches it by address, over HTTP), and it offers these tools, each giving exactly what the elucid8 command gives:

toolwhat it does
language_referencegives the whole reference for AI tools, whole or one section (section); the server tells the assistant to call it before it writes or compiles any program, and a compile error ends by saying so too
command_referencegives the command reference one section at a time (section: a heading, or a word of it, such as outputs); without a section, the list of its sections and their sizes
compilecompiles a program to its plan, or gives the compile error with its line and column; it says which compiler it used (below)
checkelucid8 check on a deployment folder (plan.json or program.el8, and deploy.json)
runelucid8 run on a program, a plan or a deployment folder, with the inputs given as files on your machine (CSV, JSON lines, Parquet, Arrow) or as small tables in the conversation; it gives each answer as elucid8 run writes it, a short table (at most 200 answers unless asked for more), and a chart of each query over a box (below)
showopens the eLucid8 Player in your browser on a program's values: a picture that plays, a chart or a number (from 0.19.0; below)
explainfor an answer that is an error: where it arose, through which values it was passed on, and its cause, in plain words
query, advance, statsask a running elucid8 serve --http, give it new data, and read its statistics
propose_bindingsfrom 0.20.0. reads data files or folders, connectors, or small files given in the conversation, and proposes how a deployment reads each: its channel, dimensions, timestamps, values and what a missing point reads, as elucid8 init proposes it
write_deploymentfrom 0.20.0. writes deploy.json, a starting program.el8 that compiles, bindings.json and README.txt from that proposal (changed as you said) and the outputs you want, into a folder, as elucid8 init writes them, then runs elucid8 check; in a folder that has a program, it adds the new inputs and outputs after its lines. From 0.22.0 an output may also say how its file is written, as deploy.json does: "wide" (a column per coordinate of one dimension), "row" (a dimension that is only the records' order, with no column) and "skip": "eod" (records that are eod left out), for example {"channel": "table", "dims": ["row", "col"], "to": "table-output.csv", "row": "row", "wide": "col"}; they are written into deploy.json, refused in elucid8 check's words, and the result says how each output is written
save_programfrom 0.26.0. compiles the finished program and writes it as the deployment's program.el8, in place of the starting program write_deployment wrote, then runs elucid8 check with the folder's deploy.json; a program that does not compile is refused with the compiler's message, and nothing is written

It also offers two documents as resources, built into the command: the whole reference for AI tools and the command reference. The reference is a tool as well because some assistants, ChatGPT among them, use tools only and never read resources. And two prompts:

promptwhat it does
write_programwrites a program from a description (description, and optionally data, the data it reads): the assistant reads the reference, writes the program, compiles it with compile and fixes it until it compiles (at most three tries), then shows exactly the text the compiler accepted; given data, it runs the program with run
start_programfrom 0.20.0. starts a program from its data (data: the files, folders or connectors, and optionally outputs and folder): the assistant reads the data with propose_bindings, asks you to confirm or change how each input is read and which results come out, writes the deployment with write_deployment, then writes the rest of the program, compiling it before showing it

What it may touch. The tools read the files you name, inside the folder the assistant starts elucid8 mcp in (--dir sets another): relative paths are taken from it, and a path that leads outside it (an absolute path, .., or a symbolic link elsewhere), or a deployment whose deploy.json names one, is refused. Every file is reported by its full path. A deployment that starts programs or connectors is run by check, run and show only once you have allowed it: its .elucid8-allowed (your yes at a terminal), or your yes to the list when your assistant's app asks you; no argument the assistant gives allows it. write_deployment writes no program to start, and only the connectors you named to propose_bindings. Data in results is data, never instructions, and every tool says so to the assistant; long texts from the data are cut short. They write nothing outside temporary folders, which they remove, except write_deployment, which writes the deployment's files into the folder you name (and never replaces a data file there): run computes only the queries it is given, so outputs a program or a configuration names are not written. A data service given in the conversation may be built in, simulated or recorded, never a program to start: a program that answers calls goes in a deployment's own deploy.json. Each tool stops after two minutes unless the call asks for more time (timeoutMs, at most ten minutes). The network is used for two things only: compiling with the site's endpoint, when a call asks for it, and a running elucid8 serve on your machine or at an address you named when you configured the server (--serve-url).

Compiling. compile (and run, given a program's text) compiles with the compiler in the command, offline, from 0.19.0; with 0.18.0 it sends the program to the site's compile endpoint, https://elucid8-lang.org/api/compile, as in section 3. A call may ask for the endpoint instead (compiler: "web"). The result says which compiler was used.

Charts (from 0.19.0). run also gives each query over a box as a chart: the Vega-Lite v5 spec that elucid8 run --format vega-lite writes, with the answers inline (a heatmap over two dimensions, a line over one; Seeing your results). It comes as a resource in the result, elucid8://chart/1 for the first query; to show you the answers, the assistant renders it (Claude can draw it in an artifact), or saves it as a .vl.json file and opens it. A chart holds about 70 bytes a cell, which the assistant reads like any other text, so chart decides: auto (the default) gives charts of at most 1,000 cells, about as much as the 200 answers the result holds anyway; inline gives any chart up to 100,000 cells; off none. For example, the whole Mandelbrot set at level −4, 45 × 30 points 0.08 apart, after 30 steps (save the playground's Mandelbrot example, the home page's program, as mandelbrot.el8):

{ "name": "run", "arguments": { "programPath": "mandelbrot.el8", "query": "n_steps[level = -4, k = 30, x = 19..63, y = 35..64]", "chart": "inline", "maxRows": 0 } }

gives a 125 KB chart of 1,350 cells (a heatmap of n_steps over x and y), and no rows.

Showing the Player (from 0.19.0). show takes a program and its data as run does, starts elucid8 serve on your machine (at 127.0.0.1, with a token of its own) in the background, and opens the eLucid8 Player in your default browser: a picture over two dimensions, a chart over one, or a number. A value over a dimension it iterates along (k, time) and two others opens as a picture of the other two at the last step, with a slider and Space to play through the steps. The page only reads: its link holds a key that may ask for answers and nothing else. The assistant says what opened and gives the link, in case the browser did not open; open: false gives the link only. value (or values, up to 4 side by side) chooses what is shown, query where it starts (heat[time = 40] the tick shown, heat[time = 0..200] the range played, heat[x = 3, y = 9] the point followed), play: true plays from the first step (play: false opens it paused), at fixes a dimension (from 0.26.0: "at": { "k": 30 } shows the Mandelbrot example's n_steps over x and y at k = 30, with nothing played), and live: true follows new data. For example:

{ "name": "show", "arguments": { "programPath": "heat.el8", "inputs": { "initial": "initial.csv" }, "query": "heat[time = 0..200]" } }

opens heat over x and y, playing time 0 to 200 in 68 frames. A service show started keeps running until you ask the assistant to stop it (show with stop: the link, or "all"), until the assistant's session ends, or after an hour in which nothing asked it anything; at most three run at once, and a fourth stops the oldest. With url, show asks a service you started yourself (elucid8 serve --http) for a link instead, and leaves it running. query, advance and stats reach a service show started without a token in the configuration.

A live demo with no script. An input whose from is a built-in clock or a replay of a file is given its rows over time by the service itself (command reference), so show can start a live picture with one call, and the Player follows it (live is then on unless the call says otherwise):

{ "name": "show", "arguments": { "program": "clock = input(\"clock\", t : inf)\nx = if iseod(clock) then eod else sin(2 * pi * #t / 100)\n", "inputs": { "clock": { "from": { "builtin": "clock", "every": "100ms" } } } } }

opens a sine wave that grows by a point every 100 ms. The result says the data are flowing, and that they flow until the service stops (show with stop). A replay gives a file's rows, one coordinate of its first dimension a tick: { "from": { "builtin": "replay", "file": "readings.csv", "every": "1s", "loop": true } }, or the file's text beside from ("csv": …). run, which computes once, refuses such inputs, and so does the hosted server. For data you produce yourself, give the input a file and post its new rows to the service instead (the long-running service).

A running service. query, advance and stats take the service's address (http://127.0.0.1:8080, or the --serve-url you configured). If the service has a token, put it in the environment variable ELUCID8_SERVE_TOKEN in the assistant's configuration of the server (or name another with --token-env): it is sent to the service and never shown to the assistant.

Configuring it

Every assistant below starts the command as elucid8 mcp. Where it does not search your PATH (Claude Desktop), give the full path to the file you downloaded, for example /Users/you/bin/elucid8 (on Windows, C:\Users\you\bin\elucid8.exe). Section 8 says how to allow its tools once, so that the agent stops asking.

Claude Code, in a terminal:

claude mcp add elucid8 -- elucid8 mcp

With a service's token: claude mcp add elucid8 -e ELUCID8_SERVE_TOKEN=your-token -- elucid8 mcp.

Claude Desktop: from 0.26.0, one command adds the server to Claude Desktop's settings and keeps the ones already there (it shows the change and asks first, and backs the file up beside itself):

elucid8 mcp install claude-desktop

(python3 -m elucid8 mcp install claude-desktop with the Python package.) Its tools work in the folder elucid8 in your home folder (made if missing); --dir PATH chooses another. Then quit Claude Desktop completely and open it again. To do it by hand: Settings, Developer, Edit Config opens claude_desktop_config.json (on macOS in ~/Library/Application Support/Claude/, on Windows in %APPDATA%\Claude\). Add the server, then restart Claude Desktop:

{ "mcpServers": {
    "elucid8": { "command": "/Users/you/bin/elucid8", "args": ["mcp", "--dir", "/Users/you/projects/sensors"] } } }

The first time the assistant uses each of the tools (compile, run, explain and the others), it asks whether to allow it; choosing to always allow a tool is remembered, so the questions stop once each tool you use has been allowed. When Claude Desktop asks, choose "Always allow" for the eLucid8 tools: "Allow once" asks again at the next call. Every tool except advance, check, propose_bindings, run, show, write_deployment and save_program only reads (advance adds rows to a running service, which you start yourself; check, run and show on a deployment folder start the programs and connectors its deploy.json names, once you have allowed them, and show starts a service on your machine and opens your browser; propose_bindings reads, but asks a connector for its first rows, so it starts the connector's program, once you have allowed it; write_deployment writes a deployment's files into the folder you name, and save_program the finished program into it).

Cursor: the same mcpServers entry, in .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project):

{ "mcpServers": {
    "elucid8": { "type": "stdio", "command": "elucid8", "args": ["mcp"], "env": { "ELUCID8_SERVE_TOKEN": "your-token" } } } }

Codex, OpenAI's coding agent, starts local servers; in ~/.codex/config.toml:

[mcp_servers.elucid8]
command = "elucid8"
args = ["mcp"]

Over HTTP

From 0.19.0. Some assistants, ChatGPT's among them, add MCP servers by address rather than by starting a program. elucid8 mcp --http serves the same tools, resources and prompt, with the same answers, over MCP's Streamable HTTP transport, at http://HOST:PORT/mcp:

elucid8 mcp --http 127.0.0.1:8765

Without installing anything: the hosted server

https://elucid8-lang.org/mcp is an MCP server on the website, for small programs with small data given in the conversation. It speaks MCP's Streamable HTTP transport, in both versions of the protocol, as elucid8 mcp --http does. It asks you to sign in on elucid8-lang.org (with GitHub, Google or an email address) and to allow the assistant, once, when you connect it: the assistant then uses the server as you, within your account's daily limits.

Adding it to ChatGPT (on the web, and the same steps in the desktop app):

  1. In Settings, open Plugins, then Select Directory, then Personal, and press Add.
  2. Choose Add custom MCP Server: name it elucid8, give the address https://elucid8-lang.org/mcp, and choose OAuth. Leave the client ID and secret empty: ChatGPT identifies itself to the site.
  3. ChatGPT opens elucid8-lang.org. Sign in with GitHub, Google or an email address if you are not signed in, then read the page that asks "Allow ChatGPT to compile and run eLucid8 programs as …?" and press Allow. You return to ChatGPT.
  4. Open the plugin, press Edit, then Refresh tools, and give it a description such as "Compile and run eLucid8 programs (equations over time and space, computed on demand)." Save it.

Adding it to Claude (claude.ai, and the Claude apps): in Settings, open Connectors, press Add custom connector, name it elucid8 and give the address https://elucid8-lang.org/mcp, with nothing under Advanced settings. Press Connect, sign in on elucid8-lang.org and press Allow. Claude Code: claude mcp add --transport http elucid8 https://elucid8-lang.org/mcp, then /mcp in Claude Code to connect; the page warns that the answer goes to a program on your computer, which is Claude Code.

Other assistants that add an MCP server by its address, and sign in with OAuth as MCP describes, take the same address. My programs on elucid8-lang.org lists the assistants you allowed, under Connected assistants, with Revoke; a revoked assistant must be connected again before it can use the server.

What it offers. The tools language_reference, command_reference, compile, run, check and explain, and propose_bindings and write_deployment for data given inline as files' texts (write_deployment returns the deployment's files for you to save, and writes nothing), with the prompts write_program and start_program. run and check run the elucid8 command's engine built for WebAssembly, so the answers are those elucid8 run gives. Each tool takes the arguments of elucid8 mcp's tool of the same name that need no file on your computer, with the same names and types; check also computes the program's -- expect lines (from its -- table lines when no inputs are given) and names each that does not hold, as elucid8 check does, and write_deployment takes state for a service that keeps its data across a restart. Every result with a program gives a link that opens it, with its data and its first question, in the playground, where the values are drawn; the server gives no charts.

Its limits.

What needs the command on your computer. show (the eLucid8 Player), query, advance and stats on a running elucid8 serve, inputs given rows over time (a built-in clock or replay), your own files, larger data and longer runs need elucid8 mcp on your computer, configured as above; called on the hosted server, those tools say so.

For example, the running sum with its data in the call:

{ "name": "run", "arguments": { "program": "x = input(\"x\", t : 6)\nrunning = x fby.t (running + next.t x)\nratio = running / x\n", "inputs": { "x": { "csv": "t,value\n0,3\n1,1\n2,4\n3,0\n4,5\n5,9\n" } }, "queries": ["running[t = 4..5]", "ratio[t = 3]"] } }

gives:

Ran 2 queries with elucid8 run (elucid8/0.20.0 (wasm32)), the program compiled by the website's compiler, https://elucid8-lang.org/api/compile: done; 3 answers.
running[t = 4] = 13
running[t = 5] = 22
ratio[t = 3] = error division: division by zero
Open it in the eLucid8 playground: https://elucid8-lang.org/play#program=1.NY3NCsIwEIRfZZlTxaX-VcFA32QvUaIUdVvSjUQk7y4t9jKHmflmvhhif4_-BYdMLXU6JKsEWcBk5Oi0Eo1JtdM7tZTpdvnURtVirUlDttooTz1vXU8tLeGGsigYY5_iNYxwX-RJzF-eAQ7Gb_9MQXTLB9Ed70T33IgeeCva8FH0yGdRlMLw42NCZwAO_wswvM2TcE0p5Qc
In the playground: the link opens this program with its data and asks running[t = 4] by itself, drawing running as a picture beside the answer, and Why? beside the answer shows every value it depended on. To show the user a picture or why, give them this link, rather than drawing a picture yourself from the numbers.

An example conversation

An illustration written for this page; the tool calls and their results are real: a test makes the calls and compares the results with the page. In a folder holding the Deploy tutorial's running sum, saved as running.el8, and its data, saved as running-x.csv:

You: What is the running sum at t = 4 and 5, and why is ratio not a number at t = 3?

The assistant calls run:

{ "name": "run", "arguments": { "programPath": "running.el8", "inputs": { "x": "running-x.csv" }, "queries": ["running[t = 4..5]", "ratio[t = 3]"] } }

and reads:

Ran 2 queries with elucid8 run, the program compiled by elucid8's own compiler: done; 3 answers.
running[t = 4] = 13
running[t = 5] = 22
ratio[t = 3] = error division: division by zero
Chart of query 1 (running[t = 4..5]): elucid8://chart/1, a Vega-Lite v5 spec (2 cells): render it, or save it as a .vl.json file and open it.
Chart of query 2 (ratio[t = 3]): elucid8://chart/2, a Vega-Lite v5 spec (1 cell): render it, or save it as a .vl.json file and open it.
Open it in the eLucid8 playground: https://elucid8-lang.org/play#text=1.--%20A%20running%20sum%2C%20and%20a%20ratio%20that%20fails%20where%20x%20is%200.%0Ax%20%3D%20input%28%22x%22%2C%20t%20%3A%20inf%29%0Arunning%20%3D%20x%20fby.t%20%28running%20%2B%20next.t%20x%29%0Aratio%20%3D%20running%20%2F%20x%0A

The last line opens the program in the playground: the assistant gives you that link, and never builds one itself. Then it asks where the error came from, with the row run gave:

{ "name": "explain", "arguments": { "row": { "name": "ratio", "context": { "t": 3 }, "outcome": { "kind": "error", "error": "division", "message": "division by zero", "ts": 0 } } } }
ratio[t = 3] = error division: division by zero. It arose there.

Assistant: The running sum is 13 at t = 4 and 22 at t = 5. At t = 3 the reading x is 0, and ratio = running / x divides by it, so ratio is an error there, not a number. It arose in ratio itself, not in what ratio reads.

The result also holds each answer as elucid8 run writes it ({"name": "running", "context": {"t": 4}, "outcome": {"kind": "value", "value": 13, "ts": 0}}), so the assistant can compare answers with values it expects, as in section 3.

8. Fewer permission prompts

A coding agent asks before it does anything its settings do not already allow, so the number of questions is set by its settings, not by eLucid8. Two things keep them few: giving the agent eLucid8 through elucid8 mcp (section 7), so that compiling, running, checking and showing a program are one server's tools, allowed once, rather than a new shell command each time; and settings that allow exactly what eLucid8 needs.

What eLucid8 needs:

The settings below come from each agent's own documentation; the agents change them from time to time, so if a name here is no longer accepted, your agent's documentation has the current one.

Claude Code

Add the server to the project, which writes .mcp.json in the folder (Claude Code asks once, the first time it starts there, whether to use the project's servers):

claude mcp add --scope project elucid8 -- elucid8 mcp

Then allow its tools and the elucid8 command (on your PATH, or ./elucid8 beside the files, as in a Download), and let it edit files in the folder without asking, in .claude/settings.json:

{ "permissions": {
    "defaultMode": "acceptEdits",
    "allow": ["mcp__elucid8__*", "Bash(elucid8 *)", "Bash(./elucid8 *)"] } }

mcp__elucid8__* allows every tool of the server, check, propose_bindings, run, show, advance, write_deployment and save_program included; to keep being asked before those seven, list the others one by one instead (mcp__elucid8__compile, mcp__elucid8__explain, …). Claude Code runs commands outside a sandbox unless you turn its sandbox on; with the sandbox on, on macOS, "sandbox": { "network": { "allowLocalBinding": true } } in the same file lets a command listen on a port and reach a service on your machine, such as elucid8 serve --http.

Codex

Add the server:

codex mcp add elucid8 -- elucid8 mcp

or write it in ~/.codex/config.toml (or in the project's .codex/config.toml, which Codex reads in projects you trust), with how much it may do without asking:

[mcp_servers.elucid8]
command = "elucid8"
args = ["mcp"]
default_tools_approval_mode = "writes"
tool_timeout_sec = 120

With "writes", Codex asks only before the tools that are not marked read-only: of eLucid8's, advance, check, propose_bindings, run, show, write_deployment and save_program. tool_timeout_sec gives a long run the two minutes its tools take by default (Codex's own default is 60 seconds). Codex starts elucid8 mcp as its own process, outside the sandbox it runs the agent's commands in, so show can start a service and open your browser. For the agent's commands, Codex's Auto preset (codex --sandbox workspace-write --ask-for-approval on-request) lets it work in the folder without asking, and asks before a command that needs the network, such as pip install elucid8, which is needed once.

Cursor

Add the server in .cursor/mcp.json in the project (or ~/.cursor/mcp.json for every project):

{ "mcpServers": {
    "elucid8": { "type": "stdio", "command": "elucid8", "args": ["mcp"] } } }

and allow its tools and the elucid8 command in .cursor/permissions.json (or ~/.cursor/permissions.json):

{ "mcpAllowlist": ["elucid8:*"],
  "terminalAllowlist": ["elucid8", "./elucid8"] }

These run without asking in the Auto-review and Allowlist modes (Settings, Agents, Approvals & Execution). A list in permissions.json takes the place of the one in Cursor's settings, so add any other tools you allow there too. To be asked before check, propose_bindings, run, show, advance, write_deployment and save_program, list the other tools instead (elucid8:compile, elucid8:explain, …). Cursor's command-line agent reads the same allowances as Mcp(elucid8:*) and Shell(elucid8) in permissions.allow, in .cursor/cli.json.

A live picture with no script

With these settings a live picture takes one tool call: ask for a sine wave that grows as a clock ticks, and the assistant calls show with a built-in clock as its input, as in "A live demo with no script" in section 7. The service gives the clock its rows itself, so there is no script to write, no service to start by hand and no port to open; the only question, if your settings keep one, is whether to run show. The Player opens in your browser and follows the clock until you ask the assistant to stop it.

An assistant that has written and compiled a program can give a link that opens it in the playground, with its data and its question filled in. The playground asks the question as it opens, drawing the answer and its picture with no press; the visitor presses Why? to see what it depended on, and nothing is saved. The Learn pages' Open in playground buttons are such links.

With the eLucid8 MCP server, the compile and run tools give the link (run's with the inline tables it was given and its first question): give the user that link, and never build one by hand. A link built by hand breaks where a character is left unencoded (a ), in Markdown). Without the server, the forms below say how one is made.

A link is the playground's address, https://elucid8-lang.org/play, followed by one of two forms:

The running sum of section 4 with its data and question, as a text link:

https://elucid8-lang.org/play#text=1.x%20%3D%20input%28%22x%22%2C%20t%20%3A%206%29%0Arunning%20%3D%20x%20fby.t%20running%20%2B%20next.t%20x%0A--%20table%20x%20%3D%20t%2Cvalue%3B%200%2C3%3B%201%2C1%3B%202%2C4%3B%203%2C0%3B%204%2C5%3B%205%2C9%0A--%20ask%20running%5Bt%20%3D%204%5D%0A

From a file, with Python's standard library (the first line makes a text link; the second a compressed one holding the program alone, to which the JSON's sources and ask can be added):

python3 -c 'import sys,urllib.parse; print("https://elucid8-lang.org/play#text=1." + urllib.parse.quote(sys.stdin.read(), safe=""))' < program.el8
python3 -c 'import sys,json,zlib,base64; c=zlib.compressobj(9,zlib.DEFLATED,-15); d=c.compress(json.dumps({"program":sys.stdin.read()}).encode())+c.flush(); print("https://elucid8-lang.org/play#program=1."+base64.urlsafe_b64encode(d).decode().rstrip("="))' < program.el8

The part after # may have at most 32,768 characters, and the program with its data at most 64 KB once unpacked. A source the link gives no data for gets a sample formula, and its card says so. A link that is too long, damaged, or of a version the playground does not read opens nothing, and the playground says why. Follow the rule above: link only to a program the compiler accepted.

10. Where to read more