name: elfiee-mcp
description: "Guide for using Elfiee MCP tools to interact with .elf files. Use when Claude needs to read, write, or manage blocks inside .elf projects via MCP tools (elfiee_file_list, elfiee_block_*, elfiee_markdown_*, elfiee_code_*, elfiee_directory_*, elfiee_terminal_*, elfiee_grant/revoke, elfiee_editor_*, elfiee_exec) or MCP resources (elfiee://files, elfiee://{project}/blocks, elfiee://{project}/block/{id}, elfiee://{project}/grants, elfiee://{project}/events). Triggers: working with .elf files, managing blocks, reading/writing markdown or code in blocks, directory operations inside .elf, terminal sessions, permission management."
Elfiee MCP Tools
Elfiee exposes MCP tools and resources for interacting with .elf files. Two connection modes:
| Mode |
Transport |
When to use |
| GUI mode |
SSE on port 47200 |
Elfiee GUI is running with files open |
| Standalone mode |
stdio (JSON-RPC) |
No GUI needed; Claude Code launches elfiee mcp-server --elf <path> |
Prohibited Actions
When Elfiee MCP is connected, ALL content managed by .elf blocks MUST be read and written through Elfiee MCP tools.
NEVER do these:
| Prohibited |
Use instead |
Read / cat / head to read block content |
elfiee_markdown_read / elfiee_code_read / elfiee_block_get |
Write / Edit to modify block content |
elfiee_markdown_write / elfiee_code_write |
Bash with ls / rm / mv on .elf internals |
elfiee_block_list / elfiee_block_delete / elfiee_block_rename |
Glob / Grep to search inside .elf |
elfiee_block_list + elfiee_*_read |
| Directly editing files that correspond to .elf blocks |
Always go through elfiee_*_write tools |
| Creating files in the project to store content |
elfiee_block_create + elfiee_*_write |
Why this matters:
- .elf uses event sourcing — direct filesystem edits bypass the event log and will be lost or overwritten
- Permissions are enforced through CBAC (Capability-Based Access Control) — only MCP tools check authorization
- Block snapshots (physical files) are derived data regenerated from events — editing them directly has no lasting effect
The only exception:
elfiee_directory_export explicitly exports block content to the filesystem for external use (e.g., git commit). Files created by export ARE normal filesystem files and can be read/edited normally after export.
Standalone Mode
Run elfiee mcp-server --elf /path/to/project.elf as a subprocess. Configure in .claude/mcp.json:
{
"mcpServers": {
"elfiee": {
"command": "elfiee",
"args": ["mcp-server", "--elf", "/path/to/project.elf"]
}
}
}
Standalone mode auto-creates an mcp-agent editor with full permissions. Uses SQLite WAL mode for concurrent access.
Quick Start
- Call
elfiee_file_list to get open projects and their paths
- Use the
project path (e.g., "./my.elf") in all subsequent calls
- Call
elfiee_block_list to discover blocks
- Use type-specific tools to read/write content
Common Parameter: project
Every tool (except elfiee_file_list) requires project -- the .elf file path as returned by elfiee_file_list.
Block Types
markdown | code | directory | terminal
Tool Reference
File Discovery
| Tool |
Purpose |
Params |
elfiee_file_list |
List open .elf files |
(none) |
Block CRUD
| Tool |
Purpose |
Key Params |
elfiee_block_list |
List all blocks |
project |
elfiee_block_get |
Get block details |
project, block_id |
elfiee_block_create |
Create block |
project, name, block_type, parent_id? |
elfiee_block_delete |
Delete block |
project, block_id |
elfiee_block_rename |
Rename block |
project, block_id, name |
elfiee_block_change_type |
Change type |
project, block_id, new_type |
elfiee_block_update_metadata |
Update metadata |
project, block_id, metadata (JSON object) |
Block Relations
| Tool |
Purpose |
Key Params |
elfiee_block_link |
Link parent->child |
project, parent_id, child_id, relation |
elfiee_block_unlink |
Remove relation |
project, parent_id, child_id, relation |
Relation type: only implement is allowed. Semantics: A → B means "A's change causes B to need a change" (upstream defines downstream).
Content Read/Write
| Tool |
Purpose |
Key Params |
elfiee_markdown_read |
Read markdown |
project, block_id |
elfiee_markdown_write |
Write markdown |
project, block_id, content |
elfiee_code_read |
Read code |
project, block_id |
elfiee_code_write |
Write code |
project, block_id, content |
Directory Operations
| Tool |
Purpose |
Key Params |
elfiee_directory_create |
Create file/dir entry |
project, block_id, path, type (file/directory), source (outline/linked), content?, block_type? |
elfiee_directory_delete |
Delete entry |
project, block_id, path |
elfiee_directory_rename |
Move/rename entry |
project, block_id, old_path, new_path |
elfiee_directory_write |
Batch update entries |
project, block_id, entries (JSON), source? |
elfiee_directory_import |
Import from filesystem |
project, block_id, source_path, target_path? |
elfiee_directory_export |
Export to filesystem |
project, block_id, target_path, source_path? |
Terminal Operations
| Tool |
Purpose |
Key Params |
elfiee_terminal_init |
Start terminal session |
project, block_id, shell? |
elfiee_terminal_execute |
Run command |
project, block_id, command |
elfiee_terminal_save |
Save session content |
project, block_id, content |
elfiee_terminal_close |
Close session |
project, block_id |
Permission (CBAC)
| Tool |
Purpose |
Key Params |
elfiee_grant |
Grant capability |
project, block_id, editor_id, cap_id |
elfiee_revoke |
Revoke capability |
project, block_id, editor_id, cap_id |
Capability IDs: core.create, core.read, core.link, core.unlink, core.delete, core.grant, core.revoke, core.update_metadata, core.rename, core.change_type, markdown.write, markdown.read, code.write, code.read, directory.create, directory.delete, directory.rename, directory.write, directory.import, directory.export, terminal.init, terminal.execute, terminal.save, terminal.close, agent.create, agent.enable, agent.disable.
Editor Management
| Tool |
Purpose |
Key Params |
elfiee_editor_create |
Create editor |
project, editor_id, name? |
elfiee_editor_delete |
Delete editor |
project, editor_id |
Generic Execution
| Tool |
Purpose |
Key Params |
elfiee_exec |
Execute any capability |
project, capability, block_id?, payload? |
Use elfiee_exec for capabilities not covered by dedicated tools.
Causal Linking Protocol
Core rule: Every time you modify block B because of block A, create a link:
elfiee_block_link(project, parent_id=A, child_id=B, relation="implement")
The implement relation means "upstream defines/decides downstream". This builds a traceable causal chain.
When to link
| Scenario |
Link |
| Task block describes requirement, you write Code block to implement it |
Task → Code |
| PRD/spec block defines tasks, you create Task blocks from it |
PRD → Task |
| Code block written, you write Test block to verify it |
Code → Test |
| Bug report block leads to a fix in Code block |
Bug → Code |
| Design block drives UI component in Code block |
Design → Code |
When NOT to link
- Reading a block for reference without modifying anything downstream
- The two blocks are unrelated — just happened to edit both in the same session
- A link already exists (idempotent: linking twice is harmless but unnecessary)
Example chain
PRD → Task-Auth → Code-Login → Test-Login
→ Code-Session → Test-Session
Graph-First Context Navigation
Core rule: When you need context from the .elf project, traverse the relation graph first before searching unlinked blocks.
Algorithm
1. Start: elfiee_block_get(target_block) — read the block you're working on
2. Map: elfiee_block_list — get ALL blocks with their children relations
3. Build reverse index:
for each block B:
for each child_id in B.children["implement"]:
parents[child_id].add(B.block_id)
4. Traverse upstream (parents):
current = target_block
while parents[current] is not empty:
read each parent block
current = parent (continue to root)
5. Traverse downstream (children):
read target_block.children["implement"] recursively
6. Read siblings:
for each parent of target_block:
read other children of that parent (siblings)
7. Only if still insufficient: search remaining unlinked blocks
Why graph-first
- The relation graph encodes causal intent — blocks linked by
implement are logically dependent
- Upstream blocks contain the "why" (requirements, specs, tasks)
- Downstream blocks contain the "how" (implementations, tests)
- Siblings share the same upstream context — likely relevant
- Unlinked blocks are noise until proven otherwise
Quick example
You're editing Code-Login. Before searching randomly:
1. elfiee_block_get("Code-Login") — read the code
2. elfiee_block_list → build parent map
3. Upstream: Task-Auth → PRD — understand the requirement
4. Downstream: Test-Login — see existing tests
5. Siblings: Code-Session (shares Task-Auth parent) — related module
6. Only then: search other blocks if needed
Workflow Examples
Read all markdown blocks
1. elfiee_file_list -> get project path
2. elfiee_block_list(project) -> find blocks where block_type == "markdown"
3. elfiee_markdown_read(project, block_id) -> for each markdown block
Create a code file in a directory block
1. elfiee_file_list -> get project path
2. elfiee_block_list(project) -> find directory block
3. elfiee_directory_create(project, block_id, path="src/main.rs",
type="file", source="outline", content="fn main() {}",
block_type="code")
Execute a terminal command
1. elfiee_file_list -> get project path
2. elfiee_block_list(project) -> find terminal block
3. elfiee_terminal_init(project, block_id)
4. elfiee_terminal_execute(project, block_id, command="cargo build")
5. elfiee_terminal_close(project, block_id)
Link blocks after causal modification
1. (You just wrote code in code_block because task_block required it)
2. elfiee_block_link(project, parent_id=task_block_id, child_id=code_block_id, relation="implement")
Navigate context via relation graph
1. elfiee_block_list(project) -> get all blocks with children relations
2. Find target block's parents (blocks whose children["implement"] includes target)
3. elfiee_block_get(project, parent_id) -> read upstream context (the "why")
4. Read siblings (other children of the same parent) -> related blocks
5. Read target's own children -> downstream implementations
MCP Resources
Read-only data accessible via ReadMcpResourceTool (server: elfiee).
Static Resources
| URI |
Description |
elfiee://files |
List of currently open .elf project files |
Dynamic Resources (per project)
| URI Pattern |
Description |
elfiee://{project}/blocks |
All blocks in project (summary) |
elfiee://{project}/block/{block_id} |
Full content of a specific block |
elfiee://{project}/grants |
Permission grants table |
elfiee://{project}/events |
Event sourcing log |
Replace {project} with the project path (e.g., ./my.elf) and {block_id} with the block ID.
Error Handling
| Error |
Cause |
Fix |
Project not open |
.elf file not loaded |
Open file in Elfiee GUI first, or use standalone mode |
Block not found |
Invalid block_id |
Use elfiee_block_list to get valid IDs |
No active editor |
No editor session |
GUI must have an active editor session |
Engine not found |
Engine not started |
Reopen file in GUI |
Invalid payload |
Wrong parameters |
Check the tool's parameter schema |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: h2oslabs-elfiee-elfiee-mcp3description: ---4---5---6name: elfiee-mcp7description: "Guide for using Elfiee MCP tools to interact with .elf files. Use when Claude needs to read, write, or manage blocks inside .elf projects via MCP tools (elfiee_file_list, elfiee_block_*, elfiee_markdown_*, elfiee_code_*, elfiee_directory_*, elfiee_terminal_*, elfiee_grant/revoke, elfiee_editor_*, elfiee_exec) or MCP resources (elfiee://files, elfiee://{project}/blocks, elfiee://{project}/block/{id}, elfiee://{project}/grants, elfiee://{project}/events). Triggers: working with .elf files, managing blocks, reading/writing markdown or code in blocks, directory operations inside .elf, terminal sessions, permission management."8---910# Elfiee MCP Tools1112Elfiee exposes MCP tools and resources for interacting with `.elf` files. Two connection modes:1314| Mode | Transport | When to use |15|------|-----------|-------------|16| **GUI mode** | SSE on port 47200 | Elfiee GUI is running with files open |17| **Standalone mode** | stdio (JSON-RPC) | No GUI needed; Claude Code launches `elfiee mcp-server --elf <path>` |1819## Prohibited Actions2021**When Elfiee MCP is connected, ALL content managed by .elf blocks MUST be read and written through Elfiee MCP tools.**2223### NEVER do these:2425| Prohibited | Use instead |26|-----------|-------------|27| `Read` / `cat` / `head` to read block content | `elfiee_markdown_read` / `elfiee_code_read` / `elfiee_block_get` |28| `Write` / `Edit` to modify block content | `elfiee_markdown_write` / `elfiee_code_write` |29| `Bash` with `ls` / `rm` / `mv` on .elf internals | `elfiee_block_list` / `elfiee_block_delete` / `elfiee_block_rename` |30| `Glob` / `Grep` to search inside .elf | `elfiee_block_list` + `elfiee_*_read` |31| Directly editing files that correspond to .elf blocks | Always go through `elfiee_*_write` tools |32| Creating files in the project to store content | `elfiee_block_create` + `elfiee_*_write` |3334### Why this matters:3536- .elf uses **event sourcing** — direct filesystem edits bypass the event log and will be **lost or overwritten**37- Permissions are enforced through **CBAC** (Capability-Based Access Control) — only MCP tools check authorization38- Block snapshots (physical files) are **derived data** regenerated from events — editing them directly has no lasting effect3940### The only exception:4142- `elfiee_directory_export` explicitly exports block content to the filesystem for external use (e.g., git commit). Files created by export ARE normal filesystem files and can be read/edited normally after export.4344## Standalone Mode4546Run `elfiee mcp-server --elf /path/to/project.elf` as a subprocess. Configure in `.claude/mcp.json`:4748```json49{50 "mcpServers": {51 "elfiee": {52 "command": "elfiee",53 "args": ["mcp-server", "--elf", "/path/to/project.elf"]54 }55 }56}57```5859Standalone mode auto-creates an `mcp-agent` editor with full permissions. Uses SQLite WAL mode for concurrent access.6061## Quick Start62631. Call `elfiee_file_list` to get open projects and their paths642. Use the `project` path (e.g., `"./my.elf"`) in all subsequent calls653. Call `elfiee_block_list` to discover blocks664. Use type-specific tools to read/write content6768## Common Parameter: `project`6970Every tool (except `elfiee_file_list`) requires `project` -- the `.elf` file path as returned by `elfiee_file_list`.7172## Block Types7374`markdown` | `code` | `directory` | `terminal`7576## Tool Reference7778### File Discovery7980| Tool | Purpose | Params |81|------|---------|--------|82| `elfiee_file_list` | List open .elf files | (none) |8384### Block CRUD8586| Tool | Purpose | Key Params |87|------|---------|------------|88| `elfiee_block_list` | List all blocks | `project` |89| `elfiee_block_get` | Get block details | `project`, `block_id` |90| `elfiee_block_create` | Create block | `project`, `name`, `block_type`, `parent_id?` |91| `elfiee_block_delete` | Delete block | `project`, `block_id` |92| `elfiee_block_rename` | Rename block | `project`, `block_id`, `name` |93| `elfiee_block_change_type` | Change type | `project`, `block_id`, `new_type` |94| `elfiee_block_update_metadata` | Update metadata | `project`, `block_id`, `metadata` (JSON object) |9596### Block Relations9798| Tool | Purpose | Key Params |99|------|---------|------------|100| `elfiee_block_link` | Link parent->child | `project`, `parent_id`, `child_id`, `relation` |101| `elfiee_block_unlink` | Remove relation | `project`, `parent_id`, `child_id`, `relation` |102103Relation type: only `implement` is allowed. Semantics: `A → B` means "A's change causes B to need a change" (upstream defines downstream).104105### Content Read/Write106107| Tool | Purpose | Key Params |108|------|---------|------------|109| `elfiee_markdown_read` | Read markdown | `project`, `block_id` |110| `elfiee_markdown_write` | Write markdown | `project`, `block_id`, `content` |111| `elfiee_code_read` | Read code | `project`, `block_id` |112| `elfiee_code_write` | Write code | `project`, `block_id`, `content` |113114### Directory Operations115116| Tool | Purpose | Key Params |117|------|---------|------------|118| `elfiee_directory_create` | Create file/dir entry | `project`, `block_id`, `path`, `type` (`file`/`directory`), `source` (`outline`/`linked`), `content?`, `block_type?` |119| `elfiee_directory_delete` | Delete entry | `project`, `block_id`, `path` |120| `elfiee_directory_rename` | Move/rename entry | `project`, `block_id`, `old_path`, `new_path` |121| `elfiee_directory_write` | Batch update entries | `project`, `block_id`, `entries` (JSON), `source?` |122| `elfiee_directory_import` | Import from filesystem | `project`, `block_id`, `source_path`, `target_path?` |123| `elfiee_directory_export` | Export to filesystem | `project`, `block_id`, `target_path`, `source_path?` |124125### Terminal Operations126127| Tool | Purpose | Key Params |128|------|---------|------------|129| `elfiee_terminal_init` | Start terminal session | `project`, `block_id`, `shell?` |130| `elfiee_terminal_execute` | Run command | `project`, `block_id`, `command` |131| `elfiee_terminal_save` | Save session content | `project`, `block_id`, `content` |132| `elfiee_terminal_close` | Close session | `project`, `block_id` |133134### Permission (CBAC)135136| Tool | Purpose | Key Params |137|------|---------|------------|138| `elfiee_grant` | Grant capability | `project`, `block_id`, `editor_id`, `cap_id` |139| `elfiee_revoke` | Revoke capability | `project`, `block_id`, `editor_id`, `cap_id` |140141Capability IDs: `core.create`, `core.read`, `core.link`, `core.unlink`, `core.delete`, `core.grant`, `core.revoke`, `core.update_metadata`, `core.rename`, `core.change_type`, `markdown.write`, `markdown.read`, `code.write`, `code.read`, `directory.create`, `directory.delete`, `directory.rename`, `directory.write`, `directory.import`, `directory.export`, `terminal.init`, `terminal.execute`, `terminal.save`, `terminal.close`, `agent.create`, `agent.enable`, `agent.disable`.142143### Editor Management144145| Tool | Purpose | Key Params |146|------|---------|------------|147| `elfiee_editor_create` | Create editor | `project`, `editor_id`, `name?` |148| `elfiee_editor_delete` | Delete editor | `project`, `editor_id` |149150### Generic Execution151152| Tool | Purpose | Key Params |153|------|---------|------------|154| `elfiee_exec` | Execute any capability | `project`, `capability`, `block_id?`, `payload?` |155156Use `elfiee_exec` for capabilities not covered by dedicated tools.157158## Causal Linking Protocol159160**Core rule**: Every time you modify block B because of block A, create a link:161162```163elfiee_block_link(project, parent_id=A, child_id=B, relation="implement")164```165166The `implement` relation means "upstream defines/decides downstream". This builds a traceable causal chain.167168### When to link169170| Scenario | Link |171|----------|------|172| Task block describes requirement, you write Code block to implement it | Task → Code |173| PRD/spec block defines tasks, you create Task blocks from it | PRD → Task |174| Code block written, you write Test block to verify it | Code → Test |175| Bug report block leads to a fix in Code block | Bug → Code |176| Design block drives UI component in Code block | Design → Code |177178### When NOT to link179180- Reading a block for reference without modifying anything downstream181- The two blocks are unrelated — just happened to edit both in the same session182- A link already exists (idempotent: linking twice is harmless but unnecessary)183184### Example chain185186```187PRD → Task-Auth → Code-Login → Test-Login188 → Code-Session → Test-Session189```190191## Graph-First Context Navigation192193**Core rule**: When you need context from the .elf project, traverse the relation graph first before searching unlinked blocks.194195### Algorithm196197```1981. Start: elfiee_block_get(target_block) — read the block you're working on1992. Map: elfiee_block_list — get ALL blocks with their children relations2003. Build reverse index:201 for each block B:202 for each child_id in B.children["implement"]:203 parents[child_id].add(B.block_id)2044. Traverse upstream (parents):205 current = target_block206 while parents[current] is not empty:207 read each parent block208 current = parent (continue to root)2095. Traverse downstream (children):210 read target_block.children["implement"] recursively2116. Read siblings:212 for each parent of target_block:213 read other children of that parent (siblings)2147. Only if still insufficient: search remaining unlinked blocks215```216217### Why graph-first218219- The relation graph encodes **causal intent** — blocks linked by `implement` are logically dependent220- Upstream blocks contain the **"why"** (requirements, specs, tasks)221- Downstream blocks contain the **"how"** (implementations, tests)222- Siblings share the same upstream context — likely relevant223- Unlinked blocks are noise until proven otherwise224225### Quick example226227You're editing `Code-Login`. Before searching randomly:228229```2301. elfiee_block_get("Code-Login") — read the code2312. elfiee_block_list → build parent map2323. Upstream: Task-Auth → PRD — understand the requirement2334. Downstream: Test-Login — see existing tests2345. Siblings: Code-Session (shares Task-Auth parent) — related module2356. Only then: search other blocks if needed236```237238## Workflow Examples239240### Read all markdown blocks241242```2431. elfiee_file_list -> get project path2442. elfiee_block_list(project) -> find blocks where block_type == "markdown"2453. elfiee_markdown_read(project, block_id) -> for each markdown block246```247248### Create a code file in a directory block249250```2511. elfiee_file_list -> get project path2522. elfiee_block_list(project) -> find directory block2533. elfiee_directory_create(project, block_id, path="src/main.rs",254 type="file", source="outline", content="fn main() {}",255 block_type="code")256```257258### Execute a terminal command259260```2611. elfiee_file_list -> get project path2622. elfiee_block_list(project) -> find terminal block2633. elfiee_terminal_init(project, block_id)2644. elfiee_terminal_execute(project, block_id, command="cargo build")2655. elfiee_terminal_close(project, block_id)266```267268### Link blocks after causal modification269270```2711. (You just wrote code in code_block because task_block required it)2722. elfiee_block_link(project, parent_id=task_block_id, child_id=code_block_id, relation="implement")273```274275### Navigate context via relation graph276277```2781. elfiee_block_list(project) -> get all blocks with children relations2792. Find target block's parents (blocks whose children["implement"] includes target)2803. elfiee_block_get(project, parent_id) -> read upstream context (the "why")2814. Read siblings (other children of the same parent) -> related blocks2825. Read target's own children -> downstream implementations283```284285## MCP Resources286287Read-only data accessible via `ReadMcpResourceTool` (server: `elfiee`).288289### Static Resources290291| URI | Description |292|-----|-------------|293| `elfiee://files` | List of currently open .elf project files |294295### Dynamic Resources (per project)296297| URI Pattern | Description |298|-------------|-------------|299| `elfiee://{project}/blocks` | All blocks in project (summary) |300| `elfiee://{project}/block/{block_id}` | Full content of a specific block |301| `elfiee://{project}/grants` | Permission grants table |302| `elfiee://{project}/events` | Event sourcing log |303304Replace `{project}` with the project path (e.g., `./my.elf`) and `{block_id}` with the block ID.305306## Error Handling307308| Error | Cause | Fix |309|-------|-------|-----|310| `Project not open` | .elf file not loaded | Open file in Elfiee GUI first, or use standalone mode |311| `Block not found` | Invalid block_id | Use `elfiee_block_list` to get valid IDs |312| `No active editor` | No editor session | GUI must have an active editor session |313| `Engine not found` | Engine not started | Reopen file in GUI |314| `Invalid payload` | Wrong parameters | Check the tool's parameter schema |315316<!-- Auto-generated from src-tauri/templates/elfiee-client/skill.yaml -->317<!-- To regenerate: update skill.yaml and run the project -->318319---320> Converted and distributed by [TomeVault](https://tomevault.io/claim/h2oslabs) — claim your Tome and manage your conversions.321<!-- tomevault:4.0:skill_md:2026-04-14 -->