complete_mcp_with_parent_retrieverΒΆ

Complete End-to-End MCP Example with Parent Document Retriever.

This example demonstrates: 1. Parent-child document retrieval for MCP servers 2. Self-query capabilities with metadata filtering 3. HITL approval for server installation 4. Live server testing with tools, resources, and prompts 5. Hierarchical categorization with AutoTree

The parent-child pattern allows: - Small chunks for precise similarity search (capabilities, keywords) - Full server documentation returned for context - Metadata filtering (stars, category, etc.) via self-query

ClassesΒΆ

HITLRequest

HITL approval request.

MCPServerInfo

Complete MCP server information.

MCPSystemWithParentRetriever

MCP system using parent-child document retrieval.

FunctionsΒΆ

main()

Run the complete end-to-end example.

Module ContentsΒΆ

class complete_mcp_with_parent_retriever.HITLRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

HITL approval request.

action: strΒΆ
details: dict[str, Any] = NoneΒΆ
risk_level: str = 'medium'ΒΆ
server_name: strΒΆ
class complete_mcp_with_parent_retriever.MCPServerInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Complete MCP server information.

capabilities: list[str] = NoneΒΆ
category: strΒΆ
description: strΒΆ
install_command: str | None = NoneΒΆ
name: strΒΆ
repository_url: strΒΆ
setup_instructions: str | None = NoneΒΆ
stars: int = 0ΒΆ
transport_types: list[str] = NoneΒΆ
class complete_mcp_with_parent_retriever.MCPSystemWithParentRetriever(engine: haive.core.engine.aug_llm.AugLLMConfig)ΒΆ

MCP system using parent-child document retrieval.

async demonstrate_retrieval() NoneΒΆ

Demonstrate different retrieval patterns.

async install_top_server_with_hitl() str | NoneΒΆ

Find and install top server with HITL approval.

async setup_retrievers() NoneΒΆ

Set up both parent-child and self-query retrievers.

async test_installed_server(server_name: str) NoneΒΆ

Test installed server with all MCP capabilities.

doc_loaderΒΆ
engineΒΆ
installed_servers: dict[str, dict]ΒΆ
parent_retriever = NoneΒΆ
rag_agent = NoneΒΆ
self_query_retriever = NoneΒΆ
async complete_mcp_with_parent_retriever.main()ΒΆ

Run the complete end-to-end example.