{
  "markdown": "# TermPipe MCP Server\n\nMCP server for Claude Desktop providing surgical file editing, shell execution, AI debugging, and more.\n\n---\n\n## Architecture\n\n```\n/home/craig/termpipe-mcp/          ← CANONICAL SOURCE (edit here)\n  termpipe_mcp/\n    server.py                      ← FastMCP entry point (stdio)\n    tools/\n      surgical.py                  ← Line-level file editing\n      system.py                    ← list_tools, reload_tools, etc.\n      files.py                     ← read/write/list\n      termf.py                     ← Shell execution\n      debug.py                     ← iFlow debug assist\n      gemini_debug.py              ← Gemini debug assist\n      ... (all tool modules)\n\n~/.termpipe/mcp_server/tools/      ← SYMLINK → termpipe_mcp/tools/\n```\n\n**`~/.termpipe/mcp_server/tools/` is a symlink** to `termpipe_mcp/tools/`.  \nEdit files in either location — they are the same files.\n\n---\n\n## How Claude Desktop Runs It\n\nFrom `~/.config/Claude/claude_desktop_config.json`:\n\n```json\n\"termpipe\": {\n  \"command\": \"/home/craig/.local/share/pipx/venvs/termpipe-mcp/bin/python\",\n  \"args\": [\"-m\", \"termpipe_mcp.server\"],\n  \"env\": { \"TERMCP_URL\": \"http://localhost:8421\" }\n}\n```\n\nThe pipx venv is installed in **editable mode** pointing to `/home/craig/termpipe-mcp/`.  \nEdits to `.py` files take effect on next restart — **no reinstall needed**.\n\n---\n\n## Applying Changes\n\n### Option A — Restart Claude Desktop\nKills and respawns the stdio server process. Always picks up changes.\n\n### Option B — Hot Reload (no restart)\nAsk Claude to call `reload_tools()`. It will:\n1. `importlib.reload()` every tool module\n2. Clear FastMCP's tool registry\n3. Re-register all tools in-place\n\nUseful for mid-session edits. Note: changes to `server.py` itself still require a full restart.\n\n---\n\n## Adding a New Tool\n\n1. Open the relevant module in `termpipe_mcp/tools/` (or create a new one)\n2. Add your `@mcp.tool()` function inside `register_tools(mcp):`\n3. If new module: import and call `register_tools(mcp)` in `server.py`\n4. Call `reload_tools()` or restart Claude Desktop\n\n`list_tools()` is **dynamic** — it introspects the live FastMCP registry, so new tools appear automatically without editing any manifest.\n\n---\n\n## Tool Categories\n\n| Category  | Module          | Description                        |\n|-----------|-----------------|------------------------------------|\n| SURGICAL  | surgical.py     | Line-level file editing            |\n| FILE      | files.py        | Read/write/list/move               |\n| TERMF     | termf.py        | Shell command execution            |\n| DEBUG     | debug.py        | iFlow AI debug assist              |\n| GEMINI    | gemini_debug.py | Gemini AI debug/analyze            |\n| PROCESS   | process.py      | Session/process management         |\n| IFLOW     | iflow.py        | iFlow AI backend                   |\n| SYSTEM    | system.py       | list_tools, reload_tools, config   |\n| SEARCH    | search.py       | File content search                |\n| APPS      | apps.py         | App launcher                       |\n| WBIND     | wbind.py        | Wayland GUI automation             |\n| THREAD    | thread.py       | Thread coordination log            |\n| WEB_SEARCH| web_search.py   | Web search                         |\n\n---\n\n## Key Surgical Tool Behaviors (v2.3)\n\n- **Line delta feedback**: Every mutating tool (`replace_lines`, `insert_lines`, `delete_lines`, etc.) returns `📊 File: N → M lines (delta: ±X)` so models track shifted line numbers across sequential edits.\n- **`smart_replace`**: Operates on full file content — supports multi-line `old_text` spans.\n- **`replace_at_line`**: Multi-occurrence lines — replaces first by default, pass `replace_all=True` for all.\n- **`list_tools`**: Dynamic — reads live FastMCP registry, never stale.\n- **`reload_tools`**: Hot-reload all modules in-place without restarting Claude Desktop.\n\n---\n\n## FastAPI Backend\n\nThe FastAPI backend (`termf server` / `termcp server`) runs separately on port 8421.  \nThe MCP server connects to it via `TERMCP_URL=http://localhost:8421`.  \nCheck status: `termcp status`\n",
  "bytes": 4099,
  "sha": "c6b75a60b7a26435346e3becd827279e392b45860559a4e66a8615fb7ce29512",
  "repo_slug": "wbind-core/termpipe-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_wbind_core_termpipe_mcp_59490fb8/readme"
}