
Edict
io.github.SowieduPublished by GitHub account Sowieduv1.9.2Updated Oct 24, 2026
AI-agent programming language. JSON AST in, WASM out. Typed, effect-tracked, Z3-verified.
Overview
A local MCP server for Edict, an agent-oriented programming language: assistants write programs as JSON ASTs, then validate, type-check, verify and compile them
- What you can do
- Learn the AST format and browse examples, error catalogs and version info via schema, examples, errors and explain tools and resources. Validate, check, lint and patch programs through the full pipeline of schema validation, name resolution, type and effect checking, and Z3 contract verification. Compile checked ASTs to WebAssembly and run them in a sandboxed VM, with tracing, debugging and deterministic replay. Compose fragments into modules, generate tests from verified contracts, and package or import portable skill bundles. Deploy programs to edge runtimes and invoke deployed services or skills over HTTP.
- When to use it
- Use it when you want an assistant to write, verify and execute small programs without free-form text syntax, and to self-repair from structured compiler errors. It suits agent-generated code that needs type, effect and contract guarantees before running.
- Requirements
- A local runtime: run the npm package edict-lang with npx over stdio, or use the published container image. Node.js is needed for the npm route; the container route needs no local Node.js. No accounts, API keys or environment variables are declared.
Installation
In SourceWeft
- Open Edict in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Edict
[CI] [License: MIT] [Node.js] [MCP]
A programming language designed for AI agents. No parser. No syntax. Agents produce AST directly as JSON.
Edict is a statically-typed, effect-tracked programming language where the canonical program format is a JSON AST. It's purpose-built so AI agents can write, verify, and execute programs through a structured pipeline — no text parsing, no human-readable syntax, no ambiguity.
Features
- JSON AST — Programs are JSON objects, not text files. No lexer, no parser.
- Structured errors — Every error is a typed JSON object with enough context for an agent to self-repair.
- Type system —
Int,Float,String,Bool,Array<T>,Option<T>,Result<T,E>, records, enums, refinement types. - Effect tracking — Functions declare
pure,reads,writes,io,fails. The compiler verifies consistency. - Contract verification — Pre/post conditions verified at compile time by Z3 (via SMT). Failing contracts return concrete counterexamples.
- WASM compilation — Verified programs compile to WebAssembly via a pure-JS encoder and run in Node.js.
- MCP interface — All tools exposed via Model Context Protocol for direct agent integration.
- Schema migration — ASTs from older schema versions are auto-migrated. No breakage when the language evolves.
Execution Model
Edict compiles to WebAssembly and runs in a sandboxed VM. This is a deliberate security decision — not a limitation:
- No ambient authority — compiled WASM cannot access the filesystem, network, or OS unless the host explicitly provides those capabilities via the pluggable
EdictHostAdapterinterface - Compile-time capability declaration — the effect system (
io,reads,writes,fails) lets the host inspect what a program requires before running it - Runtime enforcement —
RunLimitscontrols execution timeout, memory ceiling, and filesystem sandboxing - Defense-in-depth — agent-generated code that runs immediately needs stronger isolation than human-reviewed code. The effect system + WASM sandbox + host adapter pattern provides exactly that
Host capabilities available through adapters: filesystem (sandboxed), HTTP, crypto (SHA-256, MD5, HMAC), environment variables, CLI arguments. New capabilities are added by extending EdictHostAdapter.
Quick Start
For AI Agents (MCP)
The fastest way to use Edict is through the MCP server — it exposes the entire compiler pipeline as tool calls:
Or install locally:
Two calls to get started: edict_schema (learn the AST format) → edict_check (submit a program). See MCP Tools for the full tool list.
For Development
Docker
Run the Edict MCP server in a container — no local Node.js required:
Supported platforms: linux/amd64, linux/arm64.
Browser
Run the Edict compiler entirely in the browser — no server required:
Note: ESM modules require HTTP serving. Use
npx serve .or any static server —file://won't work.
See examples/browser/index.html for a working example.
QuickJS (Sandboxed Environments)
The Edict compiler also runs inside QuickJS WASM — useful for sandboxed runtimes, edge workers, or embedding in other WASM applications:
Note:
quickjs-emscriptenis an optional peer dependency — install it alongsideedict-langto useEdictQuickJS. For fs-free environments, passbundleSourcedirectly instead of loading from disk.
See docs/quickjs-feasibility-report.md for full benchmarks and recommendations.
MCP Tools
MCP Resources
Example Program
A "Hello, World!" in Edict's JSON AST:
The Agent Loop
The core design: an agent submits an AST → the compiler validates it → if wrong, returns a StructuredError with enough context for the agent to self-repair → the agent fixes it → resubmits.
Architecture
Type System
Effect System
Functions declare their effects. The compiler enforces:
- A
purefunction cannot call aniofunction - Effects propagate through the call graph
- Missing effects are detected and reported
Effects: pure, reads, writes, io, fails
Contract Verification
Pre/post conditions are verified at compile time using Z3:
Z3 either proves unsat (contract holds ✅) or returns sat with a concrete counterexample the agent can reason about.
Contributing
We welcome contributions from agents and humans alike. See CONTRIBUTING.md for setup instructions, coding standards, and the PR workflow.
Looking for a place to start? Check issues labeled good first issue.
Roadmap
See ROADMAP.md for the full development plan, FEATURE_SPEC.md for the language specification, and Crystallized Intelligence for how agents store and reuse verified WASM skills.
Support
Edict is free and open source under the MIT license. If your agents find it valuable, consider sponsoring its development.
License
Source: README.md at commit 5b021ed
Tools
0Version history
1- v1.9.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts