mcp.tools¶
MCP Server Tools Package.
This package provides comprehensive tools for exploring, managing, and interacting with Model Context Protocol (MCP) servers. These tools enable discovery of server capabilities, resource inspection, and interactive management of MCP server lifecycles.
Key Components¶
- Server Management Tools
MCPResourceInspector
- Discovers server tools, resources, and capabilitiesMCPServerViewer
- Interactive interface for server management and explorationMCPServerSelector
- Intelligent server selection based on requirementsMCPServerTester
- Comprehensive testing and validation of server functionality
- AI-Powered Tools
MCPAIAssistant
- Intelligent assistant for MCP server operationsSmart Discovery: Automatic capability detection and optimization
Resource Analysis: Deep inspection of server resources and tools
Usage Examples¶
Server Resource Inspection¶
from haive.mcp.tools import MCPResourceInspector
# Inspect server capabilities
inspector = MCPResourceInspector()
capabilities = await inspector.inspect_server(
"filesystem_server",
include_tools=True,
include_resources=True,
include_prompts=True
)
print(f"Available tools: {capabilities.tools}")
print(f"Available resources: {capabilities.resources}")
Interactive Server Management¶
from haive.mcp.tools import MCPServerViewer
# Launch interactive server viewer
viewer = MCPServerViewer()
await viewer.start_interactive_session()
# Select and explore servers
server_info = await viewer.select_server()
await viewer.explore_capabilities(server_info)
Server Testing and Validation¶
from haive.mcp.tools import MCPServerTester
# Test server functionality
tester = MCPServerTester()
results = await tester.run_comprehensive_tests(
server_name="web_search_server",
test_tools=True,
test_resources=True,
test_performance=True
)
print(f"Test results: {results.summary}")
Available Classes¶
Inspection Tools¶
MCPResourceInspector
- Server capability discoveryMCPServerTester
- Testing and validation
Management Tools¶
MCPServerViewer
- Interactive server explorationMCPServerSelector
- Intelligent server selection
AI-Powered Tools¶
MCPAIAssistant
- Intelligent MCP assistantSmart Analysis: Automated server analysis and optimization
Command Line Interface¶
Server Explorer: Interactive CLI for server management
Resource Browser: Browse server tools and resources
Test Runner: Execute comprehensive server tests
Note
These tools provide both programmatic APIs and interactive interfaces for comprehensive MCP server management and exploration.