#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:
- With
elucid8 mcp: compile with thecompiletool before showing a program (section 7). Thewrite_programprompt runs the whole loop: write, compile, fix, and after three failures the compiler's error. - Without MCP: compile with the
elucid8command itself, offline (elucid8 compile program.el8 -o plan.json, from 0.19.0), or with the site's compile endpoint,https://elucid8-lang.org/api/compile, which needs no sign-in (section 3 gives both). - In a folder from the Download button:
AGENTS.mdstates the rule at its top, with the compile command. - The playground's program writer compiles every program it writes before it shows it; after three attempts that do not compile, it shows the compiler's error.
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:
- slices such as
temp[t-9:t], and operators such as&&, which eLucid8 does not have; - assignments such as
total = total + x, where eLucid8 has equations; twhere eLucid8 needs the coordinate#t;nullor 0 where eLucid8 has eod (end of data), which behaves differently.
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
/llms.txtand/llms-full.txt. The site publishes the reference for AI tools in two sizes, as plain text that needs no sign-in. https://elucid8-lang.org/llms-full.txt is the whole guide, about 230 KB: the syntax, the outcome rules, the traps that differ from other languages, small programs with their exact answers, theelucid8command,deploy.json,runandserve, programs in a window, and complete worked examples, from a program to a live service in the Player and an app in a window. https://elucid8-lang.org/llms.txt is a short guide taken from it, about 60 KB: the rules, the syntax, the traps, the mistakes made most often, theelucid8command,deploy.json's fields andserve's requests in brief, enough to write programs in the common cases, and the names of the sections only the whole guide has. Give a chat assistant with a small context the short guide; give an agent that has room for it, or that works on deployments, streams or apps, the whole one. Tell the agent to read it before it writes any eLucid8, or paste it into the conversation. An agent with the command but not the web (a terminal, or a chat's sandbox afterpip install elucid8) gets the same texts from it:elucid8 guideprints the whole guide andelucid8 guide --shortthe short one (from 0.26.0; from Python,elucid8.guide()).AGENTS.mdandCLAUDE.md. Every folder the site's Download button gives (see the Deploy tutorial) holds them, beside the program's source,program.el8, its plan and its data.AGENTS.mdsays what each file is, how to compile the program again after editing it (with the site's compiler, below), how to check and run it, the exit codes, and how to verify a change. Agents that follow theAGENTS.mdconvention read it when they start in the folder; Claude Code readsCLAUDE.md, which importsAGENTS.md, so both read the same text.- The tutorial and the command reference, for anything the reference leaves out.
elucid8 mcp, for an assistant that speaks the Model Context Protocol (Claude Desktop, Claude Code, Cursor): theelucid8command gives the assistant tools to compile, check and run programs on your machine, and the reference as a resource. Section 7 says how to connect it.
#3. The loop an agent can run on its own
An agent can check its work without a person, in four steps:
Compile. The
elucid8command compiles offline, from 0.19.0:./elucid8 compile program.el8 -o plan.jsonwrites the plan (itsengineVersionnames the compiler) and prints an error asprogram.el8:LINE:COLUMN: message, with exit code 1; andrun,check,infoandservetake the program itself where they take a plan. The site also compiles programs for anyone, with no sign-in: send the program's text tohttps://elucid8-lang.org/api/compileand it answers with the same plan (itsengineVersionnames 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.jsononly when the program compiles. A compile error exits with status 1, leavesplan.jsonas it was, and prints the error as JSON after curl's own line:{"error":{"message":…,"line":LINE,"column":COLUMN}}, the message, line and columnelucid8 compilegives. 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).Check.
./elucid8 check plan.json --config deploy.jsonreads 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.Run as data.
./elucid8 run plan.json --config deploy.json --format framewrites each query's answer as one JSON object:values(withnullwhere there is no value),kinds(0 a value, 1 eod, 2 an error),ts(timestamps) anderrors. An agent can read it, or compare it with a file of expected values, without parsing text meant for people.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.csvholds the readings, withtthe minute, from 0.alertshould 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 mealertfor minutes 85 to 92 as a frame.For testing, make
temp.csvwith 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
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
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
alertgive 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:
- Syntax from other languages:
[ ],&&,||,!,%,null. eLucid8 has[…],and,or,not,eod. The compiler rejects them. - Assignments instead of equations.
total = total + xis a cycle, rejected; a running total istotal = x fby.t total + next.t x. tinstead of#t. The compiler rejects it ("unknown value t").- Ranges include both ends.
#t - 10..#tis eleven points. This compiles; only a known answer catches it. fbyreads its right operand one step back, coordinates included (fby, rule 3).1 fby.n fac * #nis not factorial;1 fby.n fac * (#n + 1)is. This compiles too.- eod is not 0,
nullorfalse. It propagates through arithmetic and comparisons, as minutes 58 and 59 show above. - Logical time is not a timestamp.
t = 5is the sixth position. Real time comes in only through the timestamps data carry (time,asof,hold,window) and service deadlines (Time and real time). - A bound names only dimensions its expression has.
restrict 1 to (t : 120) endis rejected, and so is a restriction of an input with no dimensions: an input names its dimensions,input("temp", t : 120). A value with no bound written has no end. - Where data comes from is not in the program. An input,
scorer = input("scorer", n : inf), is read or asked by navigation,score = scorer[n = reading]; whether it is a file or a program answering on demand, its deadline, what to try again and whether to reuse answers go indeploy.jsonunder the input's channel (from,deadlineMs,retry,reuse), and so does what a missing row reads (missing). The compiler rejectssource(…),service(…),absent 0and outputs such asout = CSV(a), each with the form to write.
#6. Honest limits
- Checks catch syntax and mismatched answers, not wrong intent. The fourth attempt above compiled, checked and ran. Without an expected answer it would have been accepted. An agent still needs a person who knows what the right answer is, for a few points at least, and who reads the program.
- The agent's expected answers can be wrong too. If the agent works out the expected values itself, it can make the same mistake twice. Give it answers you know, or check its working.
- Compiling offline comes with the command from 0.19.0. The
elucid8command compiles programs itself from 0.19.0; with 0.18.0, the compile endpoint needs a network connection. The site counts compile calls by kind of client (an agent that sendsX-Elucid8-Client: agent/<name>, a script, a browser) and the kind of each compile error with every name, number and text replaced, so it never keeps the program, the error's names, or who sent it (see what the site records). - Every program compiles to plan version 26, the only version the compiler writes, and a plan belongs to the release that compiled it: keep the program (
.el8) and compile it again with each release.elucid8 --versionsays which version a command reads. - Traces are in the playground only. The command gives answers and errors with their origin, not the full tree of why.
- Read a
deploy.jsonan agent writes before you run it, especially a line that starts a program: data can hold text written to instruct an agent. Is it safe to run? says what to look for.
#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:
| tool | what it does |
|---|---|
language_reference | gives 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_reference | gives 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 |
compile | compiles a program to its plan, or gives the compile error with its line and column; it says which compiler it used (below) |
check | elucid8 check on a deployment folder (plan.json or program.el8, and deploy.json) |
run | elucid8 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) |
show | opens 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) |
explain | for an answer that is an error: where it arose, through which values it was passed on, and its cause, in plain words |
query, advance, stats | ask a running elucid8 serve --http, give it new data, and read its statistics |
propose_bindings | from 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_deployment | from 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_program | from 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:
| prompt | what it does |
|---|---|
write_program | writes 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_program | from 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
- On this machine only, unless you give a token. Without
--token-file, it listens only on a loopback address (127.0.0.1), so only programs on your computer reach it. To reach it from elsewhere (through a tunnel or a proxy that gives HTTPS), give a file holding a token,--token-file token.txt; every request then needsAuthorization: Bearerand the token. - Requests from web pages are refused: a request whose
Originis another website's, or whoseHostis not the server's own (a page using DNS rebinding), gets 403, and onlyContent-Type: application/jsonis taken. - Both versions of the protocol: clients that send the protocol version with each request (the current revision), and clients that open a session with
initialize(earlier revisions). - Long runs: a tool call is answered as an event stream when the client accepts one, kept open while the tool runs; closing the connection cancels the call and stops what it started.
- Stopping: Ctrl-C (or SIGTERM) stops it once the calls running are answered. Standard input is not read.
#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):
- In Settings, open Plugins, then Select Directory, then Personal, and press Add.
- Choose Add custom MCP Server: name it
elucid8, give the addresshttps://elucid8-lang.org/mcp, and choose OAuth. Leave the client ID and secret empty: ChatGPT identifies itself to the site. - 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.
- 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.
- Data inline only, as
csv,jsonlorrows: the server reads no files, starts no programs and writes no outputs. - A program of at most 64 KB; inline data of at most 256 KB in all (1 MB of files' texts for
propose_bindingsandwrite_deployment); at most 10,000 points asked for in one call; 200 answers in a result unless asked for more, at most 1,000. - Each call at most 10 seconds, compiling included; at most four programs run at once.
- For each account, 2,000 requests and 200 runs and checks a day, until midnight UTC; at most 60 requests a minute from one address (more from a hosted assistant's shared addresses); and daily totals for everyone together: 20,000 requests and 1,000 runs and checks a day.
- Nothing is stored: the server keeps no program, data or answer. It counts requests and how each call ended, and keeps, for each assistant you allowed, its name and when it last used the server (Privacy).
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:
- to read and write the project folder: the program, its data,
deploy.jsonand the files a run writes; - to run the
elucid8command there, or to startelucid8 mcp; - one port at 127.0.0.1, for
elucid8 serveand the Player (showopens its own); - the network only to install the command (
pip install elucid8, or the download), and, if you choose, to use the hosted server or the site's compile endpoint. Programs, data and answers stay on your computer.
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.
#9. Links that open a program in the playground
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:
#text=1.and the program, percent-encoded: every character but letters, digits and-_.~written as%and its UTF-8 bytes in hexadecimal, as Python'surllib.parse.quote(text, safe="")writes it (JavaScript'sencodeURIComponentleaves!'()*as they are, which the playground reads too, but a)ends a link in Markdown). The easiest to write. The program carries its data and question in comment lines, as the examples on these pages do:-- table x = t,value; 0,3; 1,1(each;starts a new line of the table),-- data x = #t * 10(a formula),-- service echo: simulated; answers formula x1; takes 5 ms; deadline 20 ms,-- fill clicks = 0(what a point of an input's table with no row inside the data, or an empty cell, reads: a number,true,falseor a quoted text; missing data without the line), and-- ask running[t = 4]for the question (texts in double quotes,-- ask sales[zone = "north"]) (else the first-- expectline names it). The lines stay in the program as comments.#program=1.and the compressed form: the JSON{"program": …, "title": …, "sources": {"x": {"table": …}, "clicks": {"table": …, "fill": {"missing": 0}}}, "ask": {"value": "running", "at": {"t": 4}}}(every field butprogramoptional), compressed with raw DEFLATE and written in base64url without padding. Shorter for long programs; it needs a tool to make.
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
- The reference for AI tools, the file to give an agent: the short guide, or the whole guide.
- From prompt to deployed program: one request taken through these tools to a deployment and a live service in the Player.
- The tutorial: the language, with examples.
- The Deploy tutorial: the downloaded folder, and the
elucid8command. - The command reference: every command, option, format and exit code.
- Using eLucid8 from your code: reading answers in Python, JavaScript and the shell.