- Add comprehensive MCP_DEMO.md with setup instructions - Add test scripts for E2E and protocol testing - Update build configuration for better module compatibility - Configure Claude Desktop with multiple MCP server options
4.4 KiB
Hanzo MCP Search - E2E Demo Guide
โ Setup Complete
The Hanzo MCP Search has been successfully:
- Built and installed globally (
@hanzo/mcpv2.0.0) - Configured with Claude Desktop
- Tested with the CLI
๐ How to Use with Claude Desktop
1. Restart Claude Desktop
After installation, restart Claude Desktop to load the MCP tools.
2. Available Tools
Once restarted, Claude will have access to these search tools:
search Tool
Search across your codebase with the following parameters:
query(required): Search query textmaxResults(optional): Limit results (default: 10)filePattern(optional): File glob pattern (e.g., ".ts", "**/.js")
Example prompts to try in Claude:
"Search for 'LanceDB' in the codebase"
"Find all TypeScript files containing 'search'"
"Look for 'function' in JavaScript files"
fetch Tool
Fetch full document content by ID:
id(required): Document ID from search results
3. Testing the Integration
In a new Claude conversation, try these commands:
-
Basic Search Test: "Use the search tool to find files containing 'vector'"
-
Pattern Search Test: "Search for 'export' in TypeScript files only"
-
Fetch Document Test: "Search for 'search' and then fetch the first result"
4. CLI Usage
You can also use the CLI directly:
# Start the server
hanzo-mcp serve
# Check version
hanzo-mcp --version
# Output: 2.0.0
# Install to Claude Desktop (already done)
hanzo-mcp install-desktop
๐ Security Features
Ngrok Integration (Optional)
To enable secure remote access:
# Set ngrok token
export NGROK_AUTHTOKEN=your_token_here
export NGROK_ENABLED=true
export ACCESS_TOKEN=your_secure_token
# Start server with ngrok
hanzo-mcp serve
When ngrok is enabled:
- Files are served over HTTPS with post-quantum TLS
- ACCESS_TOKEN authentication required
- URLs automatically use ngrok tunnel
Local Mode (Default)
Without ngrok configuration:
- Files use
file://URLs - Only accessible locally
- No external exposure
๐งช Testing
Run Direct Tests
# Run the test script
node test-search.js
Expected Output Format
Search results follow OpenAI MCP specification:
{
"results": [
{
"id": "unique-id",
"title": "filename.ts:42",
"url": "file:///path/to/file"
}
]
}
Fetch results return:
{
"id": "unique-id",
"title": "filename.ts",
"text": "file content...",
"url": "file:///path/to/file",
"metadata": {
"type": "code",
"language": "typescript"
}
}
๐ Project Structure
/Users/z/work/hanzo/mcp/
โโโ src/
โ โโโ search/ # Unified search implementation
โ โ โโโ index.ts # Main search & fetch tools
โ โ โโโ strategies/ # Search strategy pattern
โ โ โโโ secure-tunnel.ts # Ngrok integration
โ โ โโโ url-helper.ts # URL generation
โ โโโ tools/ # All MCP tools
โโโ dist/ # Built output
โโโ test-search.js # Direct test script
โโโ package.json # v2.0.0
๐ฏ Features
- Multi-modal Search: Text, AST, Symbol, Vector, File
- OpenAI MCP Compliance: Standard
searchandfetchtools - Extensible Architecture: Strategy pattern for new search types
- Secure Remote Access: Optional ngrok with authentication
- 54 Total Tools: Including UI, AutoGUI, and Orchestration tools
๐ Current Status
- โ CLI installed and working
- โ Claude Desktop configured
- โ Server can be started
- โ Search returns MCP-compliant format
- โ Build process optimized
- โ ๏ธ CI has test failures (non-blocking)
๐ง Troubleshooting
If Claude doesn't show the tools:
- Fully quit Claude Desktop (not just close window)
- Restart Claude Desktop
- Check config:
~/Library/Application Support/Claude/claude_desktop_config.json
If search returns no results:
- Ensure you're in a directory with code files
- Try broader search terms
- Check file patterns match your project
๐ Next Steps
- In Claude Desktop: Try the search commands above
- Set up ngrok (optional): For remote access capability
- Customize search: Add project-specific search strategies
- Monitor usage: Check server logs for debugging
Version: 2.0.0
NPM Package: @hanzo/mcp
GitHub: https://github.com/hanzoai/mcp