
Edict
io.github.Sowiedu由 GitHub 账号 Sowiedu 发布v1.9.2更新于 Oct 24, 2026
AI-agent programming language. JSON AST in, WASM out. Typed, effect-tracked, Z3-verified.
概览
Edict 的本地 MCP 服务器:面向 AI 代理的编程语言,助手以 JSON AST 编写程序,并进行校验、类型检查、验证与编译
- 可以做什么
- 通过 schema、示例、错误目录和解释工具及资源,了解 AST 格式、查看示例程序与编译器版本信息。对程序执行结构校验、名称解析、类型与效应检查、Z3 合约验证,并进行 lint 与按节点修补。将检查通过的 AST 编译为 WebAssembly 并在沙箱虚拟机中运行,支持执行追踪、调试与确定性重放。把片段组合为模块,依据已验证合约生成测试,并打包或导入可移植技能包。将程序部署到边缘运行时,并通过 HTTP 调用已部署的服务或技能。
- 适用场景
- 当你希望助手无需自由文本语法即可编写、验证并执行小程序,并能依据结构化编译错误自行修复时使用。适合在运行前需要类型、效应与合约保证的代理生成代码。
- 运行要求
- 需要本地运行时:通过 npx 以 stdio 运行 npm 包 edict-lang,或使用已发布的容器镜像。npm 方式需要 Node.js,容器方式无需本地 Node.js。未声明需要账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Edict,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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
来源:README.md,提交 5b021ed
工具
0版本历史
1- v1.9.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分