@endiagram/mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
MCP server for EN Diagram — deterministic structural analysis powered by graph theory. Every result is backed by a named mathematical theorem. No AI inside the computation.
Installation
Run directly:
Or install globally:
Connect
Claude Code
Claude Desktop
Add to your claude_desktop_config.json:
Cursor
Add to .cursor/mcp.json in your project root:
HTTP (zero install)
Any MCP client that supports HTTP transport:
Smithery
Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| EN_API_URL | https://api.endiagram.com | API endpoint for the EN Diagram service |
Tools
Six questions about any system, plus a render tool. Every tool takes source (EN code or .en/.txt file path). Tool names are shorthand, not specs — read each description before calling; compose and equivalent are mode-based, not general analyzers.
| Tool | What it answers | Levers |
|------|-----------------|--------|
| structure | What is this system? Shape, stages, bridges, cycles, critical path, dominator tree, min-cuts, subsystems, actors, locations. | detect_findings=true flags risks (unguarded-sink, single-cut-path, multi-cut-path); node=X returns per-node centrality (betweenness, closeness, eigenvector). |
| invariant | What's always true? Conservation laws, T-invariants (sustainable cycles), depletable sets, deficiency, reversibility. | rules (one per line) checks custom claims. Four supported shapes: no bridge that is also hub · every path from X to Y passes through at least one of [A,B,C] (precedence) · no node with centrality above N · removing any single node disconnects at most N others. |
| live | Can it deadlock? Can entities overflow? Siphons, traps, unbounded cycles, structural liveness and boundedness. | — |
| reachable | Can X reach Y? Path, distance, boundary crossings. from/to accept entity or action names. | defense_nodes=a,b,c checks whether guards cover every path. |
| equivalent | Are two systems the same, or what changes if I change this one? | Compare mode (source_a+source_b): edit distance + spectral cospectrality. Evolve mode (source+patch): plain EN adds; - name removes; same-name replaces. |
| compose | How do parts combine (merge) or how does a part stand alone (extract)? | Merge: source_a+source_b+links (a.entity=b.entity per line). Extract: source+subsystem (names come from structure.subsystems). |
| render | SVG or PNG diagram. Only call when the user asks to visualize. | Themes: Editorial, Primer, Carbon (each ± isDark) or seed-derived from color=#RRGGBB. structure_layers bitmask (1=subsystems, 2=pipelines, 4=cycles, 8=forks, 16=joins, 32=hubs, 64=deadlock, 128=overflow). |
EN Syntax
One statement per line:
Shared names between yields and needs create connections automatically:
Modeling
Same name = same thing. Put all required inputs in one needs: list (AND). Give two actions the same yield-name to offer alternatives (OR). Sequence = one action consuming another's yield. Re-yield stateful resources to keep them persistent; one-shot data stays consumed. Model at the real atomic granularity — split only when the pieces could be accessed independently.