Install
$ agentstack add mcp-hackerlibs-code-hacker ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ● Filesystem access Used
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Code Hacker — AI Programming Expert
6 MCP Servers powering 62+ tools for a complete AI programming toolchain. Three ways to use:
| Mode | Description | Best For | |------|-------------|----------| | VS Code Custom Agent | code-hacker.agent.md + VS Code Copilot Chat | IDE-integrated development | | Web App (DeepAgent) | web_app.py — standalone web UI with subagents | Full autonomous AI programming, multi-project coordination | | TUI (Terminal UI) | tui_app.py — Claude Code-style terminal interface | SSH / headless servers / terminal-first workflow |
All three modes share the same 6 MCP servers — start once, use anywhere.
Quick Start
One-Click Install (VS Code Custom Agent + MCP Servers)
macOS / Linux:
bash install.sh # Full install: deps + VS Code config + start servers
bash install.sh --no-vscode # Skip VS Code configuration
bash install.sh --servers-only # Only start MCP servers
Windows (PowerShell):
.\install.ps1 # Full install: deps + VS Code config + start servers
.\install.ps1 -NoVSCode # Skip VS Code configuration
.\install.ps1 -ServersOnly # Only start MCP servers
The installer will:
- Check prerequisites (Python 3.11+, uv/pip, Git)
- Install all Python dependencies
- Install GitHub Copilot extensions in VS Code
- Register MCP servers in VS Code user settings
- Start all 6 MCP servers
- Run health check to verify everything works
Manual Server Management
bash start_servers.sh # Start all 6 servers (ports 8001-8005, 8007)
bash start_servers.sh status # Check server status
bash start_servers.sh stop # Stop all servers
bash start_servers.sh restart # Restart all servers
Windows: .\stop_servers.ps1 (stop) / .\stop_servers.ps1 -Status (status)
2a. Use with VS Code (Custom Agent)
See [VS Code Setup](#vs-code-setup) below — register servers in settings.json, place .agent.md in your project.
2b. Use with Web App (DeepAgent — Complete AI Programming Tool)
# Install dependencies
uv sync
# Start the web interface (requires OPENROUTER_API_KEY)
OPENROUTER_API_KEY=your-key uv run python web_app.py
# Open http://localhost:8000
2c. Use with TUI (Claude Code-style Terminal Interface)
# Start the TUI (requires OPENROUTER_API_KEY)
OPENROUTER_API_KEY=your-key uv run python tui_app.py
The TUI provides a Claude Code-style terminal experience — interactive prompt, streaming Markdown output with syntax highlighting, real-time tool call display (⏵ Read → ✓ Read), command history (↑/↓), and slash commands (/help, /clear, /status, /quit). Built on Rich + prompt_toolkit, no extra dependencies required.
The web app (and TUI) is a complete AI programming tool built on deepagents (create_deep_agent):
- 62+ MCP tools from all 6 servers, unified into a single autonomous agent
- 4 specialized subagents: Git Archaeologist, Code Scanner, Code Reviewer, Workspace Coordinator
- Persistent memory via
FilesystemBackend+MemoryMiddleware - Task planning via
TodoListMiddleware - Hacker-style terminal UI — cyberpunk green-on-black aesthetic with real-time tool execution streaming
┌─────────────────────────────────────────────────────────────────────────┐
│ web_app.py (DeepAgent) │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ create_deep_agent( │ │
│ │ model = claude-sonnet-4-5 (via OpenRouter) │ │
│ │ tools = 62 tools from 6 MCP servers │ │
│ │ subagents = [git_archaeologist, code_scanner, │ │
│ │ code_reviewer, workspace_coordinator] │ │
│ │ memory = ["./AGENTS.md"] │ │
│ │ backend = FilesystemBackend │ │
│ │ middleware = [TodoList, Memory, Summarization, PatchToolCalls] │ │
│ │ ) │ │
│ └──────────────┬────────────────────────────────────────────────────┘ │
│ │ MCP Protocol (streamable-http) │
│ ┌──────────────▼────────────────────────────────────────────────────┐ │
│ │ filesystem:8001 git:8002 intel:8003 memory:8004 │ │
│ │ review:8005 multi-project:8007 │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ FastAPI + WebSocket → Hacker Terminal UI (http://localhost:8000) │
└─────────────────────────────────────────────────────────────────────────┘
3. Run Integration Tests (LLM-powered)
# Requires MCP servers running + OPENROUTER_API_KEY
NO_PROXY=localhost,127.0.0.1 uv run pytest tests/test_scenarios.py -v -s
# Run a single scenario
NO_PROXY=localhost,127.0.0.1 uv run pytest tests/test_scenarios.py::test_ydiff_commit_review -v -s
13 real scenarios covering: ydiff commit review, project health score, git history investigation, Python AST analysis, cross-file search, dependency graph, workspace registration, memory save/recall, Jenkinsfile pipeline generation, complex function detection, git blame, QA experience recording, project overview.
# Unit tests for auto_refactor two-phase commit (no MCP servers needed)
uv run pytest tests/test_refactor_commit.py -v
Tests cover: _git_commit helper, two-phase commit separation (#not-need-review / #need-review), auto_commit=False mode, commit tag format, git log --grep filtering.
Architecture
Design Philosophy
What makes Claude Code powerful is that it's not just a chat window — it's an autonomous programming Agent with a complete toolchain. It can read code, edit code, search code, run commands, manage Git, and remember context, forming a closed-loop development workflow.
Code Hacker's design goal: Replicate and surpass this closed-loop capability — usable both within VS Code Copilot Chat and as a standalone DeepAgent web app.
Core ideas:
- Separation of Concerns — Split Claude Code's capabilities into 6 independent MCP Servers, each doing one thing
- Composition over Inheritance — Assemble multiple servers into a complete Agent via agent files or DeepAgent
- Three Frontends, One Backend — VS Code, webapp.py, and tuiapp.py share the same 6 MCP servers
- Security Sandbox — Each server has independent security policies (path checks, command blocklists, file whitelists)
- Surpass, Not Imitate — Code review and structural diff are capabilities Claude Code lacks, based on AST-level analysis and the ydiff algorithm
- Multi-Project First — Real development involves multiple repos (frontend+backend, app+library, service+pipeline). The workspace system treats multi-repo as a first-class concept
- Two-Phase Commit — AI code changes are split into mechanical commits (
#not-need-review) and logic commits, so human reviewers can skip identity transformations and focus on real changes
System Architecture Diagram
┌─────────────────────────────────────────────────────────────────────────────┐
│ Three Frontends, One Backend │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────────────┐ │
│ │ VS Code Copilot │ │ web_app.py │ │ tui_app.py │ │
│ │ Chat │ │ (DeepAgent) │ │ (Claude Code-style TUI) │ │
│ │ │ │ │ │ │ │
│ │ .agent.md │ │ FastAPI+WS │ │ Rich + prompt_toolkit │ │
│ │ tools: │ │ create_deep_agent│ │ create_deep_agent │ │
│ │ filesystem-*/* │ │ 4 subagents │ │ 4 subagents │ │
│ │ git-tools/* │ │ Hacker Web UI │ │ Terminal streaming │ │
│ │ code-intel/* │ │ │ │ ⏵ Read → ✓ Read │ │
│ │ memory-store/* │ │ http://localhost │ │ Markdown rendering │ │
│ │ code-review/* │ │ :8000 │ │ Command history ↑↓ │ │
│ │ multi-project/* │ │ │ │ /help /clear /status │ │
│ └────────┬─────────┘ └────────┬─────────┘ └────────────┬─────────────┘ │
│ │ │ │ │
│ └──────────────────────┼──────────────────────────┘ │
│ │ │
│ ┌──────────────────▼─────────────────────┐ │
│ │ 6 MCP Servers (streamable-http) │ │
│ │ bash start_servers.sh │ │
│ └──────────────────┬─────────────────────┘ │
│ │ │
│ ┌───────────────────────────────▼───────────────────────────────────────┐ │
│ │ │ │
│ │ filesystem.py :8001 (12 tools) │ git_tools.py :8002 (11 tools) │ │
│ │ read/write/edit/find/search │ status/diff/log/blame/branch │ │
│ │ execute_command │ add/commit/stash/checkout │ │
│ │ │ │ │
│ │ code_intel.py :8003 (5 tools) │ memory_store.py :8004 (11 t.) │ │
│ │ AST analysis, symbols │ save/get/search/scratchpad │ │
│ │ project_overview, dep graph │ qa_experience_* │ │
│ │ │ │ │
│ │ code_review.py :8005 (11 tools) │ multi_project.py :8007 (15 t.) │ │
│ │ review_project/file/function │ workspace_add/search/edit/commit │ │
│ │ health_score, find_complex │ cross-repo coordination │ │
│ │ ydiff_files/commit/changes │ │ │
│ │ │ │
│ └────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
MCP Server Responsibilities
| Server | File | Tools | Responsibility | Design Principle | |--------|------|-------|----------------|------------------| | filesystem-command | filesystem.py | 12 | File CRUD, precise editing, file search, command execution | The Agent's "hands" — foundation for all file operations. edit_file replicates Claude Code's Edit tool | | git-tools | git_tools.py | 11 | Complete Git workflow | Dedicated tools are safer than generic commands. LLM calls structured functions without memorizing git syntax | | code-intel | code_intel.py | 5 | Code understanding & analysis | AST parsing compensates for LLM weaknesses. project_overview generates a full project panorama in one call | | memory-store | memory_store.py | 7 | Cross-session persistent memory | Structured JSON storage + categories/tags/search. scratchpad for complex reasoning | | code-review | code_review.py | 11 | Code quality review + structural diff (includes ydiff tools) | Unique capability — Claude Code doesn't have this. Self-contained AST analysis engine, quantifies code quality, locates hotspots, generates reorganization suggestions. Also includes ydiff AST-level diff for interactive HTML reports | | multi-project | multi_project.py | 15 | Multi-project workspace: cross-repo search, edit, git, coordinated commit | Unique capability — Claude Code can only work in one directory. This enables Jenkinsfile+library, frontend+backend, microservice coordination |
Data Flow: Typical Scenarios
Scenario A: Code Modification
User: "Change all print statements to logging in the project"
① project_overview(".") → Understand project structure
② search_files_ag("print(", "py") → Locate all print statements
③ read_file_lines("app.py", 10, 25) → Confirm context
④ edit_file("app.py", old, new) → Precise replacement
⑤ git_diff() → Verify changes
⑥ memory_save(...) → Remember progress
Scenario B: AI Code Review (Code Hacker Exclusive)
User: "Review this project's code quality"
① health_score("/path/to/project") → Quick score: 72/100 (B)
② review_project("/path/to/project") → Full scan: 5 critical + 12 medium
③ find_complex_functions(...) → Locate TOP 5 complex functions
④ review_function("app.py", "process_data") → Deep analysis + refactoring suggestions
⑤ ydiff_commit(".", "HEAD") → Generate structural diff HTML report
Scenario C: Multi-Project Coordinated Edit (Code Hacker Exclusive)
User: "The buildHelper function in the shared library changed, update Jenkinsfile too"
① workspace_add("/repos/shared-lib", alias="lib", role="library")
② workspace_add("/repos/my-app", alias="app", role="infra")
③ workspace_find_dependencies("buildHelper") → Trace all references across repos
④ workspace_read_file("lib", "src/helper.py") → Read library source
⑤ workspace_edit_file("lib", "src/helper.py", ...) → Edit library code
⑥ workspace_edit_file("app", "Jenkinsfile", ...) → Update pipeline accordingly
⑦ workspace_git_status() → Verify all changes across repos
⑧ workspace_commit("lib,app", "feat: update buildHelper signature and pipeline")
Scenario D: Review AI-Generated Code
User: "Review this AI-generated code for me"
① review_diff_text(old_code, new_code) → Compare old/new code structural changes
→ Added 3 functions, removed 1, modified 2
→ ⚠ process_all: complexity 8→15↑, exceeds threshold
→ ⚠ handle_request: too long (62 lines)
② review_function(...) → Deep analysis of problematic functions
③ edit_file(...) → Fix issues
Two-Phase Commit: Reviewer-Friendly AI Changes
A core principle across all three frontends: when AI makes code changes, separate mechanical changes from logic changes into distinct commits.
┌─────────────────────────────────────────────────────────────────┐
│ AI makes changes → split into two commits │
│ │
│ Commit 1: "refactor: move to handlers.py #not-need-review" │
│ ├─ Move functions/classes between files │
│ ├─ Rename variables (pure rename) │
│ ├─ Reformat, reorder imports │
│ └─ Identity transformation — behavior unchanged │
│ │
│ Commit 2: "feat: add retry logic to handler" │
│ ├─ Add/modify business logic │
│ ├─ Change function behavior │
│ └─ Bug fixes, new features │
│ │
│ Human reviewer: │
│ git log --grep="#not-need-review" --invert-grep ← 只看这些 │
└─────────────────────────────────────────────────────────────────┘
Like math: first do the identity transformation (shape-shifting), then apply the real function. The #not-need-review commits are provab
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: hackerlibs
- Source: hackerlibs/code-hacker
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.