Zed extension that exposes mainframe-mcp as a context server for the Agent Panel, enabling AI agents to access the mainframe knowledge graph.
- Native MCP context server integration with Zed's Agent Panel
- 7 MCP tools:
upsert_entity,get_entity,search_entities,search_similar,get_graph_stats,add_relationship,get_related_entities - Configurable via settings.json (path, args, env)
- Includes zed-ninja skill for Zed editor expertise
-
mainframe-mcp binary at
~/.local/bin/mainframe-mcp:cd /path/to/mainframe CGO_ENABLED=1 go build -tags "fts5" -o ~/.local/bin/mainframe-mcp ./cmd/mainframe-mcp
-
PostgreSQL with mainframe database:
cd /path/to/mainframe/mainframe docker compose -f local-dev.yml up -d mainframe-postgres -
Rust with WASM target:
rustup target add wasm32-wasip1
- Open Zed
Cmd+Shift+P→ "zed: Install Dev Extension"- Select this directory
make build
# or: cargo build --release --target wasm32-wasip1The extension uses built-in defaults but can be overridden via ~/.config/zed/settings.json:
{
"context_servers": {
"mainframe": {
"command": {
"path": "/custom/path/to/mainframe-mcp",
"args": ["--postgres-only", "--postgres", "postgres://user:pass@host:5432/db"]
}
}
}
}| Setting | Default Value |
|---|---|
| Binary | /Users/dust/.local/bin/mainframe-mcp |
| Args | --postgres-only --postgres postgres://mainframe:mainframe-local@localhost:5432/mainframe?sslmode=disable |
- Open a project in Zed
- Open Agent Panel (
Cmd+Shift+A) - Check Settings → Context Servers → mainframe shows green
- Ask the agent: "Use mainframe to get graph stats"
make doctor # Health check (toolchain, binary, postgres, extension)
make logs # Tail Zed logs filtered for mainframe/MCP
make logs-errors # Show recent errors only
make test-mcp # Test MCP server initialization
make build # Build WASM extension
make clean # Clean build artifactsmake doctor- Check Zed logs:
make logs-errors - Verify binary:
ls -la ~/.local/bin/mainframe-mcp
Common causes:
- Binary path incorrect (check
make doctor) - PostgreSQL not running
- Binary outputting to stdout instead of stderr
Test directly:
make test-mcpWASM may be stale. Force rebuild in Zed:
Cmd+Shift+P→ "zed: Rebuild Extension" → select mainframe
Extensions run in a sandboxed WASM environment where std::env::var() does NOT work. The extension uses hardcoded defaults with settings.json override pattern.
# Build
make build
# Watch logs while testing
make logs
# Check health
make doctorzed-mainframe/
├── src/lib.rs # Extension code
├── Cargo.toml # Rust dependencies
├── extension.toml # Zed extension manifest
├── Makefile # Helper commands
├── skills/ # Bundled Claude skills
│ └── zed-ninja/ # Zed editor expertise
└── README.md
MIT