mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 19:31:07 +00:00
VS Code's chat participant, agent and llm tools called api.openai.com, api.anthropic.com, Gemini, Mistral and Cohere directly with the user's own provider keys, and its Hanzo path posted to api.hanzo.ai/ext/v1/llm/chat and /llm/complete, which answer 404. The defaults they sent (gpt-4, claude-3-opus-20240229, zen-70b, zen1, hanzo-embed-v1) are not ids api.hanzo.ai/v1/models lists. Every hosted call now goes to POST api.hanzo.ai/v1/chat/completions through one client, src/api/chat.ts, as zen5 unless a model is named. The bearer is the IAM session, else HANZO_API_KEY or the hanzo.llm.hanzo.apiKey setting. hanzo.llm.hanzo.model replaces the OpenAI and Anthropic settings. src/mcp/tools/agent.ts goes: the ai-tools agent registers after it under the same name, so it never ran. The llm consensus tool, which only printed advice, now asks zen5 and zen5-pro. The zen tool no longer goes through core/backend-abstraction, which leaves that module and unified-rxdb-backend without a caller; their completion and embedding paths point at the gateway too. Ollama and LM Studio stay; they run on the user's machine. hanzo-mcp defaulted chat to "auto", which is not in /v1/models; the gateway resolves it only when router auto-routing is on for the org (hanzoai/ai controllers/auto_route.go:118-160), and cloud's FallbackModel comment (hanzo-inc/cloud model.go:111-121) records it never demonstrably serving. Chat now defaults to zen5 and embeddings to zen-embedding. /v1/models lists no image or speech model, so those actions require the caller to name one instead of sending dall-e-3 or tts-1. The files and fine-tuning actions go: /v1/files and /v1/fine_tuning/jobs answer 404. Claude-Session: https://claude.ai/code/session_01Dc8DXc3fEQCRHUa6XWK4Ku
@hanzo/mcp
TypeScript implementation of Model Context Protocol (MCP) server with 40+ built-in tools for AI development.
Features
- 📁 File Operations: Read, write, edit, move, delete, and manage files
- 🔍 Advanced Search: Grep, ripgrep, file finding, and unified search
- 💻 Shell Integration: Execute commands, manage background processes
- ✏️ Smart Editing: Single and multi-file editing with precise replacements
- 🌳 Project Navigation: Directory trees, file listing, and exploration
- 🧠 AI Tools: Think, critic, consensus, and agent delegation capabilities
- 🔎 Vector Search: LanceDB integration for multimodal embeddings
- 🌲 AST Search: Code intelligence with syntax-aware search
- 📋 Todo Management: Task tracking with priorities, tags, and projects
- 🎯 Mode System: Context-aware tool filtering and command palettes
Installation
npm install -g @hanzo/mcp
Usage
As a CLI
# Start MCP server
hanzo-mcp serve
# Use with Claude Desktop
hanzo-mcp install-desktop
As a Library
import { createMCPServer } from '@hanzo/mcp';
const server = await createMCPServer({
name: 'my-mcp-server',
version: '1.0.0',
customTools: [
// Your custom tools
]
});
await server.start();
Built-in Tools
File Operations
read_file- Read file contentswrite_file- Write or overwrite filesedit_file- Replace text in filesmulti_edit- Multiple edits in one operationcreate_file- Create new filesdelete_file- Delete filesmove_file- Move or rename fileslist_files- List directory contentstree- Show directory tree structure
Search Tools
grep- Pattern search with grep/ripgrepfind_files- Find files by name patternsearch- Unified search combining multiple strategiesast_search- AST-based code pattern searchfind_symbol- Find function/class definitionsanalyze_dependencies- Analyze import dependencies
Shell Tools
bash- Execute shell commandsshell- Cross-platform shell executionbackground_bash- Run background processeskill_process- Terminate processeslist_processes- List running processes
AI Tools
think- Structured reasoning spacecritic- Critical analysis toolconsensus- Multi-model consensusagent- Delegate tasks to sub-agents
Vector Search
vector_index- Create vector indexesvector_search- Search with embeddingsvector_stats- Vector database statistics
Todo Management
todo_add- Add new todo itemstodo_list- List and filter todostodo_update- Update todo status/detailstodo_delete- Delete todostodo_stats- Todo statistics and productivity
Mode & Palette System
mode_switch- Switch tool modesmode_list- List available modespalette_select- Select command palettepalette_list- List palettesmode_create- Create custom modesshortcut- Execute palette shortcuts
Modes
The MCP server supports different modes that filter available tools:
- developer - Full access to all tools
- research - Read-only exploration tools
- editor - File editing focused tools
- terminal - Shell and system operations
- ai_assistant - AI-powered assistance tools
- project_manager - Task and project management
Configuration
Environment Variables
# Vector search database path
HANZO_VECTOR_DB=/path/to/vector.db
# Todo storage path
HANZO_TODO_PATH=/path/to/todos.json
# Hanzo API key for the AI tools, which reach every model through api.hanzo.ai
# (default model zen5; any id GET https://api.hanzo.ai/v1/models lists)
HANZO_API_KEY=sk-...
Custom Tools
import { Tool, createMCPServer } from '@hanzo/mcp';
const myTool: Tool = {
name: 'my_tool',
description: 'My custom tool',
inputSchema: {
type: 'object',
properties: {
input: { type: 'string' }
},
required: ['input']
},
handler: async (args) => {
return {
content: [{
type: 'text',
text: `Processed: ${args.input}`
}]
};
}
};
const server = await createMCPServer({
customTools: [myTool]
});
Integration with Claude Desktop
- Install the MCP server:
npm install -g @hanzo/mcp
- Configure Claude Desktop:
hanzo-mcp install-desktop
This adds the server to your Claude Desktop configuration at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Development
# Clone the repository
git clone https://github.com/hanzoai/mcp.git
cd mcp
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Development mode
npm run dev
License
MIT © Hanzo AI