Files
extension/MCP-README.md
T
Hanzo Dev 0b6f26d0bf feat: Add comprehensive MCP tools and multi-platform build support
- Implement feature parity between Python and TypeScript MCP versions
- Add comprehensive test coverage for all orthogonal tools
- Consolidate tools to follow single-tool-multiple-actions pattern
- Add bash, git-search, critic, and mode tools
- Create multi-platform build system for VS Code, Claude Desktop, and DXT
- Add test files for filesystem, search, shell, process, web-fetch, mode, and git-search tools
- Fix TypeScript compilation issues and update build scripts
- Update package.json with hanzo-ai publisher ID
- Successfully build all distribution formats:
  - VS Code Extension (.vsix)
  - Claude Desktop MCP package
  - Claude Code DXT file
  - Standalone MCP server
2025-07-04 20:13:16 -04:00

3.8 KiB

Hanzo MCP Integration

This extension includes a full Model Context Protocol (MCP) server implementation, providing 65+ powerful tools for AI assistants.

Features

🚀 Multi-Platform Support

  • VS Code/Cursor/Windsurf: Native extension with integrated MCP server
  • Claude Desktop: Standalone MCP server with one-click installation
  • Any MCP Client: Standard MCP protocol support

🛠️ Available Tools

File System Operations

  • read - Read file contents with pagination
  • write - Create or overwrite files
  • edit - Pattern-based file editing
  • multi_edit - Batch edits to single files
  • directory_tree - Visual directory structure
  • find_files - Fast file finding

Search Capabilities

  • grep - Fast pattern/regex search
  • search - Unified multi-modal search
  • symbols - Find code symbols
  • git_search - Search git history
  • grep_ast - AST-aware code search
  • batch_search - Parallel search operations

Shell & Process Management

  • run_command / bash - Execute shell commands
  • run_background - Background processes
  • processes - List running processes
  • pkill - Terminate processes
  • open - Open files/URLs
  • npx / uvx - Run packages directly

Development Tools

  • todo_read / todo_write - Task management
  • think - Structured reasoning space
  • notebook_read / notebook_edit - Jupyter support
  • neovim_edit - Advanced editor integration

AI/Agent Capabilities

  • dispatch_agent - Delegate to sub-agents
  • llm - Query multiple LLM providers
  • consensus - Multi-LLM consensus
  • batch - Atomic multi-operation execution

Installation

For VS Code/Cursor/Windsurf

  1. Install the Hanzo extension from marketplace
  2. MCP server starts automatically
  3. Configure via VS Code settings

For Claude Desktop

Automatic Installation

# Build Claude Desktop package
npm run build:claude-desktop

# Run installer
./dist/claude-desktop/install.sh  # Mac/Linux
# or
./dist/claude-desktop/install.bat  # Windows

Manual Installation

  1. Build the MCP server:

    npm run build:mcp
    
  2. Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

    {
      "mcpServers": {
        "hanzo": {
          "command": "node",
          "args": ["/path/to/extension/dist/mcp-server.js"],
          "env": {
            "HANZO_WORKSPACE": "/path/to/workspace"
          }
        }
      }
    }
    
  3. Restart Claude Desktop

Configuration

VS Code Settings

{
  "hanzo.mcp.enabled": true,
  "hanzo.mcp.transport": "stdio",
  "hanzo.mcp.allowedPaths": ["/path/to/workspace"],
  "hanzo.mcp.disableWriteTools": false,
  "hanzo.mcp.enabledTools": ["read", "write", "search"],
  "hanzo.mcp.disabledTools": ["neovim_edit"]
}

Environment Variables

  • MCP_TRANSPORT - Transport method (stdio/tcp)
  • HANZO_WORKSPACE - Default workspace path
  • HANZO_MCP_ALLOWED_PATHS - Comma-separated allowed paths
  • HANZO_MCP_DISABLED_TOOLS - Comma-separated disabled tools

Security

  • Path permissions restrict file access
  • Write operations can be globally disabled
  • Tool-level enable/disable controls
  • Audit trails for all operations

Development

Running Locally

# Development mode with TCP transport
npm run dev:mcp

# Test with stdio transport
MCP_TRANSPORT=stdio node ./out/mcp-server-standalone.js

Adding New Tools

  1. Create tool in src/mcp/tools/
  2. Export from category file
  3. Register in tools/index.ts

Troubleshooting

Claude Desktop Not Finding Tools

  1. Check Claude Desktop logs
  2. Verify config file syntax
  3. Ensure server path is absolute
  4. Restart Claude Desktop

Permission Errors

  1. Add paths to allowedPaths config
  2. Check file system permissions
  3. Disable write tools if needed

License

MIT - See LICENSE file