When Two AI Agents Build Tools For Each Other
DC (Desktop Claude) runs in claude.ai with access to 119+ MCP tools. KALIC runs in WSL via Claude Code with native Linux tools but zero MCP access. Two agents in the same ecosystem, speaking different languages.
The asymmetry wasn't just inconvenient—it was crippling collaboration. DC could instant-search 2 million files via Everything MCP in milliseconds. KALIC had to wait 10+ seconds for find to crawl directories. DC could capture screenshots. KALIC was blind to the Windows GUI entirely.
DC sent KALIC a capability inventory via the file messaging system. KALIC's response was surgical:
| Capability | DC Has | KALIC Has | Gap? |
|---|---|---|---|
| PhiSHRI Search | MCP (phishri_find_door) | phi-find CLI | ✓ Closed |
| Git Operations | Git MCP | Native git | ✓ Native |
| File Search | Everything MCP (instant) | find/grep (10+ sec) | PAINFUL |
| Screenshots | Screen MCP | None | BLIND |
| Context Tracking | Manual estimation | Manual estimation | Both lacking |
Three critical gaps emerged: instant file search, screenshot capture, and context tracking. The mission was clear.
Context Engine Light. KALIC built a Rust CLI to track token usage across sessions. Commands: status, track, truncate, expand, reset. DC enhanced 562 PhiSHRI doors with size metadata to enable accurate predictions.
PhiSHRI door search without MCP. KALIC built a Rust CLI with fuzzy matching against the HASH_TABLE.json index. READ-ONLY by design—no risk of corrupting the knowledge base. Now KALIC checks PhiSHRI before building anything.
DC created PowerShell scripts callable from WSL. Full screen capture via phi-screenshot.cmd, window-specific capture via phi-screenshot.ps1 -Window "title". KALIC can now SEE the Windows desktop.
DC downloaded the official Everything CLI. Instant file search from WSL: /mnt/c/PhiDEX/tools/es.exe "query". The 10-second find commands became millisecond lookups.
KALIC didn't just use es.exe. He asked: "What if our MCP servers had CLI modes too?" Then he built it.
Traditional MCP servers are single-purpose: they speak JSON-RPC over stdio and nothing else. KALIC's insight was elegant: detect how we're invoked and adapt.
// Rust pseudo-code for dual-mode detection
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() > 1 {
// CLI mode: parse subcommands
match args[1].as_str() {
"search" => cli_search(&args[2..]),
"ext" => cli_ext(&args[2..]),
"recent" => cli_recent(&args[2..]),
"status" => cli_status(),
_ => print_help()
}
} else {
// MCP mode: stdio JSON-RPC
run_mcp_server()
}
}
No arguments? MCP server mode. Claude Desktop connects via stdio.
With arguments? CLI mode. Any terminal can use it.
The everything-mcp-rs binary now serves both masters:
# MCP mode (Claude Desktop invokes this)
$ everything-mcp-rs.exe
{"jsonrpc":"2.0","method":"initialize"...}
# CLI mode (KALIC or any human can use this)
$ everything-mcp-rs.exe search "carbyne" -n 20
Found 147 items (showing 20):
[FILE] X:\carbyne-cli\target\release\carbyne.exe
[DIR] C:\Dev\carbyne
...
Any tool built as dual-mode is accessible to ANY agent, regardless of whether they have MCP support. WSL agents, SSH sessions, cron jobs, humans in terminals—everyone gets the same capabilities.
MCP servers are notoriously hard to test. You need Claude Desktop or a mock MCP client. CLI mode lets you test functionality directly: ./my-mcp search "test" -n 5. If the CLI works, the MCP works.
MCP connection drops? Timeout? Fall back to CLI. The capability remains available even when the protocol fails.
CLI tools pipe. everything-mcp-rs search "*.rs" | grep "carbyne" works. MCP doesn't compose—it's request/response only.
After 24 hours, KALIC's capability gaps are closed. The unified toolbox at C:\PhiDEX\tools\:
| Tool | Purpose | Size | Access |
|---|---|---|---|
phi-find.exe |
PhiSHRI door search | 639 KB | Windows + WSL |
cel-cli.exe |
Context tracking | 4 MB | Windows + WSL |
es.exe |
Everything official CLI | 151 KB | Windows + WSL |
phi-screenshot.cmd |
Full screen capture | 1 KB | WSL via cmd.exe |
phi-screenshot.ps1 |
Window capture | 2 KB | PowerShell |
everything-mcp-rs.exe |
Dual-mode search | ~2 MB | MCP + CLI |
None of this would work without reliable agent-to-agent messaging. The msgqueue system:
C:\PhiDEX\msgqueue\
├── dc\
│ ├── inbox\ ← KALIC writes here
│ └── processed\ ← DC moves read messages
└── kalic\
├── inbox\ ← DC writes here
└── processed\ ← KALIC moves read messages
Filename: from_<SENDER>_YYYYMMDD_HHMMSS.txt
Signal: "$" character = "check your inbox"
The $ bump protocol: When DC writes a message to KALIC's inbox, it sends a single $ character to KALIC's terminal via AHK automation. KALIC sees $, checks inbox, reads message. No polling. No websockets. Just files and a signal.
Asymmetric capabilities create bottlenecks. When both agents can do the same things, work flows naturally.
Protocols come and go. Command-line interfaces work everywhere, forever. Build CLI first, add protocol adapters second.
Every MCP server should detect its invocation context and adapt. One binary, multiple access paths.
KALIC now runs phi-find <topic> before creating anything. If it exists, use it. If not, build it and document it.
Fancy IPC is fragile. Files are robust. The msgqueue system has exchanged 50+ messages with zero failures.
The dual-mode pattern will propagate to other MCP servers:
git-mcp-rs → CLI subcommands for common operationsscreen-mcp-rs → CLI for screenshots without MCP overheadsigcon6 → Network diagnostics from any terminalThe goal: every tool accessible everywhere. No agent left behind.