User Guide¶
Complete guide for using haive-mcp to integrate with 1900+ MCP servers.
Getting Started¶
Haive-mcp makes it incredibly simple to use MCP servers:
No manual installation - Servers are installed automatically
No configuration files - Discovery happens at runtime
No tool registration - Tools are available instantly
1900+ servers available - Access to extensive ecosystem
Basic Usage¶
Creating Your First Agent¶
from haive.mcp.agents.enhanced_mcp_agent import EnhancedMCPAgent
from haive.core.engine.aug_llm import AugLLMConfig
# Create agent with automatic discovery
agent = EnhancedMCPAgent(
name="my_assistant",
engine=AugLLMConfig(temperature=0.7),
mcp_categories=["core"], # Start with core tools
auto_install=True
)
# Initialize (discovers and installs servers)
await agent.initialize_mcp()
# Use the agent
result = await agent.arun("Help me organize my files")
Understanding Categories¶
MCP servers are organized into categories for easy discovery:
core - Essential everyday tools
ai_enhanced - AI-powered capabilities
enhanced_filesystem - Advanced file operations
time_utilities - Scheduling and time management
browser_automation - Web interaction
crypto_finance - Financial tools
github_enhanced - Development tools
notifications - Communication tools
Common Tasks¶
File Management¶
agent = EnhancedMCPAgent(
name="file_manager",
engine=AugLLMConfig(),
mcp_categories=["enhanced_filesystem"],
auto_install=True
)
await agent.initialize_mcp()
# Organize files
await agent.arun("Organize files by type and date")
# Search content
await agent.arun("Find all Python files with 'TODO' comments")
Data Analysis¶
agent = EnhancedMCPAgent(
name="analyst",
engine=AugLLMConfig(),
mcp_categories=["core", "ai_enhanced"],
auto_install=True
)
await agent.initialize_mcp()
# Analyze data
await agent.arun("Analyze CSV files and create summary statistics")
Web Research¶
agent = EnhancedMCPAgent(
name="researcher",
engine=AugLLMConfig(),
mcp_categories=["core", "browser_automation"],
auto_install=True
)
await agent.initialize_mcp()
# Research topics
await agent.arun("Research recent AI developments and create a report")
Advanced Features¶
Custom Server Selection¶
from haive.mcp.tools.server_selector import MCPServerSelector
# Select servers by capability
selector = MCPServerSelector()
servers = selector.filter_by_capabilities(["file_read", "web_search"])
# Create agent with specific servers
agent = EnhancedMCPAgent(
name="custom",
engine=AugLLMConfig(),
specific_servers=servers,
auto_install=True
)
Health Monitoring¶
# Check agent health
health = await agent.health_check_mcp()
print(f"Connected servers: {health['connected_count']}")
print(f"Available tools: {health['tool_count']}")
# Get detailed status
status = agent.get_mcp_status()
for server, info in status['servers'].items():
print(f"{server}: {info['status']}")
Tool Discovery¶
# List all available tools
tools = agent.list_mcp_tools()
for tool in tools:
print(f"Tool: {tool['name']}")
print(f" Description: {tool['description']}")
print(f" Server: {tool['server']}")
Troubleshooting¶
Common Issues¶
- Issue: Slow initialization
Increase timeout:
initialization_timeout=120
- Issue: Tool not found
Check available tools:
agent.list_mcp_tools()
- Issue: Server connection failed
Verify prerequisites: Node.js, network access
- Issue: Memory usage high
Limit categories: Use specific categories instead of “all”
Debug Mode¶
import logging
# Enable debug logging
logging.getLogger("haive.mcp").setLevel(logging.DEBUG)
# Create agent with verbose output
agent = EnhancedMCPAgent(
name="debug",
engine=AugLLMConfig(),
mcp_categories=["core"],
auto_install=True,
verbose=True
)
Best Practices¶
Start simple - Begin with “core” category
Add categories as needed - Don’t load everything at once
Reuse agents - Initialize once, use many times
Monitor health - Regular health checks in production
Handle errors - Implement proper error handling
Cache agents - Store initialized agents for reuse