From 2efe8702c531236b105cc7648ccda30ffe38be7d Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Sat, 5 Jul 2025 17:12:40 +0200 Subject: [PATCH 1/9] Added high-level diagrams --- .codeboarding/Agent_Workflow_Framework.md | 293 ++++++++++++++++++ .codeboarding/Core_Orchestration_Execution.md | 255 +++++++++++++++ .../Intent_Interaction_Management.md | 157 ++++++++++ .codeboarding/LLM_External_Tooling.md | 255 +++++++++++++++ .codeboarding/MCP_API_Gateway.md | 145 +++++++++ .codeboarding/on_boarding.md | 181 +++++++++++ 6 files changed, 1286 insertions(+) create mode 100644 .codeboarding/Agent_Workflow_Framework.md create mode 100644 .codeboarding/Core_Orchestration_Execution.md create mode 100644 .codeboarding/Intent_Interaction_Management.md create mode 100644 .codeboarding/LLM_External_Tooling.md create mode 100644 .codeboarding/MCP_API_Gateway.md create mode 100644 .codeboarding/on_boarding.md diff --git a/.codeboarding/Agent_Workflow_Framework.md b/.codeboarding/Agent_Workflow_Framework.md new file mode 100644 index 000000000..c208adb31 --- /dev/null +++ b/.codeboarding/Agent_Workflow_Framework.md @@ -0,0 +1,293 @@ +```mermaid + +graph LR + + Agent["Agent"] + + AugmentedLLM["AugmentedLLM"] + + Orchestrator["Orchestrator"] + + ParallelLLM["ParallelLLM"] + + Swarm["Swarm"] + + Router["Router"] + + IntentClassifier["IntentClassifier"] + + Executor["Executor"] + + MCPConnectionManager["MCPConnectionManager"] + + ContextDependent["ContextDependent"] + + Agent -- "Uses" --> AugmentedLLM + + Agent -- "Delegates to" --> Executor + + AugmentedLLM -- "Used by" --> Agent + + AugmentedLLM -- "Used by" --> Orchestrator + + AugmentedLLM -- "Used by" --> ParallelLLM + + AugmentedLLM -- "Used by" --> Swarm + + AugmentedLLM -- "Used by" --> Router + + AugmentedLLM -- "Used by" --> IntentClassifier + + Orchestrator -- "Coordinates" --> Agent + + Orchestrator -- "Uses" --> AugmentedLLM + + ParallelLLM -- "Coordinates" --> Agent + + ParallelLLM -- "Uses" --> AugmentedLLM + + Swarm -- "Coordinates" --> Agent + + Swarm -- "Uses" --> AugmentedLLM + + Router -- "Directs tasks to" --> Agent + + Router -- "Relies on" --> IntentClassifier + + IntentClassifier -- "Used by" --> Router + + IntentClassifier -- "Uses" --> AugmentedLLM + + Executor -- "Executes tasks for" --> Agent + + Executor -- "Manages" --> Orchestrator + + Executor -- "Manages" --> ParallelLLM + + Executor -- "Manages" --> Swarm + + MCPConnectionManager -- "Facilitates communication for" --> Agent + + MCPConnectionManager -- "Integrates with" --> Orchestrator + + MCPConnectionManager -- "Integrates with" --> Router + + ContextDependent -- "Provides context to" --> Agent + + ContextDependent -- "Provides context to" --> Orchestrator + + ContextDependent -- "Provides context to" --> ParallelLLM + + ContextDependent -- "Provides context to" --> Swarm + + ContextDependent -- "Provides context to" --> Router + + ContextDependent -- "Provides context to" --> IntentClassifier + + ContextDependent -- "Provides context to" --> Executor + + ContextDependent -- "Provides context to" --> AugmentedLLM + + ContextDependent -- "Provides context to" --> MCPConnectionManager + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +The "Agent & Workflow Framework" component is the backbone of the project, defining how AI agents are structured, how they interact, and how complex multi-agent behaviors are orchestrated. It provides the foundational abstractions and patterns necessary for building sophisticated AI systems. + + + +### Agent + +The fundamental building block of the AI system. It encapsulates an agent's core logic, capabilities, and interaction patterns, serving as the primary autonomous entity capable of performing tasks. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.agents.agent` (1:1) + + + + + +### AugmentedLLM + +Provides a standardized and enhanced interface for interacting with various Large Language Models (LLMs) from different providers. It abstracts away provider-specific details and adds functionalities like prompt augmentation, token management, and structured output, making it the central LLM integration point for all agents and workflows. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.augmented_llm` (1:1) + + + + + +### Orchestrator + +A high-level workflow component responsible for coordinating multiple agents, tools, or sub-workflows to achieve complex, multi-step goals. It defines the overall flow and decision-making logic for sequential or conditional processes. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.orchestrator.orchestrator` (1:1) + + + + + +### ParallelLLM + +Implements a workflow pattern designed for executing multiple LLM calls or agent tasks concurrently. It efficiently manages parallel interactions, distributing tasks (fan-out) and collecting results (fan-in) for improved throughput in multi-task scenarios. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.parallel.parallel_llm` (1:1) + + + + + +### Swarm + +Implements a multi-agent workflow pattern where a group of agents collaborates to solve a problem, often exhibiting emergent intelligence through collective action and iterative refinement. It facilitates communication and coordination among a group of agents. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.swarm.swarm` (1:1) + + + + + +### Router + +A workflow component that intelligently directs incoming requests or tasks to the most appropriate agent, server, or sub-workflow. It makes dynamic routing decisions based on predefined rules or analysis of the request content. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.router.router_base` (1:1) + + + + + +### IntentClassifier + +A workflow component designed to classify user input or system states into predefined intents. This is crucial for understanding the user's goal and enabling other workflow components (like the Router) to make informed decisions about subsequent actions. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.intent_classifier.intent_classifier_base` (1:1) + + + + + +### Executor + +Manages and executes workflows and tasks, providing mechanisms for reliable execution, potentially integrating with durable execution systems. It ensures that complex, long-running agent processes can be reliably executed, paused, resumed, and monitored. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.executor.executor` (1:1) + + + + + +### MCPConnectionManager + +Manages connections and interactions related to the Model Context Protocol (MCP). This component is crucial for enabling communication and data exchange between different parts of the agent system or with external MCP-compliant services, facilitating multi-agent collaboration. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.mcp.mcp_connection_manager` (1:1) + + + + + +### ContextDependent + +A foundational abstract base class or pattern that provides a mechanism for components to depend on and interact with a shared `Context` object. It ensures that various parts of the agent system can access common resources, configurations, and state, promoting a consistent and manageable environment. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.core.context` (1:1) + + + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Core_Orchestration_Execution.md b/.codeboarding/Core_Orchestration_Execution.md new file mode 100644 index 000000000..c6d485fcb --- /dev/null +++ b/.codeboarding/Core_Orchestration_Execution.md @@ -0,0 +1,255 @@ +```mermaid + +graph LR + + MCPApp["MCPApp"] + + Settings["Settings"] + + Executor["Executor"] + + AsyncioExecutor["AsyncioExecutor"] + + TemporalExecutor["TemporalExecutor"] + + Workflow["Workflow"] + + WorkflowRegistry["WorkflowRegistry"] + + BaseSignalHandler["BaseSignalHandler"] + + TemporalExecutorConfig["TemporalExecutorConfig"] + + InteractiveWorkflow["InteractiveWorkflow"] + + MCPApp -- "initializes and depends on" --> Settings + + MCPApp -- "orchestrates and utilizes" --> Executor + + MCPApp -- "manages and queries" --> WorkflowRegistry + + Settings -- "provides configuration to" --> MCPApp + + Settings -- "provides configuration to" --> TemporalExecutorConfig + + Executor -- "executes" --> Workflow + + AsyncioExecutor -- "implements" --> Executor + + TemporalExecutor -- "implements" --> Executor + + AsyncioExecutor -- "executes" --> Workflow + + TemporalExecutor -- "utilizes" --> TemporalExecutorConfig + + Workflow -- "interacts with" --> BaseSignalHandler + + WorkflowRegistry -- "stores and provides access to" --> Workflow + + TemporalExecutorConfig -- "configures" --> TemporalExecutor + + TemporalExecutorConfig -- "depends on" --> Settings + + InteractiveWorkflow -- "extends" --> Workflow + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +The Core Orchestration & Execution component is the central nervous system of the mcp-agent application, responsible for managing the overall application lifecycle, loading global configurations, and orchestrating the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management and enabling sophisticated agentic behaviors. + + + +### MCPApp + +The primary application orchestrator and entry point. It is responsible for bootstrapping the application, loading global configurations (Settings), and coordinating the various sub-systems. It manages the lifecycle of the application and delegates the execution of workflows to appropriate executors. + + + + + +**Related Classes/Methods**: + + + +- `MCPApp` (1:1) + + + + + +### Settings + +This component is responsible for managing and providing access to global application configurations. It loads settings from various sources, making them available to other components that require specific parameters for their operation (e.g., executor configurations, external service credentials). + + + + + +**Related Classes/Methods**: + + + +- `Settings` (1:1) + + + + + +### Executor + +This is the abstract interface for executing workflows and tasks within the mcp-agent framework. It defines the contract for how executable units are run, allowing for different concrete implementations to handle various execution environments, such as in-process asynchronous execution or durable execution via Temporal.io. + + + + + +**Related Classes/Methods**: + + + +- `Executor` (52:239) + + + + + +### AsyncioExecutor + +A concrete implementation of the Executor interface that handles asynchronous, in-process execution of workflows. It leverages Python's asyncio capabilities for concurrent task management, suitable for short-lived or non-durable workflows. + + + + + +**Related Classes/Methods**: + + + +- `AsyncioExecutor` (1:1) + + + + + +### TemporalExecutor + +A concrete implementation of the Executor interface that provides durable and fault-tolerant workflow execution using the Temporal.io platform. It ensures workflow state persistence, retries, and recovery, critical for long-running or mission-critical agentic processes. + + + + + +**Related Classes/Methods**: + + + +- `TemporalExecutor` (1:1) + + + + + +### Workflow + +This serves as the foundational abstraction for defining executable units of work or complex agentic processes. It encapsulates the logic, state, and potential interactions of a workflow, which is then managed and executed by an Executor. + + + + + +**Related Classes/Methods**: + + + +- `Workflow` (71:528) + + + + + +### WorkflowRegistry + +This component is responsible for managing the registration and retrieval of workflow definitions. It acts as a central catalog, making workflows discoverable and available for execution by the system, supporting both in-memory and Temporal-backed storage. + + + + + +**Related Classes/Methods**: + + + +- `WorkflowRegistry` (19:146) + + + + + +### BaseSignalHandler + +This component provides the abstract mechanism for handling signals within workflows. Signals are crucial for inter-workflow communication, managing workflow state, and enabling external interactions, which are vital for robust and responsive execution in asynchronous and durable environments. + + + + + +**Related Classes/Methods**: + + + +- `BaseSignalHandler` (1:1) + + + + + +### TemporalExecutorConfig + +Defines the specific configuration parameters required for the TemporalExecutor to operate. This includes connection details for the Temporal server and other execution-specific settings, ensuring proper integration with the durable execution backend. + + + + + +**Related Classes/Methods**: + + + +- `TemporalExecutorConfig` (1:1) + + + + + +### InteractiveWorkflow + +A specialized type of Workflow designed to handle human interaction. This component is crucial for agentic systems that require user input or approval at various stages of a workflow, enabling human-in-the-loop processes and complex decision flows. + + + + + +**Related Classes/Methods**: + + + +- `InteractiveWorkflow` (20:83) + + + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Intent_Interaction_Management.md b/.codeboarding/Intent_Interaction_Management.md new file mode 100644 index 000000000..08acbf5c1 --- /dev/null +++ b/.codeboarding/Intent_Interaction_Management.md @@ -0,0 +1,157 @@ +```mermaid + +graph LR + + Human_Input_Handler["Human Input Handler"] + + Intent_Classifier["Intent Classifier"] + + Router["Router"] + + Augmented_LLM["Augmented LLM"] + + Embedding_Model["Embedding Model"] + + Agent["Agent"] + + Human_Input_Handler -- "provides input to" --> Intent_Classifier + + Intent_Classifier -- "depends on" --> Augmented_LLM + + Intent_Classifier -- "depends on" --> Embedding_Model + + Router -- "relies on" --> Intent_Classifier + + Router -- "directs to" --> Agent + + Augmented_LLM -- "is used by" --> Intent_Classifier + + Augmented_LLM -- "is used by" --> Router + + Embedding_Model -- "is used by" --> Intent_Classifier + + Embedding_Model -- "is used by" --> Router + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +This component is central to how the AI agent framework understands user needs and directs the flow of execution. It encompasses the mechanisms for receiving user input, interpreting their underlying intent, and subsequently routing the request to the most appropriate agent or workflow. This design allows for flexible and intelligent handling of diverse user interactions, leveraging both advanced language models and efficient embedding techniques. + + + +### Human Input Handler + +This component serves as the primary interface for direct human interaction with the agent system. It is responsible for capturing and processing console input, including user commands (e.g., slash commands) and queries. It also facilitates elicitation, allowing the agent to prompt the user for necessary information. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/human_input/handler.py` (1:1) + + + + + +### Intent Classifier + +This abstract base component defines the contract for classifying incoming user input or system states into predefined intents. It is crucial for understanding the user's underlying goal or purpose, which is a prerequisite for effective decision-making within the agent system. The framework supports both LLM-based and embedding-based concrete implementations. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/workflows/intent_classifier/intent_classifier_base.py` (1:1) + + + + + +### Router + +This abstract base component serves as a central dispatch mechanism within the agent's workflow. Its primary responsibility is to intelligently direct incoming requests or tasks to the most appropriate agent, server, or specific function based on the classified intent and other contextual information. It enables dynamic and flexible routing within the multi-agent orchestration platform. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/workflows/router/router_base.py` (1:1) + + + + + +### Augmented LLM + +This component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., OpenAI, Anthropic, Google GenAI). It abstracts away the complexities of raw LLM APIs, offering functionalities like prompt engineering, token management, and structured output parsing, which are crucial for robust LLM-based intent classification and routing. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/workflows/llm/augmented_llm.py` (1:1) + + + + + +### Embedding Model + +This component provides a standardized interface for generating numerical vector representations (embeddings) of text. These embeddings are fundamental for performing semantic similarity searches and classification tasks, which are utilized in embedding-based intent classification and routing. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/workflows/embedding/embedding_base.py` (1:1) + + + + + +### Agent + +A generic agent or workflow that the Router directs requests to. + + + + + +**Related Classes/Methods**: _None_ + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/LLM_External_Tooling.md b/.codeboarding/LLM_External_Tooling.md new file mode 100644 index 000000000..62fa031f7 --- /dev/null +++ b/.codeboarding/LLM_External_Tooling.md @@ -0,0 +1,255 @@ +```mermaid + +graph LR + + AugmentedLLM["AugmentedLLM"] + + EmbeddingModel["EmbeddingModel"] + + ModelSelector["ModelSelector"] + + Multipart_Converters["Multipart Converters"] + + Provider_Specific_AugmentedLLM_Implementations["Provider-Specific AugmentedLLM Implementations"] + + Provider_Specific_EmbeddingModel_Implementations["Provider-Specific EmbeddingModel Implementations"] + + Agent["Agent"] + + Orchestrator["Orchestrator"] + + Router["Router"] + + IntentClassifier["IntentClassifier"] + + Agent -- "depends on" --> AugmentedLLM + + Orchestrator -- "coordinates" --> AugmentedLLM + + AugmentedLLM -- "utilizes" --> ModelSelector + + AugmentedLLM -- "integrates with" --> Multipart_Converters + + AugmentedLLM -- "is implemented by" --> Provider_Specific_AugmentedLLM_Implementations + + EmbeddingModel -- "is implemented by" --> Provider_Specific_EmbeddingModel_Implementations + + Router -- "relies on" --> AugmentedLLM + + Router -- "relies on" --> EmbeddingModel + + IntentClassifier -- "uses" --> AugmentedLLM + + IntentClassifier -- "uses" --> EmbeddingModel + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +The LLM & External Tooling component is central to the mcp_agent project, providing the foundational capabilities for interacting with various Large Language Models (LLMs) and embedding services. It embodies the project's architectural bias towards abstraction, extensibility, and modularity, allowing the framework to seamlessly integrate with diverse AI providers and leverage their unique strengths. + + + +### AugmentedLLM + +This is the core abstract interface for all Large Language Model (LLM) interactions. It defines a unified API for sending requests and receiving responses from various LLM providers, abstracting away provider-specific details. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) + + + + + +### EmbeddingModel + +An abstract interface for generating numerical embeddings from text. It provides a consistent way to interact with different embedding service providers. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` (13:31) + + + + + +### ModelSelector + +Responsible for dynamically selecting the most appropriate LLM model based on predefined criteria such as cost, latency, or specific model capabilities. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) + + + + + +### Multipart Converters + +These modules handle the conversion of diverse content types (e.g., text, images, tool calls) between the internal Model Context Protocol (MCP) format and the specific input/output formats required by different LLM providers. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.multipart_converter_anthropic` + +- `mcp_agent.workflows.llm.multipart_converter_openai` + + + + + +### Provider-Specific AugmentedLLM Implementations + +Concrete implementations of the AugmentedLLM abstract class for specific LLM providers (e.g., Anthropic, OpenAI, Google, Azure, Bedrock, Ollama). These classes contain the actual logic for making API calls to their respective LLM services. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM` (110:722) + +- `mcp_agent.workflows.llm.augmented_llm_openai.OpenAIAugmentedLLM` (80:845) + + + + + +### Provider-Specific EmbeddingModel Implementations + +Concrete implementations of the EmbeddingModel abstract class for specific embedding providers (e.g., Cohere, OpenAI). They handle the actual API calls to generate embeddings. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel` (18:72) + +- `mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel` (18:70) + + + + + +### Agent + +Represents the core intelligent entity within the framework, responsible for understanding tasks, making decisions, and executing actions, often by interacting with LLMs and external tools. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.agents.agent.Agent` (56:931) + + + + + +### Orchestrator + +Manages and coordinates complex, multi-step workflows, often involving multiple LLM calls, tool uses, and interactions between different agents. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` (45:585) + + + + + +### Router + +Intelligently directs incoming requests or internal queries to the most appropriate LLM or embedding model/service based on context, intent, or other routing criteria. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.router.router_llm.LLMRouter` (81:373) + +- `mcp_agent.workflows.router.router_embedding.EmbeddingRouter` (28:239) + + + + + +### IntentClassifier + +Determines the underlying intent of a user query or system state, leveraging either LLMs or embedding models for classification. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier` (63:243) + +- `mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier` (32:177) + + + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/MCP_API_Gateway.md b/.codeboarding/MCP_API_Gateway.md new file mode 100644 index 000000000..2434eb495 --- /dev/null +++ b/.codeboarding/MCP_API_Gateway.md @@ -0,0 +1,145 @@ +```mermaid + +graph LR + + MCPAggregator["MCPAggregator"] + + ServerRegistry["ServerRegistry"] + + ServerContext["ServerContext"] + + MCPConnectionManager["MCPConnectionManager"] + + MCPServerSettings["MCPServerSettings"] + + MCPAggregator -- "uses" --> MCPConnectionManager + + MCPAggregator -- "exposes capabilities to" --> Agent + + MCPAggregator -- "exposes capabilities to" --> Orchestrator + + ServerRegistry -- "initializes" --> MCPConnectionManager + + ServerContext -- "uses" --> ServerRegistry + + ServerContext -- "depends on" --> ServerRegistry + + ServerContext -- "manages" --> active_agents + + ServerContext -- "registers" --> workflows + + MCPConnectionManager -- "uses" --> MCPServerSettings + + ServerRegistry -- "loads" --> MCPServerSettings + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +Final Component Overview for `MCP & API Gateway`. This component serves as the primary interface for external communication, exposing agent capabilities and workflows via the Model Context Protocol (MCP) and managing connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. These five components are fundamental to the `MCP & API Gateway` subsystem because they collectively manage the entire lifecycle of external communication and capability exposure, aligning with the project's 'AI Agent Framework/Orchestration Platform' nature: `MCPServerSettings` provides the essential configuration for defining how MCP servers are accessed and behave. It's the blueprint for connectivity. `ServerRegistry` acts as the central directory and initializer for all MCP servers. It's crucial for discovering and bringing online the various services that agents can interact with. `MCPConnectionManager` manages the actual network connections, ensuring reliable communication with both local and remote MCP services. It's the operational backbone for data exchange. `MCPAggregator` embodies the 'API Gateway' pattern. It consolidates capabilities from disparate MCP servers into a single, unified interface for agents, abstracting away connection complexities. This is vital for enabling seamless 'Multi-Agent Coordination Mechanisms' and 'Tool Use Frameworks.' `ServerContext` provides the runtime environment for the MCP application server, integrating the FastAPI application, agent management, and workflow registration. It ensures that the exposed capabilities are functional and accessible, supporting the 'Asynchronous Execution Engine' and 'Workflow Patterns.' Together, these components enable the project to effectively expose agent capabilities, manage external MCP server connections, and provide the necessary server-side infrastructure for remote access and interaction, which are critical for an AI Agent Framework/Orchestration Platform. + + + +### MCPAggregator + +The MCPAggregator is a core component responsible for discovering and consolidating capabilities (tools, prompts, and resources) from multiple MCP servers. It acts as a central point for an agent to access and invoke functionalities provided by various remote or local MCP services. It manages persistent connections to servers and provides methods for listing, reading, and calling these aggregated capabilities. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/mcp/mcp_aggregator.py` (1:1) + + + + + +### ServerRegistry + +The ServerRegistry is responsible for managing the configuration and initialization of MCP servers. It loads server configurations from a YAML file, registers initialization hooks, and provides methods to start and initialize server processes based on their defined transport (stdio, streamable HTTP, SSE, websocket). It acts as a directory of available MCP servers. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/mcp/mcp_server_registry.py` (1:1) + + + + + +### ServerContext + +The ServerContext provides the operational context for the MCP application server. It holds references to the FastMCP instance (the FastAPI application for MCP), manages active agents, and initializes the appropriate workflow registry (either InMemoryWorkflowRegistry for asyncio or TemporalWorkflowRegistry for Temporal.io). It also facilitates the registration of workflows and the creation of workflow-specific tools. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/server/app_server.py` (1:1) + + + + + +### MCPConnectionManager + +The MCPConnectionManager is responsible for establishing, maintaining, and closing connections to various MCP servers. It handles the underlying communication protocols and ensures reliable data exchange between the MCPAggregator and the remote MCP services. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/mcp/mcp_connection_manager.py` (1:1) + + + + + +### MCPServerSettings + +MCPServerSettings defines the configuration parameters for individual MCP servers, including their transport type (e.g., stdio, http, websocket), host, port, and other connection-related details. It is a foundational data structure for setting up and connecting to MCP services. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent/config.py` (1:1) + + + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/on_boarding.md b/.codeboarding/on_boarding.md new file mode 100644 index 000000000..f0524ea00 --- /dev/null +++ b/.codeboarding/on_boarding.md @@ -0,0 +1,181 @@ +```mermaid + +graph LR + + Core_Orchestration_Execution["Core Orchestration & Execution"] + + Agent_Workflow_Framework["Agent & Workflow Framework"] + + LLM_External_Tooling["LLM & External Tooling"] + + MCP_API_Gateway["MCP & API Gateway"] + + Intent_Interaction_Management["Intent & Interaction Management"] + + Core_Orchestration_Execution -- "Initializes/Configures" --> Agent_Workflow_Framework + + Core_Orchestration_Execution -- "Manages" --> Agent_Workflow_Framework + + Agent_Workflow_Framework -- "Uses" --> LLM_External_Tooling + + Agent_Workflow_Framework -- "Executes via" --> Core_Orchestration_Execution + + LLM_External_Tooling -- "Provides services to" --> Agent_Workflow_Framework + + LLM_External_Tooling -- "Provides services to" --> Intent_Interaction_Management + + MCP_API_Gateway -- "Exposes" --> Core_Orchestration_Execution + + MCP_API_Gateway -- "Sends requests to" --> Intent_Interaction_Management + + Intent_Interaction_Management -- "Routes requests to" --> Core_Orchestration_Execution + + Intent_Interaction_Management -- "Utilizes" --> LLM_External_Tooling + + click Core_Orchestration_Execution href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Core_Orchestration_Execution.md" "Details" + + click Agent_Workflow_Framework href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Agent_Workflow_Framework.md" "Details" + + click LLM_External_Tooling href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//LLM_External_Tooling.md" "Details" + + click MCP_API_Gateway href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//MCP_API_Gateway.md" "Details" + + click Intent_Interaction_Management href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Intent_Interaction_Management.md" "Details" + +``` + + + +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + + + +## Details + + + +The `mcp-agent` project is designed as a robust AI Agent Framework and Orchestration Platform, emphasizing modularity, extensibility, and asynchronous execution. The architecture is centered around a few key components that manage the lifecycle, execution, and interaction of AI agents and their workflows. + + + +### Core Orchestration & Execution [[Expand]](./Core_Orchestration_Execution.md) + +This component is the central nervous system of the application. It handles the overall application lifecycle, loads global configurations, and manages the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.app.MCPApp` (34:508) + +- `mcp_agent.config.Settings` (1:1) + +- `mcp_agent.executor.executor.Executor` (52:239) + +- `mcp_agent.executor.workflow.Workflow` (71:528) + + + + + +### Agent & Workflow Framework [[Expand]](./Agent_Workflow_Framework.md) + +This component defines the foundational interfaces and common behaviors for all AI agents. It implements reusable multi-agent workflow patterns (e.g., orchestration, parallel execution, swarm intelligence, evaluation), providing structured approaches for complex agentic behaviors. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.agents.agent.Agent` (56:931) + +- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` (45:585) + +- `mcp_agent.workflows.parallel.parallel_llm.ParallelLLM` (23:279) + +- `mcp_agent.workflows.swarm.swarm.Swarm` (189:310) + + + + + +### LLM & External Tooling [[Expand]](./LLM_External_Tooling.md) + +This component provides a unified and abstracted interface for interacting with various Large Language Model (LLM) and embedding providers. It handles model selection, request parameterization, and content conversion. Additionally, it offers a flexible framework for defining and integrating external tools that agents can leverage. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) + +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) + +- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` (13:31) + +- `mcp_agent.utils.pydantic_type_serializer` (1:1) + + + + + +### MCP & API Gateway [[Expand]](./MCP_API_Gateway.md) + +This component serves as the primary interface for external communication. It exposes agent capabilities and workflows via the Model Context Protocol (MCP) and manages connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` (77:1357) + +- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` (1:1) + +- `mcp_agent.server.app_server.ServerContext` (1:1) + + + + + +### Intent & Interaction Management [[Expand]](./Intent_Interaction_Management.md) + +This component is responsible for understanding user intent and directing incoming requests or messages to the appropriate agent or workflow. It supports both LLM-based and embedding-based classification methods and manages direct human interaction, including console input and elicitation. + + + + + +**Related Classes/Methods**: + + + +- `mcp_agent.workflows.router.router_base.Router` (63:275) + +- `mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier` (42:85) + +- `mcp_agent.human_input.handler` (1:1) + + + + + + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file From abaf57275e759cb8c527316fd0d9cd515c9e0627 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Sat, 5 Jul 2025 17:43:30 +0200 Subject: [PATCH 2/9] Added documentationg --- .../Intent_Interaction_Management.md | 157 ----------- .codeboarding/LLM_External_Tooling.md | 255 ----------------- .codeboarding/MCP_API_Gateway.md | 145 ---------- .codeboarding/on_boarding.md | 181 ------------ .../codeboarding/agent-workflow-framework.mdx | 261 ++++++------------ .../core-orchestration-execution.mdx | 228 ++++----------- .../intent-interaction-management.mdx | 138 +++++++++ docs/codeboarding/llm-external-tooling.mdx | 154 +++++++++++ docs/codeboarding/mcp-api-gateway.mdx | 123 +++++++++ docs/codeboarding/overview.mdx | 82 ++++++ docs/docs.json | 11 + 11 files changed, 648 insertions(+), 1087 deletions(-) delete mode 100644 .codeboarding/Intent_Interaction_Management.md delete mode 100644 .codeboarding/LLM_External_Tooling.md delete mode 100644 .codeboarding/MCP_API_Gateway.md delete mode 100644 .codeboarding/on_boarding.md rename .codeboarding/Agent_Workflow_Framework.md => docs/codeboarding/agent-workflow-framework.mdx (62%) rename .codeboarding/Core_Orchestration_Execution.md => docs/codeboarding/core-orchestration-execution.mdx (69%) create mode 100644 docs/codeboarding/intent-interaction-management.mdx create mode 100644 docs/codeboarding/llm-external-tooling.mdx create mode 100644 docs/codeboarding/mcp-api-gateway.mdx create mode 100644 docs/codeboarding/overview.mdx diff --git a/.codeboarding/Intent_Interaction_Management.md b/.codeboarding/Intent_Interaction_Management.md deleted file mode 100644 index 08acbf5c1..000000000 --- a/.codeboarding/Intent_Interaction_Management.md +++ /dev/null @@ -1,157 +0,0 @@ -```mermaid - -graph LR - - Human_Input_Handler["Human Input Handler"] - - Intent_Classifier["Intent Classifier"] - - Router["Router"] - - Augmented_LLM["Augmented LLM"] - - Embedding_Model["Embedding Model"] - - Agent["Agent"] - - Human_Input_Handler -- "provides input to" --> Intent_Classifier - - Intent_Classifier -- "depends on" --> Augmented_LLM - - Intent_Classifier -- "depends on" --> Embedding_Model - - Router -- "relies on" --> Intent_Classifier - - Router -- "directs to" --> Agent - - Augmented_LLM -- "is used by" --> Intent_Classifier - - Augmented_LLM -- "is used by" --> Router - - Embedding_Model -- "is used by" --> Intent_Classifier - - Embedding_Model -- "is used by" --> Router - -``` - - - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - - -This component is central to how the AI agent framework understands user needs and directs the flow of execution. It encompasses the mechanisms for receiving user input, interpreting their underlying intent, and subsequently routing the request to the most appropriate agent or workflow. This design allows for flexible and intelligent handling of diverse user interactions, leveraging both advanced language models and efficient embedding techniques. - - - -### Human Input Handler - -This component serves as the primary interface for direct human interaction with the agent system. It is responsible for capturing and processing console input, including user commands (e.g., slash commands) and queries. It also facilitates elicitation, allowing the agent to prompt the user for necessary information. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/human_input/handler.py` (1:1) - - - - - -### Intent Classifier - -This abstract base component defines the contract for classifying incoming user input or system states into predefined intents. It is crucial for understanding the user's underlying goal or purpose, which is a prerequisite for effective decision-making within the agent system. The framework supports both LLM-based and embedding-based concrete implementations. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/workflows/intent_classifier/intent_classifier_base.py` (1:1) - - - - - -### Router - -This abstract base component serves as a central dispatch mechanism within the agent's workflow. Its primary responsibility is to intelligently direct incoming requests or tasks to the most appropriate agent, server, or specific function based on the classified intent and other contextual information. It enables dynamic and flexible routing within the multi-agent orchestration platform. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/workflows/router/router_base.py` (1:1) - - - - - -### Augmented LLM - -This component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., OpenAI, Anthropic, Google GenAI). It abstracts away the complexities of raw LLM APIs, offering functionalities like prompt engineering, token management, and structured output parsing, which are crucial for robust LLM-based intent classification and routing. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/workflows/llm/augmented_llm.py` (1:1) - - - - - -### Embedding Model - -This component provides a standardized interface for generating numerical vector representations (embeddings) of text. These embeddings are fundamental for performing semantic similarity searches and classification tasks, which are utilized in embedding-based intent classification and routing. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/workflows/embedding/embedding_base.py` (1:1) - - - - - -### Agent - -A generic agent or workflow that the Router directs requests to. - - - - - -**Related Classes/Methods**: _None_ - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/LLM_External_Tooling.md b/.codeboarding/LLM_External_Tooling.md deleted file mode 100644 index 62fa031f7..000000000 --- a/.codeboarding/LLM_External_Tooling.md +++ /dev/null @@ -1,255 +0,0 @@ -```mermaid - -graph LR - - AugmentedLLM["AugmentedLLM"] - - EmbeddingModel["EmbeddingModel"] - - ModelSelector["ModelSelector"] - - Multipart_Converters["Multipart Converters"] - - Provider_Specific_AugmentedLLM_Implementations["Provider-Specific AugmentedLLM Implementations"] - - Provider_Specific_EmbeddingModel_Implementations["Provider-Specific EmbeddingModel Implementations"] - - Agent["Agent"] - - Orchestrator["Orchestrator"] - - Router["Router"] - - IntentClassifier["IntentClassifier"] - - Agent -- "depends on" --> AugmentedLLM - - Orchestrator -- "coordinates" --> AugmentedLLM - - AugmentedLLM -- "utilizes" --> ModelSelector - - AugmentedLLM -- "integrates with" --> Multipart_Converters - - AugmentedLLM -- "is implemented by" --> Provider_Specific_AugmentedLLM_Implementations - - EmbeddingModel -- "is implemented by" --> Provider_Specific_EmbeddingModel_Implementations - - Router -- "relies on" --> AugmentedLLM - - Router -- "relies on" --> EmbeddingModel - - IntentClassifier -- "uses" --> AugmentedLLM - - IntentClassifier -- "uses" --> EmbeddingModel - -``` - - - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - - -The LLM & External Tooling component is central to the mcp_agent project, providing the foundational capabilities for interacting with various Large Language Models (LLMs) and embedding services. It embodies the project's architectural bias towards abstraction, extensibility, and modularity, allowing the framework to seamlessly integrate with diverse AI providers and leverage their unique strengths. - - - -### AugmentedLLM - -This is the core abstract interface for all Large Language Model (LLM) interactions. It defines a unified API for sending requests and receiving responses from various LLM providers, abstracting away provider-specific details. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) - - - - - -### EmbeddingModel - -An abstract interface for generating numerical embeddings from text. It provides a consistent way to interact with different embedding service providers. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` (13:31) - - - - - -### ModelSelector - -Responsible for dynamically selecting the most appropriate LLM model based on predefined criteria such as cost, latency, or specific model capabilities. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) - - - - - -### Multipart Converters - -These modules handle the conversion of diverse content types (e.g., text, images, tool calls) between the internal Model Context Protocol (MCP) format and the specific input/output formats required by different LLM providers. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.multipart_converter_anthropic` - -- `mcp_agent.workflows.llm.multipart_converter_openai` - - - - - -### Provider-Specific AugmentedLLM Implementations - -Concrete implementations of the AugmentedLLM abstract class for specific LLM providers (e.g., Anthropic, OpenAI, Google, Azure, Bedrock, Ollama). These classes contain the actual logic for making API calls to their respective LLM services. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM` (110:722) - -- `mcp_agent.workflows.llm.augmented_llm_openai.OpenAIAugmentedLLM` (80:845) - - - - - -### Provider-Specific EmbeddingModel Implementations - -Concrete implementations of the EmbeddingModel abstract class for specific embedding providers (e.g., Cohere, OpenAI). They handle the actual API calls to generate embeddings. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel` (18:72) - -- `mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel` (18:70) - - - - - -### Agent - -Represents the core intelligent entity within the framework, responsible for understanding tasks, making decisions, and executing actions, often by interacting with LLMs and external tools. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.agents.agent.Agent` (56:931) - - - - - -### Orchestrator - -Manages and coordinates complex, multi-step workflows, often involving multiple LLM calls, tool uses, and interactions between different agents. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` (45:585) - - - - - -### Router - -Intelligently directs incoming requests or internal queries to the most appropriate LLM or embedding model/service based on context, intent, or other routing criteria. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.router.router_llm.LLMRouter` (81:373) - -- `mcp_agent.workflows.router.router_embedding.EmbeddingRouter` (28:239) - - - - - -### IntentClassifier - -Determines the underlying intent of a user query or system state, leveraging either LLMs or embedding models for classification. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier` (63:243) - -- `mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier` (32:177) - - - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/MCP_API_Gateway.md b/.codeboarding/MCP_API_Gateway.md deleted file mode 100644 index 2434eb495..000000000 --- a/.codeboarding/MCP_API_Gateway.md +++ /dev/null @@ -1,145 +0,0 @@ -```mermaid - -graph LR - - MCPAggregator["MCPAggregator"] - - ServerRegistry["ServerRegistry"] - - ServerContext["ServerContext"] - - MCPConnectionManager["MCPConnectionManager"] - - MCPServerSettings["MCPServerSettings"] - - MCPAggregator -- "uses" --> MCPConnectionManager - - MCPAggregator -- "exposes capabilities to" --> Agent - - MCPAggregator -- "exposes capabilities to" --> Orchestrator - - ServerRegistry -- "initializes" --> MCPConnectionManager - - ServerContext -- "uses" --> ServerRegistry - - ServerContext -- "depends on" --> ServerRegistry - - ServerContext -- "manages" --> active_agents - - ServerContext -- "registers" --> workflows - - MCPConnectionManager -- "uses" --> MCPServerSettings - - ServerRegistry -- "loads" --> MCPServerSettings - -``` - - - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - - -Final Component Overview for `MCP & API Gateway`. This component serves as the primary interface for external communication, exposing agent capabilities and workflows via the Model Context Protocol (MCP) and managing connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. These five components are fundamental to the `MCP & API Gateway` subsystem because they collectively manage the entire lifecycle of external communication and capability exposure, aligning with the project's 'AI Agent Framework/Orchestration Platform' nature: `MCPServerSettings` provides the essential configuration for defining how MCP servers are accessed and behave. It's the blueprint for connectivity. `ServerRegistry` acts as the central directory and initializer for all MCP servers. It's crucial for discovering and bringing online the various services that agents can interact with. `MCPConnectionManager` manages the actual network connections, ensuring reliable communication with both local and remote MCP services. It's the operational backbone for data exchange. `MCPAggregator` embodies the 'API Gateway' pattern. It consolidates capabilities from disparate MCP servers into a single, unified interface for agents, abstracting away connection complexities. This is vital for enabling seamless 'Multi-Agent Coordination Mechanisms' and 'Tool Use Frameworks.' `ServerContext` provides the runtime environment for the MCP application server, integrating the FastAPI application, agent management, and workflow registration. It ensures that the exposed capabilities are functional and accessible, supporting the 'Asynchronous Execution Engine' and 'Workflow Patterns.' Together, these components enable the project to effectively expose agent capabilities, manage external MCP server connections, and provide the necessary server-side infrastructure for remote access and interaction, which are critical for an AI Agent Framework/Orchestration Platform. - - - -### MCPAggregator - -The MCPAggregator is a core component responsible for discovering and consolidating capabilities (tools, prompts, and resources) from multiple MCP servers. It acts as a central point for an agent to access and invoke functionalities provided by various remote or local MCP services. It manages persistent connections to servers and provides methods for listing, reading, and calling these aggregated capabilities. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/mcp/mcp_aggregator.py` (1:1) - - - - - -### ServerRegistry - -The ServerRegistry is responsible for managing the configuration and initialization of MCP servers. It loads server configurations from a YAML file, registers initialization hooks, and provides methods to start and initialize server processes based on their defined transport (stdio, streamable HTTP, SSE, websocket). It acts as a directory of available MCP servers. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/mcp/mcp_server_registry.py` (1:1) - - - - - -### ServerContext - -The ServerContext provides the operational context for the MCP application server. It holds references to the FastMCP instance (the FastAPI application for MCP), manages active agents, and initializes the appropriate workflow registry (either InMemoryWorkflowRegistry for asyncio or TemporalWorkflowRegistry for Temporal.io). It also facilitates the registration of workflows and the creation of workflow-specific tools. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/server/app_server.py` (1:1) - - - - - -### MCPConnectionManager - -The MCPConnectionManager is responsible for establishing, maintaining, and closing connections to various MCP servers. It handles the underlying communication protocols and ensures reliable data exchange between the MCPAggregator and the remote MCP services. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/mcp/mcp_connection_manager.py` (1:1) - - - - - -### MCPServerSettings - -MCPServerSettings defines the configuration parameters for individual MCP servers, including their transport type (e.g., stdio, http, websocket), host, port, and other connection-related details. It is a foundational data structure for setting up and connecting to MCP services. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent/config.py` (1:1) - - - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/on_boarding.md b/.codeboarding/on_boarding.md deleted file mode 100644 index f0524ea00..000000000 --- a/.codeboarding/on_boarding.md +++ /dev/null @@ -1,181 +0,0 @@ -```mermaid - -graph LR - - Core_Orchestration_Execution["Core Orchestration & Execution"] - - Agent_Workflow_Framework["Agent & Workflow Framework"] - - LLM_External_Tooling["LLM & External Tooling"] - - MCP_API_Gateway["MCP & API Gateway"] - - Intent_Interaction_Management["Intent & Interaction Management"] - - Core_Orchestration_Execution -- "Initializes/Configures" --> Agent_Workflow_Framework - - Core_Orchestration_Execution -- "Manages" --> Agent_Workflow_Framework - - Agent_Workflow_Framework -- "Uses" --> LLM_External_Tooling - - Agent_Workflow_Framework -- "Executes via" --> Core_Orchestration_Execution - - LLM_External_Tooling -- "Provides services to" --> Agent_Workflow_Framework - - LLM_External_Tooling -- "Provides services to" --> Intent_Interaction_Management - - MCP_API_Gateway -- "Exposes" --> Core_Orchestration_Execution - - MCP_API_Gateway -- "Sends requests to" --> Intent_Interaction_Management - - Intent_Interaction_Management -- "Routes requests to" --> Core_Orchestration_Execution - - Intent_Interaction_Management -- "Utilizes" --> LLM_External_Tooling - - click Core_Orchestration_Execution href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Core_Orchestration_Execution.md" "Details" - - click Agent_Workflow_Framework href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Agent_Workflow_Framework.md" "Details" - - click LLM_External_Tooling href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//LLM_External_Tooling.md" "Details" - - click MCP_API_Gateway href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//MCP_API_Gateway.md" "Details" - - click Intent_Interaction_Management href "https://github.com/lastmile-ai/mcp-agent/blob/main/.codeboarding//Intent_Interaction_Management.md" "Details" - -``` - - - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - - -The `mcp-agent` project is designed as a robust AI Agent Framework and Orchestration Platform, emphasizing modularity, extensibility, and asynchronous execution. The architecture is centered around a few key components that manage the lifecycle, execution, and interaction of AI agents and their workflows. - - - -### Core Orchestration & Execution [[Expand]](./Core_Orchestration_Execution.md) - -This component is the central nervous system of the application. It handles the overall application lifecycle, loads global configurations, and manages the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.app.MCPApp` (34:508) - -- `mcp_agent.config.Settings` (1:1) - -- `mcp_agent.executor.executor.Executor` (52:239) - -- `mcp_agent.executor.workflow.Workflow` (71:528) - - - - - -### Agent & Workflow Framework [[Expand]](./Agent_Workflow_Framework.md) - -This component defines the foundational interfaces and common behaviors for all AI agents. It implements reusable multi-agent workflow patterns (e.g., orchestration, parallel execution, swarm intelligence, evaluation), providing structured approaches for complex agentic behaviors. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.agents.agent.Agent` (56:931) - -- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` (45:585) - -- `mcp_agent.workflows.parallel.parallel_llm.ParallelLLM` (23:279) - -- `mcp_agent.workflows.swarm.swarm.Swarm` (189:310) - - - - - -### LLM & External Tooling [[Expand]](./LLM_External_Tooling.md) - -This component provides a unified and abstracted interface for interacting with various Large Language Model (LLM) and embedding providers. It handles model selection, request parameterization, and content conversion. Additionally, it offers a flexible framework for defining and integrating external tools that agents can leverage. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) - -- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) - -- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` (13:31) - -- `mcp_agent.utils.pydantic_type_serializer` (1:1) - - - - - -### MCP & API Gateway [[Expand]](./MCP_API_Gateway.md) - -This component serves as the primary interface for external communication. It exposes agent capabilities and workflows via the Model Context Protocol (MCP) and manages connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` (77:1357) - -- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` (1:1) - -- `mcp_agent.server.app_server.ServerContext` (1:1) - - - - - -### Intent & Interaction Management [[Expand]](./Intent_Interaction_Management.md) - -This component is responsible for understanding user intent and directing incoming requests or messages to the appropriate agent or workflow. It supports both LLM-based and embedding-based classification methods and manages direct human interaction, including console input and elicitation. - - - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.router.router_base.Router` (63:275) - -- `mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier` (42:85) - -- `mcp_agent.human_input.handler` (1:1) - - - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Agent_Workflow_Framework.md b/docs/codeboarding/agent-workflow-framework.mdx similarity index 62% rename from .codeboarding/Agent_Workflow_Framework.md rename to docs/codeboarding/agent-workflow-framework.mdx index c208adb31..939e658ea 100644 --- a/.codeboarding/Agent_Workflow_Framework.md +++ b/docs/codeboarding/agent-workflow-framework.mdx @@ -1,293 +1,194 @@ -```mermaid +--- +title: "Agent & Workflow Framework" +description: "Core agent architecture and workflow patterns for multi-agent systems" +--- +```mermaid graph LR - Agent["Agent"] - AugmentedLLM["AugmentedLLM"] - Orchestrator["Orchestrator"] - ParallelLLM["ParallelLLM"] - Swarm["Swarm"] - Router["Router"] - IntentClassifier["IntentClassifier"] - Executor["Executor"] - MCPConnectionManager["MCPConnectionManager"] - ContextDependent["ContextDependent"] Agent -- "Uses" --> AugmentedLLM - Agent -- "Delegates to" --> Executor - AugmentedLLM -- "Used by" --> Agent - AugmentedLLM -- "Used by" --> Orchestrator - AugmentedLLM -- "Used by" --> ParallelLLM - AugmentedLLM -- "Used by" --> Swarm - AugmentedLLM -- "Used by" --> Router - AugmentedLLM -- "Used by" --> IntentClassifier - Orchestrator -- "Coordinates" --> Agent - Orchestrator -- "Uses" --> AugmentedLLM - ParallelLLM -- "Coordinates" --> Agent - ParallelLLM -- "Uses" --> AugmentedLLM - Swarm -- "Coordinates" --> Agent - Swarm -- "Uses" --> AugmentedLLM - Router -- "Directs tasks to" --> Agent - Router -- "Relies on" --> IntentClassifier - IntentClassifier -- "Used by" --> Router - IntentClassifier -- "Uses" --> AugmentedLLM - Executor -- "Executes tasks for" --> Agent - Executor -- "Manages" --> Orchestrator - Executor -- "Manages" --> ParallelLLM - Executor -- "Manages" --> Swarm - MCPConnectionManager -- "Facilitates communication for" --> Agent - MCPConnectionManager -- "Integrates with" --> Orchestrator - MCPConnectionManager -- "Integrates with" --> Router - ContextDependent -- "Provides context to" --> Agent - ContextDependent -- "Provides context to" --> Orchestrator - ContextDependent -- "Provides context to" --> ParallelLLM - ContextDependent -- "Provides context to" --> Swarm - ContextDependent -- "Provides context to" --> Router - ContextDependent -- "Provides context to" --> IntentClassifier - ContextDependent -- "Provides context to" --> Executor - ContextDependent -- "Provides context to" --> AugmentedLLM - ContextDependent -- "Provides context to" --> MCPConnectionManager - ``` + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the agent and workflow framework. + - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - +## Overview The "Agent & Workflow Framework" component is the backbone of the project, defining how AI agents are structured, how they interact, and how complex multi-agent behaviors are orchestrated. It provides the foundational abstractions and patterns necessary for building sophisticated AI systems. - +## Core Components ### Agent The fundamental building block of the AI system. It encapsulates an agent's core logic, capabilities, and interaction patterns, serving as the primary autonomous entity capable of performing tasks. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/agents/agent.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.agents.agent` (1:1) - - - - +**Key Features:** +- Autonomous task execution +- Core agent logic encapsulation +- Interaction pattern management +- Capability abstraction ### AugmentedLLM Provides a standardized and enhanced interface for interacting with various Large Language Models (LLMs) from different providers. It abstracts away provider-specific details and adds functionalities like prompt augmentation, token management, and structured output, making it the central LLM integration point for all agents and workflows. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.llm.augmented_llm` (1:1) - - - - +**Key Features:** +- Multi-provider LLM abstraction +- Prompt augmentation +- Token management +- Structured output handling +- Provider-agnostic interface ### Orchestrator A high-level workflow component responsible for coordinating multiple agents, tools, or sub-workflows to achieve complex, multi-step goals. It defines the overall flow and decision-making logic for sequential or conditional processes. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/orchestrator/orchestrator.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.orchestrator.orchestrator` (1:1) - - - - +**Key Features:** +- Multi-agent coordination +- Sequential workflow management +- Decision-making logic +- Complex goal decomposition ### ParallelLLM Implements a workflow pattern designed for executing multiple LLM calls or agent tasks concurrently. It efficiently manages parallel interactions, distributing tasks (fan-out) and collecting results (fan-in) for improved throughput in multi-task scenarios. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/parallel/parallel_llm.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.parallel.parallel_llm` (1:1) - - - - +**Key Features:** +- Concurrent task execution +- Fan-out/fan-in patterns +- Improved throughput +- Parallel LLM interactions ### Swarm Implements a multi-agent workflow pattern where a group of agents collaborates to solve a problem, often exhibiting emergent intelligence through collective action and iterative refinement. It facilitates communication and coordination among a group of agents. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/swarm/swarm.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.swarm.swarm` (1:1) - - - - +**Key Features:** +- Multi-agent collaboration +- Emergent intelligence +- Collective problem-solving +- Iterative refinement ### Router A workflow component that intelligently directs incoming requests or tasks to the most appropriate agent, server, or sub-workflow. It makes dynamic routing decisions based on predefined rules or analysis of the request content. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_base.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.router.router_base` (1:1) - - - - +**Key Features:** +- Intelligent request routing +- Dynamic decision making +- Rule-based routing +- Content analysis ### IntentClassifier A workflow component designed to classify user input or system states into predefined intents. This is crucial for understanding the user's goal and enabling other workflow components (like the Router) to make informed decisions about subsequent actions. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.workflows.intent_classifier.intent_classifier_base` (1:1) - - - - +**Key Features:** +- Intent classification +- User goal understanding +- Predefined intent mapping +- Decision support ### Executor Manages and executes workflows and tasks, providing mechanisms for reliable execution, potentially integrating with durable execution systems. It ensures that complex, long-running agent processes can be reliably executed, paused, resumed, and monitored. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/executor.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.executor.executor` (1:1) - - - - +**Key Features:** +- Workflow execution management +- Reliable task execution +- Durable execution support +- Process monitoring ### MCPConnectionManager Manages connections and interactions related to the Model Context Protocol (MCP). This component is crucial for enabling communication and data exchange between different parts of the agent system or with external MCP-compliant services, facilitating multi-agent collaboration. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_connection_manager.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.mcp.mcp_connection_manager` (1:1) - - - - +**Key Features:** +- MCP connection management +- Inter-agent communication +- Data exchange facilitation +- External service integration ### ContextDependent A foundational abstract base class or pattern that provides a mechanism for components to depend on and interact with a shared `Context` object. It ensures that various parts of the agent system can access common resources, configurations, and state, promoting a consistent and manageable environment. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/core/context.py) - - - -**Related Classes/Methods**: - - - -- `mcp_agent.core.context` (1:1) - - - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file +**Key Features:** +- Shared context management +- Resource access control +- Configuration consistency +- State management diff --git a/.codeboarding/Core_Orchestration_Execution.md b/docs/codeboarding/core-orchestration-execution.mdx similarity index 69% rename from .codeboarding/Core_Orchestration_Execution.md rename to docs/codeboarding/core-orchestration-execution.mdx index c6d485fcb..575b09774 100644 --- a/.codeboarding/Core_Orchestration_Execution.md +++ b/docs/codeboarding/core-orchestration-execution.mdx @@ -1,255 +1,145 @@ -```mermaid +--- +title: "Core Orchestration & Execution" +description: "Central orchestration and execution engine for the mcp-agent framework" +--- +```mermaid graph LR - MCPApp["MCPApp"] - Settings["Settings"] - Executor["Executor"] - AsyncioExecutor["AsyncioExecutor"] - TemporalExecutor["TemporalExecutor"] - Workflow["Workflow"] - WorkflowRegistry["WorkflowRegistry"] - BaseSignalHandler["BaseSignalHandler"] - TemporalExecutorConfig["TemporalExecutorConfig"] - InteractiveWorkflow["InteractiveWorkflow"] MCPApp -- "initializes and depends on" --> Settings - MCPApp -- "orchestrates and utilizes" --> Executor - MCPApp -- "manages and queries" --> WorkflowRegistry - Settings -- "provides configuration to" --> MCPApp - Settings -- "provides configuration to" --> TemporalExecutorConfig - Executor -- "executes" --> Workflow - AsyncioExecutor -- "implements" --> Executor - TemporalExecutor -- "implements" --> Executor - AsyncioExecutor -- "executes" --> Workflow - TemporalExecutor -- "utilizes" --> TemporalExecutorConfig - Workflow -- "interacts with" --> BaseSignalHandler - WorkflowRegistry -- "stores and provides access to" --> Workflow - TemporalExecutorConfig -- "configures" --> TemporalExecutor - TemporalExecutorConfig -- "depends on" --> Settings - InteractiveWorkflow -- "extends" --> Workflow - ``` + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the core orchestration and execution layer. + - -[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) - - - -## Details - - +## Overview The Core Orchestration & Execution component is the central nervous system of the mcp-agent application, responsible for managing the overall application lifecycle, loading global configurations, and orchestrating the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management and enabling sophisticated agentic behaviors. - +## Key Components ### MCPApp The primary application orchestrator and entry point. It is responsible for bootstrapping the application, loading global configurations (Settings), and coordinating the various sub-systems. It manages the lifecycle of the application and delegates the execution of workflows to appropriate executors. - - - - -**Related Classes/Methods**: - - - -- `MCPApp` (1:1) - - - - +**Key Features:** +- Application lifecycle management +- Global configuration loading +- Sub-system coordination +- Workflow execution delegation ### Settings This component is responsible for managing and providing access to global application configurations. It loads settings from various sources, making them available to other components that require specific parameters for their operation (e.g., executor configurations, external service credentials). - - - - -**Related Classes/Methods**: - - - -- `Settings` (1:1) - - - - +**Key Features:** +- Configuration management +- Multi-source settings loading +- Parameter distribution +- Environment-specific configurations ### Executor This is the abstract interface for executing workflows and tasks within the mcp-agent framework. It defines the contract for how executable units are run, allowing for different concrete implementations to handle various execution environments, such as in-process asynchronous execution or durable execution via Temporal.io. - - - - -**Related Classes/Methods**: - - - -- `Executor` (52:239) - - - - +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/executor.py#L52-L239) ### AsyncioExecutor A concrete implementation of the Executor interface that handles asynchronous, in-process execution of workflows. It leverages Python's asyncio capabilities for concurrent task management, suitable for short-lived or non-durable workflows. - - - - -**Related Classes/Methods**: - - - -- `AsyncioExecutor` (1:1) - - - - +**Key Features:** +- Asynchronous execution +- In-process task management +- Concurrent workflow handling +- Suitable for short-lived workflows ### TemporalExecutor A concrete implementation of the Executor interface that provides durable and fault-tolerant workflow execution using the Temporal.io platform. It ensures workflow state persistence, retries, and recovery, critical for long-running or mission-critical agentic processes. - - - - -**Related Classes/Methods**: - - - -- `TemporalExecutor` (1:1) - - - - +**Key Features:** +- Durable execution +- Fault tolerance +- State persistence +- Automatic retries and recovery +- Long-running workflow support ### Workflow This serves as the foundational abstraction for defining executable units of work or complex agentic processes. It encapsulates the logic, state, and potential interactions of a workflow, which is then managed and executed by an Executor. - - - - -**Related Classes/Methods**: - - - -- `Workflow` (71:528) - - - - +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/workflow.py#L71-L528) ### WorkflowRegistry This component is responsible for managing the registration and retrieval of workflow definitions. It acts as a central catalog, making workflows discoverable and available for execution by the system, supporting both in-memory and Temporal-backed storage. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/workflow_registry.py#L19-L146) - - - -**Related Classes/Methods**: - - - -- `WorkflowRegistry` (19:146) - - - - +**Key Features:** +- Workflow registration +- Central catalog management +- Discovery and retrieval +- Multiple storage backends ### BaseSignalHandler This component provides the abstract mechanism for handling signals within workflows. Signals are crucial for inter-workflow communication, managing workflow state, and enabling external interactions, which are vital for robust and responsive execution in asynchronous and durable environments. - - - - -**Related Classes/Methods**: - - - -- `BaseSignalHandler` (1:1) - - - - +**Key Features:** +- Signal handling abstraction +- Inter-workflow communication +- State management +- External interaction support ### TemporalExecutorConfig Defines the specific configuration parameters required for the TemporalExecutor to operate. This includes connection details for the Temporal server and other execution-specific settings, ensuring proper integration with the durable execution backend. - - - - -**Related Classes/Methods**: - - - -- `TemporalExecutorConfig` (1:1) - - - - +**Key Features:** +- Temporal server configuration +- Connection management +- Execution-specific settings +- Backend integration ### InteractiveWorkflow A specialized type of Workflow designed to handle human interaction. This component is crucial for agentic systems that require user input or approval at various stages of a workflow, enabling human-in-the-loop processes and complex decision flows. +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/temporal/interactive_workflow.py#L20-L83) - - - -**Related Classes/Methods**: - - - -- `InteractiveWorkflow` (20:83) - - - - - - - - - -### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file +**Key Features:** +- Human interaction support +- User input handling +- Approval workflows +- Human-in-the-loop processes diff --git a/docs/codeboarding/intent-interaction-management.mdx b/docs/codeboarding/intent-interaction-management.mdx new file mode 100644 index 000000000..2c8f194f0 --- /dev/null +++ b/docs/codeboarding/intent-interaction-management.mdx @@ -0,0 +1,138 @@ +--- +title: "Intent & Interaction Management" +description: "User intent classification and interaction management for intelligent request routing" +--- + +```mermaid +graph LR + Human_Input_Handler["Human Input Handler"] + Intent_Classifier["Intent Classifier"] + Router["Router"] + Augmented_LLM["Augmented LLM"] + Embedding_Model["Embedding Model"] + Agent["Agent"] + + Human_Input_Handler -- "provides input to" --> Intent_Classifier + Intent_Classifier -- "depends on" --> Augmented_LLM + Intent_Classifier -- "depends on" --> Embedding_Model + Router -- "relies on" --> Intent_Classifier + Router -- "directs to" --> Agent + Augmented_LLM -- "is used by" --> Intent_Classifier + Augmented_LLM -- "is used by" --> Router + Embedding_Model -- "is used by" --> Intent_Classifier + Embedding_Model -- "is used by" --> Router +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the intent and interaction management layer. + + +## Overview + +This component is central to how the AI agent framework understands user needs and directs the flow of execution. It encompasses the mechanisms for receiving user input, interpreting their underlying intent, and subsequently routing the request to the most appropriate agent or workflow. This design allows for flexible and intelligent handling of diverse user interactions, leveraging both advanced language models and efficient embedding techniques. + +## Core Components + +### Human Input Handler + +This component serves as the primary interface for direct human interaction with the agent system. It is responsible for capturing and processing console input, including user commands (e.g., slash commands) and queries. It also facilitates elicitation, allowing the agent to prompt the user for necessary information. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/human_input/handler.py) + +**Key Features:** +- Console input capture +- User command processing +- Slash command support +- Interactive elicitation +- Human-in-the-loop interaction + +### Intent Classifier + +This abstract base component defines the contract for classifying incoming user input or system states into predefined intents. It is crucial for understanding the user's underlying goal or purpose, which is a prerequisite for effective decision-making within the agent system. The framework supports both LLM-based and embedding-based concrete implementations. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py) + +**Key Features:** +- Intent classification abstraction +- User goal understanding +- Predefined intent mapping +- LLM-based classification support +- Embedding-based classification support +- System state interpretation + +### Router + +This abstract base component serves as a central dispatch mechanism within the agent's workflow. Its primary responsibility is to intelligently direct incoming requests or tasks to the most appropriate agent, server, or specific function based on the classified intent and other contextual information. It enables dynamic and flexible routing within the multi-agent orchestration platform. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_base.py) + +**Key Features:** +- Central dispatch mechanism +- Intelligent request routing +- Context-aware decision making +- Dynamic routing capabilities +- Multi-agent orchestration +- Flexible routing strategies + +### Augmented LLM + +This component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., OpenAI, Anthropic, Google GenAI). It abstracts away the complexities of raw LLM APIs, offering functionalities like prompt engineering, token management, and structured output parsing, which are crucial for robust LLM-based intent classification and routing. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py) + +**Key Features:** +- Multi-provider LLM support +- Prompt engineering capabilities +- Token management +- Structured output parsing +- API abstraction +- Intent classification support + +### Embedding Model + +This component provides a standardized interface for generating numerical vector representations (embeddings) of text. These embeddings are fundamental for performing semantic similarity searches and classification tasks, which are utilized in embedding-based intent classification and routing. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_base.py) + +**Key Features:** +- Text embedding generation +- Semantic similarity analysis +- Vector representation +- Classification support +- Standardized interface +- Similarity search capabilities + +### Agent + +A generic agent or workflow that the Router directs requests to. This represents the destination for classified and routed requests within the system. + +**Key Features:** +- Request execution +- Task processing +- Workflow integration +- Agent capabilities + +## Workflow Integration + +The Intent & Interaction Management component integrates seamlessly with the overall agent workflow: + +1. **Input Capture**: The Human Input Handler captures user input from various sources +2. **Intent Analysis**: The Intent Classifier analyzes the input to determine user intent +3. **Routing Decision**: The Router uses the classified intent to make routing decisions +4. **Agent Execution**: The appropriate agent or workflow is selected and executed +5. **Response Delivery**: Results are returned to the user through the appropriate channels + +## Classification Methods + +The framework supports multiple classification approaches: + +- **LLM-based Classification**: Uses large language models for sophisticated intent understanding +- **Embedding-based Classification**: Uses semantic similarity through embeddings for efficient classification +- **Hybrid Approaches**: Combines both methods for optimal performance + +This flexibility allows the system to adapt to different use cases and performance requirements. diff --git a/docs/codeboarding/llm-external-tooling.mdx b/docs/codeboarding/llm-external-tooling.mdx new file mode 100644 index 000000000..130d50bfd --- /dev/null +++ b/docs/codeboarding/llm-external-tooling.mdx @@ -0,0 +1,154 @@ +--- +title: "LLM & External Tooling" +description: "Unified interface for Large Language Models and external tool integration" +--- + +```mermaid +graph LR + AugmentedLLM["AugmentedLLM"] + EmbeddingModel["EmbeddingModel"] + ModelSelector["ModelSelector"] + Multipart_Converters["Multipart Converters"] + Provider_Specific_AugmentedLLM_Implementations["Provider-Specific AugmentedLLM Implementations"] + Provider_Specific_EmbeddingModel_Implementations["Provider-Specific EmbeddingModel Implementations"] + Agent["Agent"] + Orchestrator["Orchestrator"] + Router["Router"] + IntentClassifier["IntentClassifier"] + + Agent -- "depends on" --> AugmentedLLM + Orchestrator -- "coordinates" --> AugmentedLLM + AugmentedLLM -- "utilizes" --> ModelSelector + AugmentedLLM -- "integrates with" --> Multipart_Converters + AugmentedLLM -- "is implemented by" --> Provider_Specific_AugmentedLLM_Implementations + EmbeddingModel -- "is implemented by" --> Provider_Specific_EmbeddingModel_Implementations + Router -- "relies on" --> AugmentedLLM + Router -- "relies on" --> EmbeddingModel + IntentClassifier -- "uses" --> AugmentedLLM + IntentClassifier -- "uses" --> EmbeddingModel +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the LLM and external tooling layer. + + +## Overview + +The LLM & External Tooling component is central to the mcp_agent project, providing the foundational capabilities for interacting with various Large Language Models (LLMs) and embedding services. It embodies the project's architectural bias towards abstraction, extensibility, and modularity, allowing the framework to seamlessly integrate with diverse AI providers and leverage their unique strengths. + +## Core Components + +### AugmentedLLM + +This is the core abstract interface for all Large Language Model (LLM) interactions. It defines a unified API for sending requests and receiving responses from various LLM providers, abstracting away provider-specific details. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py#L218-L668) + +**Key Features:** +- Unified LLM API +- Provider abstraction +- Request/response handling +- Cross-provider compatibility + +### EmbeddingModel + +An abstract interface for generating numerical embeddings from text. It provides a consistent way to interact with different embedding service providers. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_base.py#L13-L31) + +**Key Features:** +- Text embedding generation +- Provider-agnostic interface +- Consistent API across providers +- Numerical representation of text + +### ModelSelector + +Responsible for dynamically selecting the most appropriate LLM model based on predefined criteria such as cost, latency, or specific model capabilities. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/llm_selector.py#L96-L413) + +**Key Features:** +- Dynamic model selection +- Cost optimization +- Latency optimization +- Capability-based selection +- Multi-criteria decision making + +### Multipart Converters + +These modules handle the conversion of diverse content types (e.g., text, images, tool calls) between the internal Model Context Protocol (MCP) format and the specific input/output formats required by different LLM providers. + +**Implementation Details:** +- [Anthropic Converter](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/multipart_converter_anthropic.py) +- [OpenAI Converter](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/multipart_converter_openai.py) + +**Key Features:** +- Content type conversion +- MCP format standardization +- Provider-specific formatting +- Multi-modal content handling + +### Provider-Specific AugmentedLLM Implementations + +Concrete implementations of the AugmentedLLM abstract class for specific LLM providers (e.g., Anthropic, OpenAI, Google, Azure, Bedrock, Ollama). These classes contain the actual logic for making API calls to their respective LLM services. + +**Implementation Details:** +- [Anthropic Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py#L110-L722) +- [OpenAI Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm_openai.py#L80-L845) + +**Key Features:** +- Provider-specific API integration +- Authentication handling +- Request formatting +- Response parsing +- Error handling + +### Provider-Specific EmbeddingModel Implementations + +Concrete implementations of the EmbeddingModel abstract class for specific embedding providers (e.g., Cohere, OpenAI). They handle the actual API calls to generate embeddings. + +**Implementation Details:** +- [Cohere Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_cohere.py#L18-L72) +- [OpenAI Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_openai.py#L18-L70) + +**Key Features:** +- Provider-specific embedding APIs +- Vector generation +- Batch processing +- Dimension handling + +## Integration Components + +### Agent + +Represents the core intelligent entity within the framework, responsible for understanding tasks, making decisions, and executing actions, often by interacting with LLMs and external tools. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/agents/agent.py#L56-L931) + +### Orchestrator + +Manages and coordinates complex, multi-step workflows, often involving multiple LLM calls, tool uses, and interactions between different agents. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/orchestrator/orchestrator.py#L45-L585) + +### Router + +Intelligently directs incoming requests or internal queries to the most appropriate LLM or embedding model/service based on context, intent, or other routing criteria. + +**Implementation Details:** +- [LLM Router](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_llm.py#L81-L373) +- [Embedding Router](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_embedding.py#L28-L239) + +### IntentClassifier + +Determines the underlying intent of a user query or system state, leveraging either LLMs or embedding models for classification. + +**Implementation Details:** +- [LLM Intent Classifier](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py#L63-L243) +- [Embedding Intent Classifier](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py#L32-L177) diff --git a/docs/codeboarding/mcp-api-gateway.mdx b/docs/codeboarding/mcp-api-gateway.mdx new file mode 100644 index 000000000..b55fa7b1d --- /dev/null +++ b/docs/codeboarding/mcp-api-gateway.mdx @@ -0,0 +1,123 @@ +--- +title: "MCP & API Gateway" +description: "Model Context Protocol gateway and server infrastructure for external communication" +--- + +```mermaid +graph LR + MCPAggregator["MCPAggregator"] + ServerRegistry["ServerRegistry"] + ServerContext["ServerContext"] + MCPConnectionManager["MCPConnectionManager"] + MCPServerSettings["MCPServerSettings"] + Agent["Agent"] + Orchestrator["Orchestrator"] + active_agents["Active Agents"] + workflows["Workflows"] + + MCPAggregator -- "uses" --> MCPConnectionManager + MCPAggregator -- "exposes capabilities to" --> Agent + MCPAggregator -- "exposes capabilities to" --> Orchestrator + ServerRegistry -- "initializes" --> MCPConnectionManager + ServerContext -- "uses" --> ServerRegistry + ServerContext -- "depends on" --> ServerRegistry + ServerContext -- "manages" --> active_agents + ServerContext -- "registers" --> workflows + MCPConnectionManager -- "uses" --> MCPServerSettings + ServerRegistry -- "loads" --> MCPServerSettings +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the MCP API Gateway infrastructure. + + +## Overview + +The MCP & API Gateway component serves as the primary interface for external communication, exposing agent capabilities and workflows via the Model Context Protocol (MCP) and managing connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. + +This component is fundamental to the MCP & API Gateway subsystem because it collectively manages the entire lifecycle of external communication and capability exposure, aligning with the project's 'AI Agent Framework/Orchestration Platform' nature. + +## Core Components + +### MCPAggregator + +The MCPAggregator is a core component responsible for discovering and consolidating capabilities (tools, prompts, and resources) from multiple MCP servers. It acts as a central point for an agent to access and invoke functionalities provided by various remote or local MCP services. It manages persistent connections to servers and provides methods for listing, reading, and calling these aggregated capabilities. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_aggregator.py) + +**Key Features:** +- Capability aggregation from multiple MCP servers +- Persistent connection management +- Unified interface for tools, prompts, and resources +- Central access point for agent capabilities + +### ServerRegistry + +The ServerRegistry is responsible for managing the configuration and initialization of MCP servers. It loads server configurations from a YAML file, registers initialization hooks, and provides methods to start and initialize server processes based on their defined transport (stdio, streamable HTTP, SSE, websocket). It acts as a directory of available MCP servers. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_server_registry.py) + +**Key Features:** +- Server configuration management +- YAML-based configuration loading +- Transport protocol support (stdio, HTTP, SSE, WebSocket) +- Server initialization and lifecycle management +- Directory of available MCP servers + +### ServerContext + +The ServerContext provides the operational context for the MCP application server. It holds references to the FastMCP instance (the FastAPI application for MCP), manages active agents, and initializes the appropriate workflow registry (either InMemoryWorkflowRegistry for asyncio or TemporalWorkflowRegistry for Temporal.io). It also facilitates the registration of workflows and the creation of workflow-specific tools. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/server/app_server.py) + +**Key Features:** +- FastMCP/FastAPI application management +- Active agent management +- Workflow registry initialization +- Workflow registration and tool creation +- Operational context for MCP server + +### MCPConnectionManager + +The MCPConnectionManager is responsible for establishing, maintaining, and closing connections to various MCP servers. It handles the underlying communication protocols and ensures reliable data exchange between the MCPAggregator and the remote MCP services. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_connection_manager.py) + +**Key Features:** +- Connection establishment and management +- Protocol handling for multiple transports +- Reliable data exchange +- Connection lifecycle management +- Error handling and recovery + +### MCPServerSettings + +MCPServerSettings defines the configuration parameters for individual MCP servers, including their transport type (e.g., stdio, http, websocket), host, port, and other connection-related details. It is a foundational data structure for setting up and connecting to MCP services. + +**Implementation Details:** +- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/config.py) + +**Key Features:** +- Server configuration parameters +- Transport type specification +- Connection details (host, port, etc.) +- Foundational configuration structure +- Service setup and connection management + +## Architecture Benefits + +The MCP & API Gateway architecture provides several key benefits: + +1. **Unified Interface**: The MCPAggregator consolidates capabilities from disparate MCP servers into a single, unified interface for agents, abstracting away connection complexities. + +2. **Multi-Transport Support**: The ServerRegistry supports multiple transport protocols (stdio, HTTP, SSE, WebSocket), enabling flexible deployment and integration scenarios. + +3. **Scalable Architecture**: The separation of concerns between configuration (MCPServerSettings), registry (ServerRegistry), connection management (MCPConnectionManager), and aggregation (MCPAggregator) enables scalable and maintainable architecture. + +4. **Runtime Flexibility**: The ServerContext provides runtime environment management, supporting both asyncio and Temporal.io execution models. + +5. **External Integration**: The component enables seamless integration with external MCP-compliant services, supporting the 'Multi-Agent Coordination Mechanisms' and 'Tool Use Frameworks' aspects of the platform. diff --git a/docs/codeboarding/overview.mdx b/docs/codeboarding/overview.mdx new file mode 100644 index 000000000..0c5dbc41f --- /dev/null +++ b/docs/codeboarding/overview.mdx @@ -0,0 +1,82 @@ +--- +title: "Architecture Overview" +description: "Comprehensive architectural overview of the mcp-agent framework" +--- + +```mermaid +graph LR + Core_Orchestration_Execution["Core Orchestration & Execution"] + Agent_Workflow_Framework["Agent & Workflow Framework"] + LLM_External_Tooling["LLM & External Tooling"] + MCP_API_Gateway["MCP & API Gateway"] + Intent_Interaction_Management["Intent & Interaction Management"] + + Core_Orchestration_Execution -- "Initializes/Configures" --> Agent_Workflow_Framework + Core_Orchestration_Execution -- "Manages" --> Agent_Workflow_Framework + Agent_Workflow_Framework -- "Uses" --> LLM_External_Tooling + Agent_Workflow_Framework -- "Executes via" --> Core_Orchestration_Execution + LLM_External_Tooling -- "Provides services to" --> Agent_Workflow_Framework + LLM_External_Tooling -- "Provides services to" --> Intent_Interaction_Management + MCP_API_Gateway -- "Exposes" --> Core_Orchestration_Execution + MCP_API_Gateway -- "Sends requests to" --> Intent_Interaction_Management + Intent_Interaction_Management -- "Routes requests to" --> Core_Orchestration_Execution + Intent_Interaction_Management -- "Utilizes" --> LLM_External_Tooling + + click Core_Orchestration_Execution href "/codeboarding/core-orchestration-execution" "Details" + click Agent_Workflow_Framework href "/codeboarding/agent-workflow-framework" "Details" + click LLM_External_Tooling href "/codeboarding/llm-external-tooling" "Details" + click MCP_API_Gateway href "/codeboarding/mcp-api-gateway" "Details" + click Intent_Interaction_Management href "/codeboarding/intent-interaction-management" "Details" +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Architecture Overview + +The `mcp-agent` project is designed as a robust AI Agent Framework and Orchestration Platform, emphasizing modularity, extensibility, and asynchronous execution. The architecture is centered around five key components that manage the lifecycle, execution, and interaction of AI agents and their workflows. + +### Core Components + +#### [Core Orchestration & Execution](/codeboarding/core-orchestration-execution) +This component is the central nervous system of the application. It handles the overall application lifecycle, loads global configurations, and manages the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management. + +**Key Classes**: +- `mcp_agent.app.MCPApp` - Main application orchestrator +- `mcp_agent.config.Settings` - Configuration management +- `mcp_agent.executor.executor.Executor` - Task execution engine +- `mcp_agent.executor.workflow.Workflow` - Workflow management + +#### [Agent & Workflow Framework](/codeboarding/agent-workflow-framework) +This component defines the foundational interfaces and common behaviors for all AI agents. It implements reusable multi-agent workflow patterns (e.g., orchestration, parallel execution, swarm intelligence, evaluation), providing structured approaches for complex agentic behaviors. + +**Key Classes**: +- `mcp_agent.agents.agent.Agent` - Base agent implementation +- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` - Orchestration patterns +- `mcp_agent.workflows.parallel.parallel_llm.ParallelLLM` - Parallel execution +- `mcp_agent.workflows.swarm.swarm.Swarm` - Swarm intelligence + +#### [LLM & External Tooling](/codeboarding/llm-external-tooling) +This component provides a unified and abstracted interface for interacting with various Large Language Model (LLM) and embedding providers. It handles model selection, request parameterization, and content conversion. Additionally, it offers a flexible framework for defining and integrating external tools that agents can leverage. + +**Key Classes**: +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` - Enhanced LLM interface +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` - Model selection logic +- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` - Embedding models + +#### [MCP & API Gateway](/codeboarding/mcp-api-gateway) +This component serves as the primary interface for external communication. It exposes agent capabilities and workflows via the Model Context Protocol (MCP) and manages connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. + +**Key Classes**: +- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` - MCP server aggregation +- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` - Server registry +- `mcp_agent.server.app_server.ServerContext` - Server context management + +#### [Intent & Interaction Management](/codeboarding/intent-interaction-management) +This component is responsible for understanding user intent and directing incoming requests or messages to the appropriate agent or workflow. It supports both LLM-based and embedding-based classification methods and manages direct human interaction, including console input and elicitation. + +**Key Classes**: +- `mcp_agent.workflows.router.router_base.Router` - Request routing +- `mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier` - Intent classification +- `mcp_agent.human_input.handler` - Human input handling diff --git a/docs/docs.json b/docs/docs.json index f6b4af9f2..a20447e51 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -62,6 +62,17 @@ "pages": [ "advanced/temporal" ] + }, + { + "group": "Architecture", + "pages": [ + "codeboarding/overview", + "codeboarding/core-orchestration-execution", + "codeboarding/agent-workflow-framework", + "codeboarding/llm-external-tooling", + "codeboarding/mcp-api-gateway", + "codeboarding/intent-interaction-management" + ] } ] } From c71e1d7035c84e06dba317808b2d2b2488eec1f1 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Sun, 6 Jul 2025 03:27:46 +0200 Subject: [PATCH 3/9] Initial version of workflow integration --- .github/workflows/doc-updates.yml | 115 ++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/doc-updates.yml diff --git a/.github/workflows/doc-updates.yml b/.github/workflows/doc-updates.yml new file mode 100644 index 000000000..3294ad007 --- /dev/null +++ b/.github/workflows/doc-updates.yml @@ -0,0 +1,115 @@ +name: MCP Agent CodeBoarding Documentation Update + +on: + workflow_dispatch: + inputs: + repository_url: + description: 'Repository URL to test with' + required: false + default: 'https://github.com/lastmile-ai/mcp-agent' + type: string + source_branch: + description: 'Source branch for generation' + required: false + default: 'main' + type: string + target_branch: + description: 'Target branch for pull request' + required: false + default: 'main' + type: string + output_format: + description: 'Output format for documentation' + required: false + default: '.md' + type: choice + options: + - '.md' + - '.rst' + output_directory: + description: 'Output directory for documentation files' + required: false + default: 'docs/codeboarding' + type: string + +jobs: + update-docs-action-usage: + runs-on: ubuntu-latest + timeout-minutes: 45 + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # Required to access branch history + + # Determine branches based on context + - name: Set branch variables + id: set-branches + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "source_branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT + echo "target_branch=${{ github.base_ref }}" >> $GITHUB_OUTPUT + elif [ "${{ github.event.inputs.source_branch }}" != "" ] && [ "${{ github.event.inputs.target_branch }}" != "" ]; then + echo "source_branch=${{ github.event.inputs.source_branch }}" >> $GITHUB_OUTPUT + echo "target_branch=${{ github.event.inputs.target_branch }}" >> $GITHUB_OUTPUT + else + echo "source_branch=main" >> $GITHUB_OUTPUT + echo "target_branch=main" >> $GITHUB_OUTPUT + fi + + - name: Fetch CodeBoarding Documentation + timeout-minutes: 30 + id: codeboarding + uses: CodeBoarding/CodeBoarding-GHAction@v0.1.0 + with: + repository_url: ${{ github.event.inputs.repository_url }} + source_branch: ${{ steps.set-branches.outputs.source_branch }} + target_branch: ${{ steps.set-branches.outputs.target_branch }} + output_directory: ${{ github.event.inputs.output_directory || '.codeboarding' }} + output_format: ${{ github.event.inputs.output_format || '.md' }} + + - name: Display Action Results + run: | + echo "Documentation files created: ${{ steps.codeboarding.outputs.markdown_files_created }}" + echo "JSON files created: ${{ steps.codeboarding.outputs.json_files_created }}" + echo "Documentation directory: ${{ steps.codeboarding.outputs.output_directory }}" + echo "JSON directory: ${{ steps.codeboarding.outputs.json_directory }}" + echo "Has changes: ${{ steps.codeboarding.outputs.has_changes }}" + + # Check if we have any changes to commit + - name: Check for changes + id: git-changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "has_git_changes=true" >> $GITHUB_OUTPUT + else + echo "has_git_changes=false" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + if: steps.git-changes.outputs.has_git_changes == 'true' && steps.codeboarding.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.PAT_TOKEN }} + commit-message: "docs: update mcp-agent codeboarding documentation" + title: "📚 MCP Agent CodeBoarding Documentation Update" + body: | + ## 📚 MCP Agent Documentation Update + This PR contains updated documentation files for the MCP Agent project fetched from the CodeBoarding service. + + ### 📊 Summary + - **Documentation files created/updated**: ${{ steps.codeboarding.outputs.markdown_files_created }} + - **JSON files created/updated**: ${{ steps.codeboarding.outputs.json_files_created }} + - **Documentation directory**: `${{ steps.codeboarding.outputs.output_directory }}/` + - **JSON directory**: `${{ steps.codeboarding.outputs.json_directory }}/` + - **Output format**: `${{ github.event.inputs.output_format || '.md' }}` + - **Repository analyzed**: `${{ steps.codeboarding.outputs.repo_url }}` + + 🤖 This PR was automatically generated by the MCP Agent CodeBoarding documentation update workflow. + branch: docs/codeboarding-update + base: main + delete-branch: true \ No newline at end of file From e4d33ac8179ee6d4e448a30541dd2c044bde886d Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 7 Jul 2025 03:40:20 +0200 Subject: [PATCH 4/9] Added new workflow integration --- .codeboarding/Agent_Core_LLM_Integration.json | 141 +++++++++++ .../Agent_Execution_Workflow_Engine.json | 138 +++++++++++ .codeboarding/Agent_Workflow_Patterns.json | 227 ++++++++++++++++++ .codeboarding/Core_Application_Setup.json | 195 +++++++++++++++ .codeboarding/Human_Interaction_Layer.json | 75 ++++++ .codeboarding/MCP_Service_Integration.json | 102 ++++++++ .codeboarding/analysis.json | 213 ++++++++++++++++ .codeboarding/codeboarding_version.json | 4 + .github/workflows/doc-updates.yml | 13 +- .../Agent_Core_LLM_Integration.mdx | 84 +++++++ .../Agent_Execution_Workflow_Engine.mdx | 92 +++++++ docs/codeboarding/Agent_Workflow_Patterns.mdx | 123 ++++++++++ docs/codeboarding/Core_Application_Setup.mdx | 110 +++++++++ docs/codeboarding/Human_Interaction_Layer.mdx | 65 +++++ docs/codeboarding/MCP_Service_Integration.mdx | 78 ++++++ .../codeboarding/agent-workflow-framework.mdx | 194 --------------- docs/codeboarding/analysis.mdx | 111 +++++++++ .../core-orchestration-execution.mdx | 145 ----------- .../intent-interaction-management.mdx | 138 ----------- docs/codeboarding/llm-external-tooling.mdx | 154 ------------ docs/codeboarding/mcp-api-gateway.mdx | 123 ---------- docs/codeboarding/overview.mdx | 82 ------- docs/docs.json | 13 +- 23 files changed, 1773 insertions(+), 847 deletions(-) create mode 100644 .codeboarding/Agent_Core_LLM_Integration.json create mode 100644 .codeboarding/Agent_Execution_Workflow_Engine.json create mode 100644 .codeboarding/Agent_Workflow_Patterns.json create mode 100644 .codeboarding/Core_Application_Setup.json create mode 100644 .codeboarding/Human_Interaction_Layer.json create mode 100644 .codeboarding/MCP_Service_Integration.json create mode 100644 .codeboarding/analysis.json create mode 100644 .codeboarding/codeboarding_version.json create mode 100644 docs/codeboarding/Agent_Core_LLM_Integration.mdx create mode 100644 docs/codeboarding/Agent_Execution_Workflow_Engine.mdx create mode 100644 docs/codeboarding/Agent_Workflow_Patterns.mdx create mode 100644 docs/codeboarding/Core_Application_Setup.mdx create mode 100644 docs/codeboarding/Human_Interaction_Layer.mdx create mode 100644 docs/codeboarding/MCP_Service_Integration.mdx delete mode 100644 docs/codeboarding/agent-workflow-framework.mdx create mode 100644 docs/codeboarding/analysis.mdx delete mode 100644 docs/codeboarding/core-orchestration-execution.mdx delete mode 100644 docs/codeboarding/intent-interaction-management.mdx delete mode 100644 docs/codeboarding/llm-external-tooling.mdx delete mode 100644 docs/codeboarding/mcp-api-gateway.mdx delete mode 100644 docs/codeboarding/overview.mdx diff --git a/.codeboarding/Agent_Core_LLM_Integration.json b/.codeboarding/Agent_Core_LLM_Integration.json new file mode 100644 index 000000000..c34e6256b --- /dev/null +++ b/.codeboarding/Agent_Core_LLM_Integration.json @@ -0,0 +1,141 @@ +{ + "description": "This subsystem defines the fundamental interface and capabilities of an AI agent, encapsulating interactions with Large Language Models (LLMs), external tools, prompts, and resources. It provides a consistent and extensible model for agent behavior and offers a standardized, augmented interface for interacting with various LLM providers.", + "components": [ + { + "name": "Agent Core", + "description": "This is the foundational interface for all AI agents within the `mcp-agent` framework. It defines the core capabilities and interaction points of an agent, serving as the base for more specialized agent types. It encapsulates the agent's logic, its interaction with LLMs, and its ability to utilize external tools and resources.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.agents.agent.Agent", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/agents/agent.py", + "reference_start_line": 56, + "reference_end_line": 934 + } + ] + }, + { + "name": "Augmented LLM Interface", + "description": "This abstract component provides a unified and enhanced interface for interacting with different LLM providers. It abstracts away the vendor-specific details of LLM APIs, allowing the rest of the framework to interact with LLMs in a consistent manner, regardless of the underlying provider. It supports various LLM operations, including completion and structured completion requests.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_start_line": 218, + "reference_end_line": 668 + } + ] + }, + { + "name": "LLM Selector", + "description": "This component is responsible for intelligently selecting the most suitable LLM model for a given task. It considers various criteria such as cost, latency, and performance benchmarks to make informed decisions, optimizing resource utilization and response quality.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_start_line": 96, + "reference_end_line": 413 + } + ] + }, + { + "name": "LLM Provider Implementations", + "description": "These are concrete implementations of the `Augmented LLM Interface`, providing the actual connectivity and interaction logic for specific LLM providers (e.g., Anthropic, Azure, Bedrock, Google, OpenAI, Ollama). Each implementation handles the nuances of its respective LLM API and translates requests and responses to and from the framework's internal format.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_start_line": 110, + "reference_end_line": 722 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_azure.AzureAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", + "reference_start_line": 82, + "reference_end_line": 491 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", + "reference_start_line": 48, + "reference_end_line": 349 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_google.GoogleAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", + "reference_start_line": 34, + "reference_end_line": 319 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_ollama.OllamaAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_ollama.py", + "reference_start_line": 16, + "reference_end_line": 78 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_openai.OpenAIAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", + "reference_start_line": 80, + "reference_end_line": 845 + } + ] + }, + { + "name": "Provider to MCP Converters", + "description": "These utility classes are crucial for ensuring data consistency and interoperability across different LLM providers. They are responsible for converting provider-specific data structures (e.g., Anthropic's messages, OpenAI's chat completions) into the framework's standardized Model Context Protocol (MCP) types.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicMCPTypeConverter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_start_line": 777, + "reference_end_line": 886 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_azure.MCPAzureTypeConverter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", + "reference_start_line": 524, + "reference_end_line": 614 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockMCPTypeConverter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", + "reference_start_line": 437, + "reference_end_line": 499 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_google.GoogleMCPTypeConverter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", + "reference_start_line": 403, + "reference_end_line": 518 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_openai.MCPOpenAITypeConverter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", + "reference_start_line": 949, + "reference_end_line": 1055 + } + ] + } + ], + "components_relations": [ + { + "relation": "uses", + "src_name": "Agent Core", + "dst_name": "Augmented LLM Interface" + }, + { + "relation": "uses", + "src_name": "Augmented LLM Interface", + "dst_name": "LLM Selector" + }, + { + "relation": "implements", + "src_name": "LLM Provider Implementations", + "dst_name": "Augmented LLM Interface" + }, + { + "relation": "uses", + "src_name": "LLM Provider Implementations", + "dst_name": "Provider to MCP Converters" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/Agent_Execution_Workflow_Engine.json b/.codeboarding/Agent_Execution_Workflow_Engine.json new file mode 100644 index 000000000..291836fc5 --- /dev/null +++ b/.codeboarding/Agent_Execution_Workflow_Engine.json @@ -0,0 +1,138 @@ +{ + "description": "Abstract Components Overview", + "components": [ + { + "name": "Execution Engine", + "description": "This is the core component responsible for the actual execution of tasks and activities. It provides an abstract interface (Executor) for running executable units, with concrete implementations like AsyncioExecutor for immediate asynchronous execution and TemporalExecutor for durable, long-running workflows. It manages the runtime environment for tasks and orchestrates their execution flow.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/executor.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/executor.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent/executor/temporal/TemporalExecutor.py", + "reference_file": "mcp_agent/executor/temporal/TemporalExecutor.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Workflow Management", + "description": "This component defines the structure, state, and lifecycle of complex, multi-step processes. It provides the Workflow abstraction, allowing for the definition of sequences of tasks and decision points. InteractiveWorkflow specifically handles scenarios requiring human input or external interaction, enabling robust and adaptable agent workflows.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/workflow.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent/executor/temporal/interactive_workflow.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/temporal/interactive_workflow.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Task/Activity Registry", + "description": "A centralized repository that allows for the registration and dynamic retrieval of executable tasks or \"activities.\" This component is crucial for the Execution Engine to discover and invoke the specific functions or methods that constitute an agent's capabilities or a workflow's steps. It promotes modularity by decoupling task definition from task execution.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/task_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Signal Handling", + "description": "This component provides a robust mechanism for inter-component communication and handling external events, including human input. It enables workflows and tasks to asynchronously wait for, send, and receive signals, which is vital for interactive processes, state transitions, and coordination within the agent system. It includes a registry for managing various signal handlers.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/signal_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent/executor/workflow_signal.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow_signal.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Decorator Registry", + "description": "This component serves as a dedicated registry for managing decorators that can be applied to tasks or workflows. It facilitates the application of cross-cutting concerns (e.g., logging, error handling, retry mechanisms, authentication) in a declarative manner, enhancing the extensibility and maintainability of the executable units without modifying their core logic.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/decorator_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Workflow Registry", + "description": "This component is responsible for registering and providing access to defined workflow blueprints. It allows the system to dynamically discover and instantiate workflows based on their unique identifiers, supporting different underlying storage or persistence mechanisms (e.g., in-memory for transient workflows, Temporal for durable workflows).", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/workflow_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent/executor/temporal/workflow_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/temporal/workflow_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + } + ], + "components_relations": [ + { + "relation": "uses", + "src_name": "Execution Engine", + "dst_name": "Task/Activity Registry" + }, + { + "relation": "uses", + "src_name": "Execution Engine", + "dst_name": "Workflow Management" + }, + { + "relation": "uses", + "src_name": "Execution Engine", + "dst_name": "Signal Handling" + }, + { + "relation": "uses", + "src_name": "Execution Engine", + "dst_name": "Workflow Registry" + }, + { + "relation": "interacts with", + "src_name": "Workflow Management", + "dst_name": "Signal Handling" + }, + { + "relation": "registers with", + "src_name": "Workflow Management", + "dst_name": "Workflow Registry" + }, + { + "relation": "potentially uses", + "src_name": "Execution Engine", + "dst_name": "Decorator Registry" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/Agent_Workflow_Patterns.json b/.codeboarding/Agent_Workflow_Patterns.json new file mode 100644 index 000000000..ef351858f --- /dev/null +++ b/.codeboarding/Agent_Workflow_Patterns.json @@ -0,0 +1,227 @@ +{ + "description": "Abstract Components Overview", + "components": [ + { + "name": "LLM Augmentation Layer", + "description": "This foundational component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., Anthropic, OpenAI, Google). It abstracts away provider-specific API calls, handles structured completion, and integrates with the agent's context. It also includes a ModelSelector for choosing optimal LLMs.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_start_line": 218, + "reference_end_line": 668 + }, + { + "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_start_line": 96, + "reference_end_line": 413 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_start_line": 110, + "reference_end_line": 722 + } + ] + }, + { + "name": "Embedding Models", + "description": "This component offers a standardized interface for generating and managing text embeddings using various underlying embedding models (e.g., Cohere, OpenAI). These vector representations of text are crucial for semantic search, similarity comparisons, and other vector-based operations.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.embedding.embedding_base.EmbeddingModel", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_base.py", + "reference_start_line": 13, + "reference_end_line": 31 + }, + { + "qualified_name": "mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_cohere.py", + "reference_start_line": 18, + "reference_end_line": 72 + }, + { + "qualified_name": "mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_openai.py", + "reference_start_line": 18, + "reference_end_line": 70 + } + ] + }, + { + "name": "Orchestration Workflow", + "description": "Responsible for managing complex, multi-step agent behaviors. It defines how agents plan, execute, and refine sequences of actions and tasks, often involving iterative processes and dynamic task management. This enables agents to break down complex problems into manageable steps and coordinate their execution.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator.Orchestrator", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", + "reference_start_line": 45, + "reference_end_line": 585 + }, + { + "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_models.AgentTask", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_models.py", + "reference_start_line": 26, + "reference_end_line": 31 + }, + { + "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_prompts", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Routing Workflow", + "description": "Intelligently directs incoming requests or tasks to the most appropriate agent, tool, or sub-workflow. It supports various routing strategies, including LLM-based decision-making and embedding-based similarity matching, enabling dynamic and context-aware task distribution within the agent system.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.router.router_base.Router", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_base.py", + "reference_start_line": 63, + "reference_end_line": 275 + }, + { + "qualified_name": "mcp_agent.workflows.router.router_llm.LLMRouter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_llm.py", + "reference_start_line": 81, + "reference_end_line": 373 + }, + { + "qualified_name": "mcp_agent.workflows.router.router_embedding.EmbeddingRouter", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_embedding.py", + "reference_start_line": 28, + "reference_end_line": 239 + } + ] + }, + { + "name": "Intent Classification Workflow", + "description": "Dedicated to identifying the underlying intent of a user's query or system message. It leverages both LLM-based reasoning and embedding-based similarity to accurately classify intents, which then informs the agent's subsequent actions or selection of appropriate workflows.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", + "reference_start_line": 42, + "reference_end_line": 85 + }, + { + "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py", + "reference_start_line": 63, + "reference_end_line": 243 + }, + { + "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py", + "reference_start_line": 32, + "reference_end_line": 177 + } + ] + }, + { + "name": "Parallel LLM Workflow", + "description": "Enables the concurrent execution of multiple LLM calls or agent actions. It implements \"fan-out\" to distribute tasks in parallel and \"fan-in\" to aggregate their results, significantly improving the efficiency and throughput of LLM-intensive operations.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.parallel.parallel_llm.ParallelLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", + "reference_start_line": 23, + "reference_end_line": 279 + }, + { + "qualified_name": "mcp_agent.workflows.parallel.fan_in.FanIn", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/fan_in.py", + "reference_start_line": 30, + "reference_end_line": 422 + }, + { + "qualified_name": "mcp_agent.workflows.parallel.fan_out.FanOut", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/fan_out.py", + "reference_start_line": 23, + "reference_end_line": 243 + } + ] + }, + { + "name": "Swarm Workflow", + "description": "Facilitates collaborative problem-solving among multiple agents. It enables agents to interact, share information, and collectively work towards a common goal, supporting complex, distributed agent behaviors and multi-agent systems.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.swarm.swarm.Swarm", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", + "reference_start_line": 189, + "reference_end_line": 310 + }, + { + "qualified_name": "mcp_agent.workflows.swarm.swarm_anthropic.AnthropicSwarm", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm_anthropic.py", + "reference_start_line": 8, + "reference_end_line": 41 + }, + { + "qualified_name": "mcp_agent.workflows.swarm.swarm_openai.OpenAISwarm", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm_openai.py", + "reference_start_line": 8, + "reference_end_line": 40 + } + ] + }, + { + "name": "Evaluation & Optimization Workflow", + "description": "Provides mechanisms for evaluating the performance, quality, and effectiveness of agent outputs or entire workflows. It can be used to assess responses, identify areas for improvement, and potentially guide the agent towards optimizing its future actions.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.evaluator_optimizer.evaluator_optimizer.EvaluatorOptimizerLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py", + "reference_start_line": 47, + "reference_end_line": 475 + } + ] + } + ], + "components_relations": [ + { + "relation": "uses", + "src_name": "Orchestration Workflow", + "dst_name": "LLM Augmentation Layer" + }, + { + "relation": "uses", + "src_name": "Routing Workflow", + "dst_name": "LLM Augmentation Layer" + }, + { + "relation": "uses", + "src_name": "Routing Workflow", + "dst_name": "Embedding Models" + }, + { + "relation": "uses", + "src_name": "Intent Classification Workflow", + "dst_name": "LLM Augmentation Layer" + }, + { + "relation": "uses", + "src_name": "Intent Classification Workflow", + "dst_name": "Embedding Models" + }, + { + "relation": "uses", + "src_name": "Parallel LLM Workflow", + "dst_name": "LLM Augmentation Layer" + }, + { + "relation": "uses", + "src_name": "Swarm Workflow", + "dst_name": "LLM Augmentation Layer" + }, + { + "relation": "uses", + "src_name": "Evaluation & Optimization Workflow", + "dst_name": "LLM Augmentation Layer" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/Core_Application_Setup.json b/.codeboarding/Core_Application_Setup.json new file mode 100644 index 000000000..0b67cf8ed --- /dev/null +++ b/.codeboarding/Core_Application_Setup.json @@ -0,0 +1,195 @@ +{ + "description": "This component is the foundational layer of the `mcp-agent` application. It is responsible for the initial bootstrapping of the entire agent framework, establishing the global application context, and managing the loading, parsing, and provision of all application settings and sensitive information. It acts as the central orchestrator for the agent's environment, ensuring that all subsequent components operate with the correct parameters and have access to essential services. Its design emphasizes modularity and extensibility, crucial for an AI agent development framework.", + "components": [ + { + "name": "Application Core (MCPApp)", + "description": "The primary entry point and orchestrator of the `mcp-agent` application. It initializes and coordinates all other core services and components, setting up the runtime environment for agents and workflows.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.app.MCPApp", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/app.py", + "reference_start_line": 34, + "reference_end_line": 508 + } + ] + }, + { + "name": "Configuration Management (Settings)", + "description": "Centralized management for all application configurations, including API keys, service endpoints, and operational parameters. It ensures that all components have access to the necessary settings in a structured and secure manner, supporting various LLM providers and external services.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.config.Settings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.AnthropicSettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.OpenAISettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.TemporalSettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.AzureSettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.BedrockSettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.config.GoogleSettings", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Decorator Registry", + "description": "A central registry for managing and retrieving decorators, enabling dynamic extension and modification of component behavior across the framework. This supports the \"Strategy Pattern\" and extensibility by allowing new functionalities to be plugged in without altering core code.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.executor.decorator_registry.DecoratorRegistry", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "Signal Registry", + "description": "Provides a mechanism for registering and dispatching signals, facilitating event-driven communication and coordination between different parts of the agent framework. This is crucial for implementing the \"Observer Pattern\" and asynchronous interactions.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.executor.signal_registry.SignalRegistry", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_start_line": 3, + "reference_end_line": 29 + } + ] + }, + { + "name": "Task Registry (ActivityRegistry)", + "description": "A registry for managing and retrieving executable tasks or activities, allowing the framework to dynamically discover and invoke operations. This is key for defining and executing agent capabilities.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.executor.task_registry.ActivityRegistry", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "MCP Server Management", + "description": "Manages the lifecycle and connections to various Model Context Protocol (MCP) servers, enabling the agent to interact with external models and services. This component is critical for the \"Microservices/Service-Oriented Architecture\" aspect of the framework.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.mcp.mcp_server_registry.ServerRegistry", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + }, + { + "qualified_name": "mcp_agent.mcp.mcp_aggregator.MCPAggregator", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_start_line": 77, + "reference_end_line": 1357 + } + ] + }, + { + "name": "LLM Selection", + "description": "Responsible for selecting and managing Large Language Models (LLMs), including their configuration and augmentation, to provide the core AI capabilities for the agents. It allows for flexible integration of different LLM providers.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_start_line": 96, + "reference_end_line": 413 + }, + { + "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_start_line": 218, + "reference_end_line": 668 + } + ] + } + ], + "components_relations": [ + { + "relation": "uses", + "src_name": "Application Core (MCPApp)", + "dst_name": "Configuration Management (Settings)" + }, + { + "relation": "manages", + "src_name": "Application Core (MCPApp)", + "dst_name": "Decorator Registry" + }, + { + "relation": "manages", + "src_name": "Application Core (MCPApp)", + "dst_name": "Signal Registry" + }, + { + "relation": "manages", + "src_name": "Application Core (MCPApp)", + "dst_name": "Task Registry (ActivityRegistry)" + }, + { + "relation": "orchestrates", + "src_name": "Application Core (MCPApp)", + "dst_name": "MCP Server Management" + }, + { + "relation": "integrates", + "src_name": "Application Core (MCPApp)", + "dst_name": "LLM Selection" + }, + { + "relation": "configures", + "src_name": "Configuration Management (Settings)", + "dst_name": "LLM Selection" + }, + { + "relation": "configures", + "src_name": "Configuration Management (Settings)", + "dst_name": "MCP Server Management" + }, + { + "relation": "depends on", + "src_name": "MCP Server Management", + "dst_name": "Configuration Management (Settings)" + }, + { + "relation": "depends on", + "src_name": "LLM Selection", + "dst_name": "Configuration Management (Settings)" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/Human_Interaction_Layer.json b/.codeboarding/Human_Interaction_Layer.json new file mode 100644 index 000000000..cb676d10e --- /dev/null +++ b/.codeboarding/Human_Interaction_Layer.json @@ -0,0 +1,75 @@ +{ + "description": "The `Human Interaction Layer` is a critical subsystem designed to facilitate seamless human-in-the-loop workflows within the AI agent framework. Its primary purpose is to enable agents to request information, receive feedback, and process responses from human users, thereby integrating human intelligence and decision-making into automated processes. This layer adheres to the project's architectural biases by promoting modularity, clear separation of concerns, and an asynchronous design, ensuring that human interactions do not block core agent operations.", + "components": [ + { + "name": "Human Input Handler", + "description": "This is the central orchestrator for managing human input. It's responsible for presenting prompts to the user, capturing their input (distinguishing between simple text and structured commands), and then parsing that input to determine the appropriate action for the agent. It also coordinates with the display mechanism to manage the visual state during input.", + "referenced_source_code": [ + { + "qualified_name": "Human Input Handler", + "reference_file": "mcp_agent/human_input/handler.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Human Input Data Models", + "description": "This component defines the standardized data structures (e.g., `HumanInputRequest`) for all human-related input and output within the system. It ensures type safety, consistency, and a clear contract for information exchange between the agent framework and the human interaction components.", + "referenced_source_code": [ + { + "qualified_name": "Human Input Data Models", + "reference_file": "mcp_agent/human_input/types.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Progress Display", + "description": "This component, specifically `RichProgressDisplay`, is responsible for providing visual feedback to the user during agent operations. It manages the display of progress indicators, status messages, and other interactive elements, crucially pausing them when human input is pending and resuming them afterward to maintain a coherent user experience.", + "referenced_source_code": [ + { + "qualified_name": "Progress Display", + "reference_file": "mcp_agent/logging/rich_progress.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Console Interface", + "description": "This foundational component provides the low-level interface for interacting with the console. It handles the actual reading of input from `stdin` and writing output to `stdout`/`stderr`. While not exclusively part of the `human_input` package, it serves as the underlying I/O mechanism for any console-based human interaction.", + "referenced_source_code": [ + { + "qualified_name": "Console Interface", + "reference_file": "mcp_agent/console.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + } + ], + "components_relations": [ + { + "relation": "uses", + "src_name": "Human Input Handler", + "dst_name": "Human Input Data Models" + }, + { + "relation": "uses", + "src_name": "Human Input Handler", + "dst_name": "Console Interface" + }, + { + "relation": "uses", + "src_name": "Human Input Handler", + "dst_name": "Progress Display" + }, + { + "relation": "uses", + "src_name": "Progress Display", + "dst_name": "Console Interface" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/MCP_Service_Integration.json b/.codeboarding/MCP_Service_Integration.json new file mode 100644 index 000000000..41cde3966 --- /dev/null +++ b/.codeboarding/MCP_Service_Integration.json @@ -0,0 +1,102 @@ +{ + "description": "Abstract Components Overview", + "components": [ + { + "name": "MCPAggregator", + "description": "The MCPAggregator serves as the central hub for collecting and consolidating capabilities from various MCP servers. It's responsible for presenting a unified view of available tools, prompts, and resources to the rest of the `mcp_agent` application, abstracting away the complexities of interacting with individual MCP services. This component is fundamental because it provides the agent with a comprehensive understanding of its available external capabilities, enabling dynamic tool and resource utilization.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.mcp_aggregator.MCPAggregator", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_start_line": 77, + "reference_end_line": 1357 + } + ] + }, + { + "name": "MCPConnectionManager", + "description": "This component is responsible for the lifecycle management of network connections and communication sessions with MCP servers. It handles the establishment, maintenance, and termination of these connections, ensuring reliable and efficient communication. Its importance lies in providing a robust and abstract layer for network interactions, preventing other components from needing to manage low-level connection details.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "ServerRegistry", + "description": "The ServerRegistry acts as a persistent store for information about known MCP servers. It maintains their configurations, status, and other metadata, enabling the MCPConnectionManager and other components to discover and retrieve details about available MCP services. This component is fundamental for the dynamic discovery and management of external services, supporting the extensibility of the framework.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.mcp_server_registry.ServerRegistry", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "MCPClientSession", + "description": "This component encapsulates the details of an individual client session with a specific MCP server. It handles the low-level mechanics of sending requests and receiving responses over a single connection. This separation of concerns ensures that the complexities of interacting with a single MCP server are isolated, promoting reusability and testability.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.mcp_agent_client_session.MCPClientSession", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_agent_client_session.py", + "reference_start_line": 0, + "reference_end_line": 0 + } + ] + }, + { + "name": "gen_client", + "description": "This module contains auto-generated client code that provides concrete methods for interacting with MCP servers based on their defined protocols. It abstracts the underlying communication details, allowing higher-level components to make API calls to MCP services using a type-safe and convenient interface. This component is crucial for ensuring correct and efficient communication with diverse MCP servers.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent.mcp.gen_client", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/gen_client.py", + "reference_start_line": 15, + "reference_end_line": 40 + } + ] + } + ], + "components_relations": [ + { + "relation": "Uses", + "src_name": "MCPAggregator", + "dst_name": "MCPConnectionManager" + }, + { + "relation": "Uses", + "src_name": "mcp_agent.agents.agent", + "dst_name": "MCPAggregator" + }, + { + "relation": "Uses", + "src_name": "mcp_agent.app", + "dst_name": "MCPAggregator" + }, + { + "relation": "Uses", + "src_name": "MCPConnectionManager", + "dst_name": "ServerRegistry" + }, + { + "relation": "Uses", + "src_name": "MCPConnectionManager", + "dst_name": "MCPClientSession" + }, + { + "relation": "Uses", + "src_name": "gen_client", + "dst_name": "MCPClientSession" + }, + { + "relation": "Uses", + "src_name": "MCPClientSession", + "dst_name": "mcp_agent.config" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/analysis.json b/.codeboarding/analysis.json new file mode 100644 index 000000000..d9b3d5d06 --- /dev/null +++ b/.codeboarding/analysis.json @@ -0,0 +1,213 @@ +{ + "description": "The `mcp-agent` project provides a robust framework for developing AI agents. At its core, the **Core Application & Setup** component initializes the entire system and manages configurations. The **Agent Execution & Workflow Engine** then takes over, orchestrating the execution of various **Agent Workflow Patterns** (like orchestration, routing, or parallel processing) which define the agent's high-level behaviors. These workflows, in turn, leverage the **Agent Core & LLM Integration** component to interact with Large Language Models and perform agent-specific actions. The **MCP Service Integration** component is crucial for discovering and connecting to external Model Context Protocol (MCP) servers, providing the necessary tools and resources to the agents. Finally, the **Human Interaction Layer** enables human-in-the-loop capabilities, allowing agents to request and receive input from users, which is then processed by the Execution Engine.", + "components": [ + { + "name": "Core Application & Setup", + "description": "Initializes the entire agent framework, establishes the global application context, and manages the loading, parsing, and provision of application settings and sensitive information. It acts as the central orchestrator for the agent's environment and ensures all components operate with correct parameters.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/app.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/app.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/config.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Agent Execution & Workflow Engine", + "description": "Manages the lifecycle and execution of tasks, activities, and complex workflows. It provides mechanisms for registering executable units and handling their state, supporting both immediate asynchronous execution and durable, long-running workflows.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/executor/executor.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/executor.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/executor/task_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/executor/signal_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/executor/decorator_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/executor/workflow.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Agent Core & LLM Integration", + "description": "Defines the fundamental interface and capabilities of an AI agent. It encapsulates interactions with Large Language Models (LLMs), external tools, prompts, and resources, providing a consistent and extensible model for agent behavior. It also offers a standardized and augmented interface for interacting with various LLM providers.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/agents/agent.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/agents/agent.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/llm/augmented_llm.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/llm/llm_selector.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "MCP Service Integration", + "description": "Serves as a central point for discovering, collecting, and managing capabilities (tools, prompts, resources) exposed by various Model Context Protocol (MCP) servers. It also manages the underlying network connections and communication sessions with these external services.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/mcp/mcp_aggregator.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/mcp/mcp_connection_manager.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/mcp/mcp_server_registry.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Agent Workflow Patterns", + "description": "Implements various complex, multi-step agent behaviors and patterns. This includes orchestrating sequences of actions, routing requests, classifying user intents, parallelizing LLM calls, and facilitating collaborative problem-solving among multiple agents.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/workflows/orchestrator/orchestrator.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/router/router_base.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_base.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/intent_classifier/intent_classifier_base.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/parallel/parallel_llm.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/workflows/swarm/swarm.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + }, + { + "name": "Human Interaction Layer", + "description": "Handles all interactions requiring human input or feedback. It provides mechanisms for agents to request information from users and process their responses, enabling human-in-the-loop workflows.", + "referenced_source_code": [ + { + "qualified_name": "mcp_agent/human_input/handler.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/human_input/handler.py", + "reference_start_line": 1, + "reference_end_line": 1 + }, + { + "qualified_name": "mcp_agent/human_input/types.py", + "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/human_input/types.py", + "reference_start_line": 1, + "reference_end_line": 1 + } + ] + } + ], + "components_relations": [ + { + "relation": "Configures", + "src_name": "Core Application & Setup", + "dst_name": "Agent Execution & Workflow Engine" + }, + { + "relation": "Configures", + "src_name": "Core Application & Setup", + "dst_name": "MCP Service Integration" + }, + { + "relation": "Manages", + "src_name": "Agent Execution & Workflow Engine", + "dst_name": "Agent Workflow Patterns" + }, + { + "relation": "Requests input from", + "src_name": "Agent Execution & Workflow Engine", + "dst_name": "Human Interaction Layer" + }, + { + "relation": "Utilizes", + "src_name": "Agent Core & LLM Integration", + "dst_name": "MCP Service Integration" + }, + { + "relation": "Provides capabilities to", + "src_name": "Agent Core & LLM Integration", + "dst_name": "Agent Workflow Patterns" + }, + { + "relation": "Provides capabilities to", + "src_name": "MCP Service Integration", + "dst_name": "Agent Core & LLM Integration" + }, + { + "relation": "Orchestrates", + "src_name": "Agent Workflow Patterns", + "dst_name": "Agent Core & LLM Integration" + }, + { + "relation": "Leverages", + "src_name": "Agent Workflow Patterns", + "dst_name": "MCP Service Integration" + }, + { + "relation": "Provides input to", + "src_name": "Human Interaction Layer", + "dst_name": "Agent Execution & Workflow Engine" + } + ] +} \ No newline at end of file diff --git a/.codeboarding/codeboarding_version.json b/.codeboarding/codeboarding_version.json new file mode 100644 index 000000000..b6a90e34c --- /dev/null +++ b/.codeboarding/codeboarding_version.json @@ -0,0 +1,4 @@ +{ + "commit_hash": "13c378d8bceee2b4b325ff4a294fba046c835e72", + "code_boarding_version": "0.1.0" +} \ No newline at end of file diff --git a/.github/workflows/doc-updates.yml b/.github/workflows/doc-updates.yml index 3294ad007..3c8d08ad8 100644 --- a/.github/workflows/doc-updates.yml +++ b/.github/workflows/doc-updates.yml @@ -1,6 +1,8 @@ name: MCP Agent CodeBoarding Documentation Update on: + schedule: + - cron: '0 8 * * 6' # Run every Saturday at 8:00 AM UTC workflow_dispatch: inputs: repository_url: @@ -21,11 +23,12 @@ on: output_format: description: 'Output format for documentation' required: false - default: '.md' + default: '.mdx' type: choice options: - '.md' - '.rst' + - '.mdx' output_directory: description: 'Output directory for documentation files' required: false @@ -66,11 +69,11 @@ jobs: id: codeboarding uses: CodeBoarding/CodeBoarding-GHAction@v0.1.0 with: - repository_url: ${{ github.event.inputs.repository_url }} + repository_url: ${{ github.event.inputs.repository_url || 'https://github.com/lastmile-ai/mcp-agent' }} source_branch: ${{ steps.set-branches.outputs.source_branch }} target_branch: ${{ steps.set-branches.outputs.target_branch }} - output_directory: ${{ github.event.inputs.output_directory || '.codeboarding' }} - output_format: ${{ github.event.inputs.output_format || '.md' }} + output_directory: ${{ github.event.inputs.output_directory || 'docs/codeboarding' }} + output_format: ${{ github.event.inputs.output_format || '.mdx' }} - name: Display Action Results run: | @@ -106,7 +109,7 @@ jobs: - **JSON files created/updated**: ${{ steps.codeboarding.outputs.json_files_created }} - **Documentation directory**: `${{ steps.codeboarding.outputs.output_directory }}/` - **JSON directory**: `${{ steps.codeboarding.outputs.json_directory }}/` - - **Output format**: `${{ github.event.inputs.output_format || '.md' }}` + - **Output format**: `${{ github.event.inputs.output_format || '.mdx' }}` - **Repository analyzed**: `${{ steps.codeboarding.outputs.repo_url }}` 🤖 This PR was automatically generated by the MCP Agent CodeBoarding documentation update workflow. diff --git a/docs/codeboarding/Agent_Core_LLM_Integration.mdx b/docs/codeboarding/Agent_Core_LLM_Integration.mdx new file mode 100644 index 000000000..0bba6fe02 --- /dev/null +++ b/docs/codeboarding/Agent_Core_LLM_Integration.mdx @@ -0,0 +1,84 @@ +--- +title: "Agent Core LLM Integration" +description: "Agent Core LLM Integration component details" +--- + + +```mermaid +graph LR + Agent_Core["Agent Core"] + Augmented_LLM_Interface["Augmented LLM Interface"] + LLM_Selector["LLM Selector"] + LLM_Provider_Implementations["LLM Provider Implementations"] + Provider_to_MCP_Converters["Provider to MCP Converters"] + Agent_Core -- "uses" --> Augmented_LLM_Interface + Augmented_LLM_Interface -- "uses" --> LLM_Selector + LLM_Provider_Implementations -- "implements" --> Augmented_LLM_Interface + LLM_Provider_Implementations -- "uses" --> Provider_to_MCP_Converters +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +This subsystem defines the fundamental interface and capabilities of an AI agent, encapsulating interactions with Large Language Models (LLMs), external tools, prompts, and resources. It provides a consistent and extensible model for agent behavior and offers a standardized, augmented interface for interacting with various LLM providers. + +### Agent Core +This is the foundational interface for all AI agents within the `mcp-agent` framework. It defines the core capabilities and interaction points of an agent, serving as the base for more specialized agent types. It encapsulates the agent's logic, its interaction with LLMs, and its ability to utilize external tools and resources. + + +**Related Classes/Methods**: + +- `mcp_agent.agents.agent.Agent` (56:934) + + +### Augmented LLM Interface +This abstract component provides a unified and enhanced interface for interacting with different LLM providers. It abstracts away the vendor-specific details of LLM APIs, allowing the rest of the framework to interact with LLMs in a consistent manner, regardless of the underlying provider. It supports various LLM operations, including completion and structured completion requests. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) + + +### LLM Selector +This component is responsible for intelligently selecting the most suitable LLM model for a given task. It considers various criteria such as cost, latency, and performance benchmarks to make informed decisions, optimizing resource utilization and response quality. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) + + +### LLM Provider Implementations +These are concrete implementations of the `Augmented LLM Interface`, providing the actual connectivity and interaction logic for specific LLM providers (e.g., Anthropic, Azure, Bedrock, Google, OpenAI, Ollama). Each implementation handles the nuances of its respective LLM API and translates requests and responses to and from the framework's internal format. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM` (110:722) +- `mcp_agent.workflows.llm.augmented_llm_azure.AzureAugmentedLLM` (82:491) +- `mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockAugmentedLLM` (48:349) +- `mcp_agent.workflows.llm.augmented_llm_google.GoogleAugmentedLLM` (34:319) +- `mcp_agent.workflows.llm.augmented_llm_ollama.OllamaAugmentedLLM` (16:78) +- `mcp_agent.workflows.llm.augmented_llm_openai.OpenAIAugmentedLLM` (80:845) + + +### Provider to MCP Converters +These utility classes are crucial for ensuring data consistency and interoperability across different LLM providers. They are responsible for converting provider-specific data structures (e.g., Anthropic's messages, OpenAI's chat completions) into the framework's standardized Model Context Protocol (MCP) types. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicMCPTypeConverter` (777:886) +- `mcp_agent.workflows.llm.augmented_llm_azure.MCPAzureTypeConverter` (524:614) +- `mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockMCPTypeConverter` (437:499) +- `mcp_agent.workflows.llm.augmented_llm_google.GoogleMCPTypeConverter` (403:518) +- `mcp_agent.workflows.llm.augmented_llm_openai.MCPOpenAITypeConverter` (949:1055) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/Agent_Execution_Workflow_Engine.mdx b/docs/codeboarding/Agent_Execution_Workflow_Engine.mdx new file mode 100644 index 000000000..29a2949b5 --- /dev/null +++ b/docs/codeboarding/Agent_Execution_Workflow_Engine.mdx @@ -0,0 +1,92 @@ +--- +title: "Agent Execution Workflow Engine" +description: "Agent Execution Workflow Engine component details" +--- + + +```mermaid +graph LR + Execution_Engine["Execution Engine"] + Workflow_Management["Workflow Management"] + Task_Activity_Registry["Task/Activity Registry"] + Signal_Handling["Signal Handling"] + Decorator_Registry["Decorator Registry"] + Workflow_Registry["Workflow Registry"] + Execution_Engine -- "uses" --> Task_Activity_Registry + Execution_Engine -- "uses" --> Workflow_Management + Execution_Engine -- "uses" --> Signal_Handling + Execution_Engine -- "uses" --> Workflow_Registry + Workflow_Management -- "interacts with" --> Signal_Handling + Workflow_Management -- "registers with" --> Workflow_Registry + Execution_Engine -- "potentially uses" --> Decorator_Registry +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +Abstract Components Overview + +### Execution Engine +This is the core component responsible for the actual execution of tasks and activities. It provides an abstract interface (Executor) for running executable units, with concrete implementations like AsyncioExecutor for immediate asynchronous execution and TemporalExecutor for durable, long-running workflows. It manages the runtime environment for tasks and orchestrates their execution flow. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/executor.py` +- `mcp_agent/executor/temporal/TemporalExecutor.py` + + +### Workflow Management +This component defines the structure, state, and lifecycle of complex, multi-step processes. It provides the Workflow abstraction, allowing for the definition of sequences of tasks and decision points. InteractiveWorkflow specifically handles scenarios requiring human input or external interaction, enabling robust and adaptable agent workflows. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/workflow.py` +- `mcp_agent/executor/temporal/interactive_workflow.py` + + +### Task/Activity Registry +A centralized repository that allows for the registration and dynamic retrieval of executable tasks or "activities." This component is crucial for the Execution Engine to discover and invoke the specific functions or methods that constitute an agent's capabilities or a workflow's steps. It promotes modularity by decoupling task definition from task execution. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/task_registry.py` + + +### Signal Handling +This component provides a robust mechanism for inter-component communication and handling external events, including human input. It enables workflows and tasks to asynchronously wait for, send, and receive signals, which is vital for interactive processes, state transitions, and coordination within the agent system. It includes a registry for managing various signal handlers. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/signal_registry.py` +- `mcp_agent/executor/workflow_signal.py` + + +### Decorator Registry +This component serves as a dedicated registry for managing decorators that can be applied to tasks or workflows. It facilitates the application of cross-cutting concerns (e.g., logging, error handling, retry mechanisms, authentication) in a declarative manner, enhancing the extensibility and maintainability of the executable units without modifying their core logic. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/decorator_registry.py` + + +### Workflow Registry +This component is responsible for registering and providing access to defined workflow blueprints. It allows the system to dynamically discover and instantiate workflows based on their unique identifiers, supporting different underlying storage or persistence mechanisms (e.g., in-memory for transient workflows, Temporal for durable workflows). + + +**Related Classes/Methods**: + +- `mcp_agent/executor/workflow_registry.py` +- `mcp_agent/executor/temporal/workflow_registry.py` + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/Agent_Workflow_Patterns.mdx b/docs/codeboarding/Agent_Workflow_Patterns.mdx new file mode 100644 index 000000000..9d87cbcce --- /dev/null +++ b/docs/codeboarding/Agent_Workflow_Patterns.mdx @@ -0,0 +1,123 @@ +--- +title: "Agent Workflow Patterns" +description: "Agent Workflow Patterns component details" +--- + + +```mermaid +graph LR + LLM_Augmentation_Layer["LLM Augmentation Layer"] + Embedding_Models["Embedding Models"] + Orchestration_Workflow["Orchestration Workflow"] + Routing_Workflow["Routing Workflow"] + Intent_Classification_Workflow["Intent Classification Workflow"] + Parallel_LLM_Workflow["Parallel LLM Workflow"] + Swarm_Workflow["Swarm Workflow"] + Evaluation_Optimization_Workflow["Evaluation & Optimization Workflow"] + Orchestration_Workflow -- "uses" --> LLM_Augmentation_Layer + Routing_Workflow -- "uses" --> LLM_Augmentation_Layer + Routing_Workflow -- "uses" --> Embedding_Models + Intent_Classification_Workflow -- "uses" --> LLM_Augmentation_Layer + Intent_Classification_Workflow -- "uses" --> Embedding_Models + Parallel_LLM_Workflow -- "uses" --> LLM_Augmentation_Layer + Swarm_Workflow -- "uses" --> LLM_Augmentation_Layer + Evaluation_Optimization_Workflow -- "uses" --> LLM_Augmentation_Layer +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +Abstract Components Overview + +### LLM Augmentation Layer +This foundational component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., Anthropic, OpenAI, Google). It abstracts away provider-specific API calls, handles structured completion, and integrates with the agent's context. It also includes a ModelSelector for choosing optimal LLMs. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) +- `mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM` (110:722) + + +### Embedding Models +This component offers a standardized interface for generating and managing text embeddings using various underlying embedding models (e.g., Cohere, OpenAI). These vector representations of text are crucial for semantic search, similarity comparisons, and other vector-based operations. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` (13:31) +- `mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel` (18:72) +- `mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel` (18:70) + + +### Orchestration Workflow +Responsible for managing complex, multi-step agent behaviors. It defines how agents plan, execute, and refine sequences of actions and tasks, often involving iterative processes and dynamic task management. This enables agents to break down complex problems into manageable steps and coordinate their execution. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` (45:585) +- `mcp_agent.workflows.orchestrator.orchestrator_models.AgentTask` (26:31) +- `mcp_agent.workflows.orchestrator.orchestrator_prompts` + + +### Routing Workflow +Intelligently directs incoming requests or tasks to the most appropriate agent, tool, or sub-workflow. It supports various routing strategies, including LLM-based decision-making and embedding-based similarity matching, enabling dynamic and context-aware task distribution within the agent system. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.router.router_base.Router` (63:275) +- `mcp_agent.workflows.router.router_llm.LLMRouter` (81:373) +- `mcp_agent.workflows.router.router_embedding.EmbeddingRouter` (28:239) + + +### Intent Classification Workflow +Dedicated to identifying the underlying intent of a user's query or system message. It leverages both LLM-based reasoning and embedding-based similarity to accurately classify intents, which then informs the agent's subsequent actions or selection of appropriate workflows. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier` (42:85) +- `mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier` (63:243) +- `mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier` (32:177) + + +### Parallel LLM Workflow +Enables the concurrent execution of multiple LLM calls or agent actions. It implements "fan-out" to distribute tasks in parallel and "fan-in" to aggregate their results, significantly improving the efficiency and throughput of LLM-intensive operations. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.parallel.parallel_llm.ParallelLLM` (23:279) +- `mcp_agent.workflows.parallel.fan_in.FanIn` (30:422) +- `mcp_agent.workflows.parallel.fan_out.FanOut` (23:243) + + +### Swarm Workflow +Facilitates collaborative problem-solving among multiple agents. It enables agents to interact, share information, and collectively work towards a common goal, supporting complex, distributed agent behaviors and multi-agent systems. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.swarm.swarm.Swarm` (189:310) +- `mcp_agent.workflows.swarm.swarm_anthropic.AnthropicSwarm` (8:41) +- `mcp_agent.workflows.swarm.swarm_openai.OpenAISwarm` (8:40) + + +### Evaluation & Optimization Workflow +Provides mechanisms for evaluating the performance, quality, and effectiveness of agent outputs or entire workflows. It can be used to assess responses, identify areas for improvement, and potentially guide the agent towards optimizing its future actions. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.evaluator_optimizer.evaluator_optimizer.EvaluatorOptimizerLLM` (47:475) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/Core_Application_Setup.mdx b/docs/codeboarding/Core_Application_Setup.mdx new file mode 100644 index 000000000..072d28dd0 --- /dev/null +++ b/docs/codeboarding/Core_Application_Setup.mdx @@ -0,0 +1,110 @@ +--- +title: "Core Application Setup" +description: "Core Application Setup component details" +--- + + +```mermaid +graph LR + Application_Core_MCPApp_["Application Core (MCPApp)"] + Configuration_Management_Settings_["Configuration Management (Settings)"] + Decorator_Registry["Decorator Registry"] + Signal_Registry["Signal Registry"] + Task_Registry_ActivityRegistry_["Task Registry (ActivityRegistry)"] + MCP_Server_Management["MCP Server Management"] + LLM_Selection["LLM Selection"] + Application_Core_MCPApp_ -- "uses" --> Configuration_Management_Settings_ + Application_Core_MCPApp_ -- "manages" --> Decorator_Registry + Application_Core_MCPApp_ -- "manages" --> Signal_Registry + Application_Core_MCPApp_ -- "manages" --> Task_Registry_ActivityRegistry_ + Application_Core_MCPApp_ -- "orchestrates" --> MCP_Server_Management + Application_Core_MCPApp_ -- "integrates" --> LLM_Selection + Configuration_Management_Settings_ -- "configures" --> LLM_Selection + Configuration_Management_Settings_ -- "configures" --> MCP_Server_Management + MCP_Server_Management -- "depends on" --> Configuration_Management_Settings_ + LLM_Selection -- "depends on" --> Configuration_Management_Settings_ +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +This component is the foundational layer of the `mcp-agent` application. It is responsible for the initial bootstrapping of the entire agent framework, establishing the global application context, and managing the loading, parsing, and provision of all application settings and sensitive information. It acts as the central orchestrator for the agent's environment, ensuring that all subsequent components operate with the correct parameters and have access to essential services. Its design emphasizes modularity and extensibility, crucial for an AI agent development framework. + +### Application Core (MCPApp) +The primary entry point and orchestrator of the `mcp-agent` application. It initializes and coordinates all other core services and components, setting up the runtime environment for agents and workflows. + + +**Related Classes/Methods**: + +- `mcp_agent.app.MCPApp` (34:508) + + +### Configuration Management (Settings) +Centralized management for all application configurations, including API keys, service endpoints, and operational parameters. It ensures that all components have access to the necessary settings in a structured and secure manner, supporting various LLM providers and external services. + + +**Related Classes/Methods**: + +- `mcp_agent.config.Settings` +- `mcp_agent.config.AnthropicSettings` +- `mcp_agent.config.OpenAISettings` +- `mcp_agent.config.TemporalSettings` +- `mcp_agent.config.AzureSettings` +- `mcp_agent.config.BedrockSettings` +- `mcp_agent.config.GoogleSettings` + + +### Decorator Registry +A central registry for managing and retrieving decorators, enabling dynamic extension and modification of component behavior across the framework. This supports the "Strategy Pattern" and extensibility by allowing new functionalities to be plugged in without altering core code. + + +**Related Classes/Methods**: + +- `mcp_agent.executor.decorator_registry.DecoratorRegistry` + + +### Signal Registry +Provides a mechanism for registering and dispatching signals, facilitating event-driven communication and coordination between different parts of the agent framework. This is crucial for implementing the "Observer Pattern" and asynchronous interactions. + + +**Related Classes/Methods**: + +- `mcp_agent.executor.signal_registry.SignalRegistry` (3:29) + + +### Task Registry (ActivityRegistry) +A registry for managing and retrieving executable tasks or activities, allowing the framework to dynamically discover and invoke operations. This is key for defining and executing agent capabilities. + + +**Related Classes/Methods**: + +- `mcp_agent.executor.task_registry.ActivityRegistry` + + +### MCP Server Management +Manages the lifecycle and connections to various Model Context Protocol (MCP) servers, enabling the agent to interact with external models and services. This component is critical for the "Microservices/Service-Oriented Architecture" aspect of the framework. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager` +- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` +- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` (77:1357) + + +### LLM Selection +Responsible for selecting and managing Large Language Models (LLMs), including their configuration and augmentation, to provide the core AI capabilities for the agents. It allows for flexible integration of different LLM providers. + + +**Related Classes/Methods**: + +- `mcp_agent.workflows.llm.llm_selector.ModelSelector` (96:413) +- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` (218:668) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/Human_Interaction_Layer.mdx b/docs/codeboarding/Human_Interaction_Layer.mdx new file mode 100644 index 000000000..a651fe218 --- /dev/null +++ b/docs/codeboarding/Human_Interaction_Layer.mdx @@ -0,0 +1,65 @@ +--- +title: "Human Interaction Layer" +description: "Human Interaction Layer component details" +--- + + +```mermaid +graph LR + Human_Input_Handler["Human Input Handler"] + Human_Input_Data_Models["Human Input Data Models"] + Progress_Display["Progress Display"] + Console_Interface["Console Interface"] + Human_Input_Handler -- "uses" --> Human_Input_Data_Models + Human_Input_Handler -- "uses" --> Console_Interface + Human_Input_Handler -- "uses" --> Progress_Display + Progress_Display -- "uses" --> Console_Interface +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +The `Human Interaction Layer` is a critical subsystem designed to facilitate seamless human-in-the-loop workflows within the AI agent framework. Its primary purpose is to enable agents to request information, receive feedback, and process responses from human users, thereby integrating human intelligence and decision-making into automated processes. This layer adheres to the project's architectural biases by promoting modularity, clear separation of concerns, and an asynchronous design, ensuring that human interactions do not block core agent operations. + +### Human Input Handler +This is the central orchestrator for managing human input. It's responsible for presenting prompts to the user, capturing their input (distinguishing between simple text and structured commands), and then parsing that input to determine the appropriate action for the agent. It also coordinates with the display mechanism to manage the visual state during input. + + +**Related Classes/Methods**: + +- `Human Input Handler` (1:1) + + +### Human Input Data Models +This component defines the standardized data structures (e.g., `HumanInputRequest`) for all human-related input and output within the system. It ensures type safety, consistency, and a clear contract for information exchange between the agent framework and the human interaction components. + + +**Related Classes/Methods**: + +- `Human Input Data Models` (1:1) + + +### Progress Display +This component, specifically `RichProgressDisplay`, is responsible for providing visual feedback to the user during agent operations. It manages the display of progress indicators, status messages, and other interactive elements, crucially pausing them when human input is pending and resuming them afterward to maintain a coherent user experience. + + +**Related Classes/Methods**: + +- `Progress Display` (1:1) + + +### Console Interface +This foundational component provides the low-level interface for interacting with the console. It handles the actual reading of input from `stdin` and writing output to `stdout`/`stderr`. While not exclusively part of the `human_input` package, it serves as the underlying I/O mechanism for any console-based human interaction. + + +**Related Classes/Methods**: + +- `Console Interface` (1:1) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/MCP_Service_Integration.mdx b/docs/codeboarding/MCP_Service_Integration.mdx new file mode 100644 index 000000000..a59b7ecc4 --- /dev/null +++ b/docs/codeboarding/MCP_Service_Integration.mdx @@ -0,0 +1,78 @@ +--- +title: "MCP Service Integration" +description: "MCP Service Integration component details" +--- + + +```mermaid +graph LR + MCPAggregator["MCPAggregator"] + MCPConnectionManager["MCPConnectionManager"] + ServerRegistry["ServerRegistry"] + MCPClientSession["MCPClientSession"] + gen_client["gen_client"] + MCPAggregator -- "Uses" --> MCPConnectionManager + mcp_agent_agents_agent -- "Uses" --> MCPAggregator + mcp_agent_app -- "Uses" --> MCPAggregator + MCPConnectionManager -- "Uses" --> ServerRegistry + MCPConnectionManager -- "Uses" --> MCPClientSession + gen_client -- "Uses" --> MCPClientSession + MCPClientSession -- "Uses" --> mcp_agent_config +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +Abstract Components Overview + +### MCPAggregator +The MCPAggregator serves as the central hub for collecting and consolidating capabilities from various MCP servers. It's responsible for presenting a unified view of available tools, prompts, and resources to the rest of the `mcp_agent` application, abstracting away the complexities of interacting with individual MCP services. This component is fundamental because it provides the agent with a comprehensive understanding of its available external capabilities, enabling dynamic tool and resource utilization. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` (77:1357) + + +### MCPConnectionManager +This component is responsible for the lifecycle management of network connections and communication sessions with MCP servers. It handles the establishment, maintenance, and termination of these connections, ensuring reliable and efficient communication. Its importance lies in providing a robust and abstract layer for network interactions, preventing other components from needing to manage low-level connection details. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager` + + +### ServerRegistry +The ServerRegistry acts as a persistent store for information about known MCP servers. It maintains their configurations, status, and other metadata, enabling the MCPConnectionManager and other components to discover and retrieve details about available MCP services. This component is fundamental for the dynamic discovery and management of external services, supporting the extensibility of the framework. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` + + +### MCPClientSession +This component encapsulates the details of an individual client session with a specific MCP server. It handles the low-level mechanics of sending requests and receiving responses over a single connection. This separation of concerns ensures that the complexities of interacting with a single MCP server are isolated, promoting reusability and testability. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.mcp_agent_client_session.MCPClientSession` + + +### gen_client +This module contains auto-generated client code that provides concrete methods for interacting with MCP servers based on their defined protocols. It abstracts the underlying communication details, allowing higher-level components to make API calls to MCP services using a type-safe and convenient interface. This component is crucial for ensuring correct and efficient communication with diverse MCP servers. + + +**Related Classes/Methods**: + +- `mcp_agent.mcp.gen_client` (15:40) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/agent-workflow-framework.mdx b/docs/codeboarding/agent-workflow-framework.mdx deleted file mode 100644 index 939e658ea..000000000 --- a/docs/codeboarding/agent-workflow-framework.mdx +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: "Agent & Workflow Framework" -description: "Core agent architecture and workflow patterns for multi-agent systems" ---- - -```mermaid -graph LR - Agent["Agent"] - AugmentedLLM["AugmentedLLM"] - Orchestrator["Orchestrator"] - ParallelLLM["ParallelLLM"] - Swarm["Swarm"] - Router["Router"] - IntentClassifier["IntentClassifier"] - Executor["Executor"] - MCPConnectionManager["MCPConnectionManager"] - ContextDependent["ContextDependent"] - - Agent -- "Uses" --> AugmentedLLM - Agent -- "Delegates to" --> Executor - AugmentedLLM -- "Used by" --> Agent - AugmentedLLM -- "Used by" --> Orchestrator - AugmentedLLM -- "Used by" --> ParallelLLM - AugmentedLLM -- "Used by" --> Swarm - AugmentedLLM -- "Used by" --> Router - AugmentedLLM -- "Used by" --> IntentClassifier - Orchestrator -- "Coordinates" --> Agent - Orchestrator -- "Uses" --> AugmentedLLM - ParallelLLM -- "Coordinates" --> Agent - ParallelLLM -- "Uses" --> AugmentedLLM - Swarm -- "Coordinates" --> Agent - Swarm -- "Uses" --> AugmentedLLM - Router -- "Directs tasks to" --> Agent - Router -- "Relies on" --> IntentClassifier - IntentClassifier -- "Used by" --> Router - IntentClassifier -- "Uses" --> AugmentedLLM - Executor -- "Executes tasks for" --> Agent - Executor -- "Manages" --> Orchestrator - Executor -- "Manages" --> ParallelLLM - Executor -- "Manages" --> Swarm - MCPConnectionManager -- "Facilitates communication for" --> Agent - MCPConnectionManager -- "Integrates with" --> Orchestrator - MCPConnectionManager -- "Integrates with" --> Router - ContextDependent -- "Provides context to" --> Agent - ContextDependent -- "Provides context to" --> Orchestrator - ContextDependent -- "Provides context to" --> ParallelLLM - ContextDependent -- "Provides context to" --> Swarm - ContextDependent -- "Provides context to" --> Router - ContextDependent -- "Provides context to" --> IntentClassifier - ContextDependent -- "Provides context to" --> Executor - ContextDependent -- "Provides context to" --> AugmentedLLM - ContextDependent -- "Provides context to" --> MCPConnectionManager -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the agent and workflow framework. - - -## Overview - -The "Agent & Workflow Framework" component is the backbone of the project, defining how AI agents are structured, how they interact, and how complex multi-agent behaviors are orchestrated. It provides the foundational abstractions and patterns necessary for building sophisticated AI systems. - -## Core Components - -### Agent - -The fundamental building block of the AI system. It encapsulates an agent's core logic, capabilities, and interaction patterns, serving as the primary autonomous entity capable of performing tasks. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/agents/agent.py) - -**Key Features:** -- Autonomous task execution -- Core agent logic encapsulation -- Interaction pattern management -- Capability abstraction - -### AugmentedLLM - -Provides a standardized and enhanced interface for interacting with various Large Language Models (LLMs) from different providers. It abstracts away provider-specific details and adds functionalities like prompt augmentation, token management, and structured output, making it the central LLM integration point for all agents and workflows. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py) - -**Key Features:** -- Multi-provider LLM abstraction -- Prompt augmentation -- Token management -- Structured output handling -- Provider-agnostic interface - -### Orchestrator - -A high-level workflow component responsible for coordinating multiple agents, tools, or sub-workflows to achieve complex, multi-step goals. It defines the overall flow and decision-making logic for sequential or conditional processes. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/orchestrator/orchestrator.py) - -**Key Features:** -- Multi-agent coordination -- Sequential workflow management -- Decision-making logic -- Complex goal decomposition - -### ParallelLLM - -Implements a workflow pattern designed for executing multiple LLM calls or agent tasks concurrently. It efficiently manages parallel interactions, distributing tasks (fan-out) and collecting results (fan-in) for improved throughput in multi-task scenarios. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/parallel/parallel_llm.py) - -**Key Features:** -- Concurrent task execution -- Fan-out/fan-in patterns -- Improved throughput -- Parallel LLM interactions - -### Swarm - -Implements a multi-agent workflow pattern where a group of agents collaborates to solve a problem, often exhibiting emergent intelligence through collective action and iterative refinement. It facilitates communication and coordination among a group of agents. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/swarm/swarm.py) - -**Key Features:** -- Multi-agent collaboration -- Emergent intelligence -- Collective problem-solving -- Iterative refinement - -### Router - -A workflow component that intelligently directs incoming requests or tasks to the most appropriate agent, server, or sub-workflow. It makes dynamic routing decisions based on predefined rules or analysis of the request content. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_base.py) - -**Key Features:** -- Intelligent request routing -- Dynamic decision making -- Rule-based routing -- Content analysis - -### IntentClassifier - -A workflow component designed to classify user input or system states into predefined intents. This is crucial for understanding the user's goal and enabling other workflow components (like the Router) to make informed decisions about subsequent actions. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py) - -**Key Features:** -- Intent classification -- User goal understanding -- Predefined intent mapping -- Decision support - -### Executor - -Manages and executes workflows and tasks, providing mechanisms for reliable execution, potentially integrating with durable execution systems. It ensures that complex, long-running agent processes can be reliably executed, paused, resumed, and monitored. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/executor.py) - -**Key Features:** -- Workflow execution management -- Reliable task execution -- Durable execution support -- Process monitoring - -### MCPConnectionManager - -Manages connections and interactions related to the Model Context Protocol (MCP). This component is crucial for enabling communication and data exchange between different parts of the agent system or with external MCP-compliant services, facilitating multi-agent collaboration. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_connection_manager.py) - -**Key Features:** -- MCP connection management -- Inter-agent communication -- Data exchange facilitation -- External service integration - -### ContextDependent - -A foundational abstract base class or pattern that provides a mechanism for components to depend on and interact with a shared `Context` object. It ensures that various parts of the agent system can access common resources, configurations, and state, promoting a consistent and manageable environment. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/core/context.py) - -**Key Features:** -- Shared context management -- Resource access control -- Configuration consistency -- State management diff --git a/docs/codeboarding/analysis.mdx b/docs/codeboarding/analysis.mdx new file mode 100644 index 000000000..3ddb6ef93 --- /dev/null +++ b/docs/codeboarding/analysis.mdx @@ -0,0 +1,111 @@ +--- +title: "Architecture Overview" +description: "Comprehensive architectural overview of the mcp-agent framework" +--- + + +```mermaid +graph LR + Core_Application_Setup["Core Application & Setup"] + Agent_Execution_Workflow_Engine["Agent Execution & Workflow Engine"] + Agent_Core_LLM_Integration["Agent Core & LLM Integration"] + MCP_Service_Integration["MCP Service Integration"] + Agent_Workflow_Patterns["Agent Workflow Patterns"] + Human_Interaction_Layer["Human Interaction Layer"] + Core_Application_Setup -- "Configures" --> Agent_Execution_Workflow_Engine + Core_Application_Setup -- "Configures" --> MCP_Service_Integration + Agent_Execution_Workflow_Engine -- "Manages" --> Agent_Workflow_Patterns + Agent_Execution_Workflow_Engine -- "Requests input from" --> Human_Interaction_Layer + Agent_Core_LLM_Integration -- "Utilizes" --> MCP_Service_Integration + Agent_Core_LLM_Integration -- "Provides capabilities to" --> Agent_Workflow_Patterns + MCP_Service_Integration -- "Provides capabilities to" --> Agent_Core_LLM_Integration + Agent_Workflow_Patterns -- "Orchestrates" --> Agent_Core_LLM_Integration + Agent_Workflow_Patterns -- "Leverages" --> MCP_Service_Integration + Human_Interaction_Layer -- "Provides input to" --> Agent_Execution_Workflow_Engine + click Core_Application_Setup href "/codeboarding/Core_Application_Setup.md" "Details" + click Agent_Execution_Workflow_Engine href "/codeboarding/Agent_Execution_Workflow_Engine.md" "Details" + click Agent_Core_LLM_Integration href "/codeboarding/Agent_Core_LLM_Integration.md" "Details" + click MCP_Service_Integration href "/codeboarding/MCP_Service_Integration.md" "Details" + click Agent_Workflow_Patterns href "/codeboarding/Agent_Workflow_Patterns.md" "Details" + click Human_Interaction_Layer href "/codeboarding/Human_Interaction_Layer.md" "Details" +``` + + +This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. + + +## Details + +The `mcp-agent` project provides a robust framework for developing AI agents. At its core, the **Core Application & Setup** component initializes the entire system and manages configurations. The **Agent Execution & Workflow Engine** then takes over, orchestrating the execution of various **Agent Workflow Patterns** (like orchestration, routing, or parallel processing) which define the agent's high-level behaviors. These workflows, in turn, leverage the **Agent Core & LLM Integration** component to interact with Large Language Models and perform agent-specific actions. The **MCP Service Integration** component is crucial for discovering and connecting to external Model Context Protocol (MCP) servers, providing the necessary tools and resources to the agents. Finally, the **Human Interaction Layer** enables human-in-the-loop capabilities, allowing agents to request and receive input from users, which is then processed by the Execution Engine. + +### Core Application & Setup [[Expand]](./core-application-setup) +Initializes the entire agent framework, establishes the global application context, and manages the loading, parsing, and provision of application settings and sensitive information. It acts as the central orchestrator for the agent's environment and ensures all components operate with correct parameters. + + +**Related Classes/Methods**: + +- `mcp_agent/app.py` (1:1) +- `mcp_agent/config.py` (1:1) + + +### Agent Execution & Workflow Engine [[Expand]](./agent-execution-workflow-engine) +Manages the lifecycle and execution of tasks, activities, and complex workflows. It provides mechanisms for registering executable units and handling their state, supporting both immediate asynchronous execution and durable, long-running workflows. + + +**Related Classes/Methods**: + +- `mcp_agent/executor/executor.py` (1:1) +- `mcp_agent/executor/task_registry.py` (1:1) +- `mcp_agent/executor/signal_registry.py` (1:1) +- `mcp_agent/executor/decorator_registry.py` (1:1) +- `mcp_agent/executor/workflow.py` (1:1) + + +### Agent Core & LLM Integration [[Expand]](./agent-core-llm-integration) +Defines the fundamental interface and capabilities of an AI agent. It encapsulates interactions with Large Language Models (LLMs), external tools, prompts, and resources, providing a consistent and extensible model for agent behavior. It also offers a standardized and augmented interface for interacting with various LLM providers. + + +**Related Classes/Methods**: + +- `mcp_agent/agents/agent.py` (1:1) +- `mcp_agent/workflows/llm/augmented_llm.py` (1:1) +- `mcp_agent/workflows/llm/llm_selector.py` (1:1) + + +### MCP Service Integration [[Expand]](./mcp-service-integration) +Serves as a central point for discovering, collecting, and managing capabilities (tools, prompts, resources) exposed by various Model Context Protocol (MCP) servers. It also manages the underlying network connections and communication sessions with these external services. + + +**Related Classes/Methods**: + +- `mcp_agent/mcp/mcp_aggregator.py` (1:1) +- `mcp_agent/mcp/mcp_connection_manager.py` (1:1) +- `mcp_agent/mcp/mcp_server_registry.py` (1:1) + + +### Agent Workflow Patterns [[Expand]](./agent-workflow-patterns) +Implements various complex, multi-step agent behaviors and patterns. This includes orchestrating sequences of actions, routing requests, classifying user intents, parallelizing LLM calls, and facilitating collaborative problem-solving among multiple agents. + + +**Related Classes/Methods**: + +- `mcp_agent/workflows/orchestrator/orchestrator.py` (1:1) +- `mcp_agent/workflows/router/router_base.py` (1:1) +- `mcp_agent/workflows/intent_classifier/intent_classifier_base.py` (1:1) +- `mcp_agent/workflows/parallel/parallel_llm.py` (1:1) +- `mcp_agent/workflows/swarm/swarm.py` (1:1) + + +### Human Interaction Layer [[Expand]](./human-interaction-layer) +Handles all interactions requiring human input or feedback. It provides mechanisms for agents to request information from users and process their responses, enabling human-in-the-loop workflows. + + +**Related Classes/Methods**: + +- `mcp_agent/human_input/handler.py` (1:1) +- `mcp_agent/human_input/types.py` (1:1) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/docs/codeboarding/core-orchestration-execution.mdx b/docs/codeboarding/core-orchestration-execution.mdx deleted file mode 100644 index 575b09774..000000000 --- a/docs/codeboarding/core-orchestration-execution.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: "Core Orchestration & Execution" -description: "Central orchestration and execution engine for the mcp-agent framework" ---- - -```mermaid -graph LR - MCPApp["MCPApp"] - Settings["Settings"] - Executor["Executor"] - AsyncioExecutor["AsyncioExecutor"] - TemporalExecutor["TemporalExecutor"] - Workflow["Workflow"] - WorkflowRegistry["WorkflowRegistry"] - BaseSignalHandler["BaseSignalHandler"] - TemporalExecutorConfig["TemporalExecutorConfig"] - InteractiveWorkflow["InteractiveWorkflow"] - - MCPApp -- "initializes and depends on" --> Settings - MCPApp -- "orchestrates and utilizes" --> Executor - MCPApp -- "manages and queries" --> WorkflowRegistry - Settings -- "provides configuration to" --> MCPApp - Settings -- "provides configuration to" --> TemporalExecutorConfig - Executor -- "executes" --> Workflow - AsyncioExecutor -- "implements" --> Executor - TemporalExecutor -- "implements" --> Executor - AsyncioExecutor -- "executes" --> Workflow - TemporalExecutor -- "utilizes" --> TemporalExecutorConfig - Workflow -- "interacts with" --> BaseSignalHandler - WorkflowRegistry -- "stores and provides access to" --> Workflow - TemporalExecutorConfig -- "configures" --> TemporalExecutor - TemporalExecutorConfig -- "depends on" --> Settings - InteractiveWorkflow -- "extends" --> Workflow -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the core orchestration and execution layer. - - -## Overview - -The Core Orchestration & Execution component is the central nervous system of the mcp-agent application, responsible for managing the overall application lifecycle, loading global configurations, and orchestrating the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management and enabling sophisticated agentic behaviors. - -## Key Components - -### MCPApp - -The primary application orchestrator and entry point. It is responsible for bootstrapping the application, loading global configurations (Settings), and coordinating the various sub-systems. It manages the lifecycle of the application and delegates the execution of workflows to appropriate executors. - -**Key Features:** -- Application lifecycle management -- Global configuration loading -- Sub-system coordination -- Workflow execution delegation - -### Settings - -This component is responsible for managing and providing access to global application configurations. It loads settings from various sources, making them available to other components that require specific parameters for their operation (e.g., executor configurations, external service credentials). - -**Key Features:** -- Configuration management -- Multi-source settings loading -- Parameter distribution -- Environment-specific configurations - -### Executor - -This is the abstract interface for executing workflows and tasks within the mcp-agent framework. It defines the contract for how executable units are run, allowing for different concrete implementations to handle various execution environments, such as in-process asynchronous execution or durable execution via Temporal.io. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/executor.py#L52-L239) - -### AsyncioExecutor - -A concrete implementation of the Executor interface that handles asynchronous, in-process execution of workflows. It leverages Python's asyncio capabilities for concurrent task management, suitable for short-lived or non-durable workflows. - -**Key Features:** -- Asynchronous execution -- In-process task management -- Concurrent workflow handling -- Suitable for short-lived workflows - -### TemporalExecutor - -A concrete implementation of the Executor interface that provides durable and fault-tolerant workflow execution using the Temporal.io platform. It ensures workflow state persistence, retries, and recovery, critical for long-running or mission-critical agentic processes. - -**Key Features:** -- Durable execution -- Fault tolerance -- State persistence -- Automatic retries and recovery -- Long-running workflow support - -### Workflow - -This serves as the foundational abstraction for defining executable units of work or complex agentic processes. It encapsulates the logic, state, and potential interactions of a workflow, which is then managed and executed by an Executor. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/workflow.py#L71-L528) - -### WorkflowRegistry - -This component is responsible for managing the registration and retrieval of workflow definitions. It acts as a central catalog, making workflows discoverable and available for execution by the system, supporting both in-memory and Temporal-backed storage. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/workflow_registry.py#L19-L146) - -**Key Features:** -- Workflow registration -- Central catalog management -- Discovery and retrieval -- Multiple storage backends - -### BaseSignalHandler - -This component provides the abstract mechanism for handling signals within workflows. Signals are crucial for inter-workflow communication, managing workflow state, and enabling external interactions, which are vital for robust and responsive execution in asynchronous and durable environments. - -**Key Features:** -- Signal handling abstraction -- Inter-workflow communication -- State management -- External interaction support - -### TemporalExecutorConfig - -Defines the specific configuration parameters required for the TemporalExecutor to operate. This includes connection details for the Temporal server and other execution-specific settings, ensuring proper integration with the durable execution backend. - -**Key Features:** -- Temporal server configuration -- Connection management -- Execution-specific settings -- Backend integration - -### InteractiveWorkflow - -A specialized type of Workflow designed to handle human interaction. This component is crucial for agentic systems that require user input or approval at various stages of a workflow, enabling human-in-the-loop processes and complex decision flows. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/executor/temporal/interactive_workflow.py#L20-L83) - -**Key Features:** -- Human interaction support -- User input handling -- Approval workflows -- Human-in-the-loop processes diff --git a/docs/codeboarding/intent-interaction-management.mdx b/docs/codeboarding/intent-interaction-management.mdx deleted file mode 100644 index 2c8f194f0..000000000 --- a/docs/codeboarding/intent-interaction-management.mdx +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: "Intent & Interaction Management" -description: "User intent classification and interaction management for intelligent request routing" ---- - -```mermaid -graph LR - Human_Input_Handler["Human Input Handler"] - Intent_Classifier["Intent Classifier"] - Router["Router"] - Augmented_LLM["Augmented LLM"] - Embedding_Model["Embedding Model"] - Agent["Agent"] - - Human_Input_Handler -- "provides input to" --> Intent_Classifier - Intent_Classifier -- "depends on" --> Augmented_LLM - Intent_Classifier -- "depends on" --> Embedding_Model - Router -- "relies on" --> Intent_Classifier - Router -- "directs to" --> Agent - Augmented_LLM -- "is used by" --> Intent_Classifier - Augmented_LLM -- "is used by" --> Router - Embedding_Model -- "is used by" --> Intent_Classifier - Embedding_Model -- "is used by" --> Router -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the intent and interaction management layer. - - -## Overview - -This component is central to how the AI agent framework understands user needs and directs the flow of execution. It encompasses the mechanisms for receiving user input, interpreting their underlying intent, and subsequently routing the request to the most appropriate agent or workflow. This design allows for flexible and intelligent handling of diverse user interactions, leveraging both advanced language models and efficient embedding techniques. - -## Core Components - -### Human Input Handler - -This component serves as the primary interface for direct human interaction with the agent system. It is responsible for capturing and processing console input, including user commands (e.g., slash commands) and queries. It also facilitates elicitation, allowing the agent to prompt the user for necessary information. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/human_input/handler.py) - -**Key Features:** -- Console input capture -- User command processing -- Slash command support -- Interactive elicitation -- Human-in-the-loop interaction - -### Intent Classifier - -This abstract base component defines the contract for classifying incoming user input or system states into predefined intents. It is crucial for understanding the user's underlying goal or purpose, which is a prerequisite for effective decision-making within the agent system. The framework supports both LLM-based and embedding-based concrete implementations. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py) - -**Key Features:** -- Intent classification abstraction -- User goal understanding -- Predefined intent mapping -- LLM-based classification support -- Embedding-based classification support -- System state interpretation - -### Router - -This abstract base component serves as a central dispatch mechanism within the agent's workflow. Its primary responsibility is to intelligently direct incoming requests or tasks to the most appropriate agent, server, or specific function based on the classified intent and other contextual information. It enables dynamic and flexible routing within the multi-agent orchestration platform. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_base.py) - -**Key Features:** -- Central dispatch mechanism -- Intelligent request routing -- Context-aware decision making -- Dynamic routing capabilities -- Multi-agent orchestration -- Flexible routing strategies - -### Augmented LLM - -This component provides a unified and augmented interface for interacting with various Large Language Models (LLMs) from different providers (e.g., OpenAI, Anthropic, Google GenAI). It abstracts away the complexities of raw LLM APIs, offering functionalities like prompt engineering, token management, and structured output parsing, which are crucial for robust LLM-based intent classification and routing. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py) - -**Key Features:** -- Multi-provider LLM support -- Prompt engineering capabilities -- Token management -- Structured output parsing -- API abstraction -- Intent classification support - -### Embedding Model - -This component provides a standardized interface for generating numerical vector representations (embeddings) of text. These embeddings are fundamental for performing semantic similarity searches and classification tasks, which are utilized in embedding-based intent classification and routing. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_base.py) - -**Key Features:** -- Text embedding generation -- Semantic similarity analysis -- Vector representation -- Classification support -- Standardized interface -- Similarity search capabilities - -### Agent - -A generic agent or workflow that the Router directs requests to. This represents the destination for classified and routed requests within the system. - -**Key Features:** -- Request execution -- Task processing -- Workflow integration -- Agent capabilities - -## Workflow Integration - -The Intent & Interaction Management component integrates seamlessly with the overall agent workflow: - -1. **Input Capture**: The Human Input Handler captures user input from various sources -2. **Intent Analysis**: The Intent Classifier analyzes the input to determine user intent -3. **Routing Decision**: The Router uses the classified intent to make routing decisions -4. **Agent Execution**: The appropriate agent or workflow is selected and executed -5. **Response Delivery**: Results are returned to the user through the appropriate channels - -## Classification Methods - -The framework supports multiple classification approaches: - -- **LLM-based Classification**: Uses large language models for sophisticated intent understanding -- **Embedding-based Classification**: Uses semantic similarity through embeddings for efficient classification -- **Hybrid Approaches**: Combines both methods for optimal performance - -This flexibility allows the system to adapt to different use cases and performance requirements. diff --git a/docs/codeboarding/llm-external-tooling.mdx b/docs/codeboarding/llm-external-tooling.mdx deleted file mode 100644 index 130d50bfd..000000000 --- a/docs/codeboarding/llm-external-tooling.mdx +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: "LLM & External Tooling" -description: "Unified interface for Large Language Models and external tool integration" ---- - -```mermaid -graph LR - AugmentedLLM["AugmentedLLM"] - EmbeddingModel["EmbeddingModel"] - ModelSelector["ModelSelector"] - Multipart_Converters["Multipart Converters"] - Provider_Specific_AugmentedLLM_Implementations["Provider-Specific AugmentedLLM Implementations"] - Provider_Specific_EmbeddingModel_Implementations["Provider-Specific EmbeddingModel Implementations"] - Agent["Agent"] - Orchestrator["Orchestrator"] - Router["Router"] - IntentClassifier["IntentClassifier"] - - Agent -- "depends on" --> AugmentedLLM - Orchestrator -- "coordinates" --> AugmentedLLM - AugmentedLLM -- "utilizes" --> ModelSelector - AugmentedLLM -- "integrates with" --> Multipart_Converters - AugmentedLLM -- "is implemented by" --> Provider_Specific_AugmentedLLM_Implementations - EmbeddingModel -- "is implemented by" --> Provider_Specific_EmbeddingModel_Implementations - Router -- "relies on" --> AugmentedLLM - Router -- "relies on" --> EmbeddingModel - IntentClassifier -- "uses" --> AugmentedLLM - IntentClassifier -- "uses" --> EmbeddingModel -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the LLM and external tooling layer. - - -## Overview - -The LLM & External Tooling component is central to the mcp_agent project, providing the foundational capabilities for interacting with various Large Language Models (LLMs) and embedding services. It embodies the project's architectural bias towards abstraction, extensibility, and modularity, allowing the framework to seamlessly integrate with diverse AI providers and leverage their unique strengths. - -## Core Components - -### AugmentedLLM - -This is the core abstract interface for all Large Language Model (LLM) interactions. It defines a unified API for sending requests and receiving responses from various LLM providers, abstracting away provider-specific details. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm.py#L218-L668) - -**Key Features:** -- Unified LLM API -- Provider abstraction -- Request/response handling -- Cross-provider compatibility - -### EmbeddingModel - -An abstract interface for generating numerical embeddings from text. It provides a consistent way to interact with different embedding service providers. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_base.py#L13-L31) - -**Key Features:** -- Text embedding generation -- Provider-agnostic interface -- Consistent API across providers -- Numerical representation of text - -### ModelSelector - -Responsible for dynamically selecting the most appropriate LLM model based on predefined criteria such as cost, latency, or specific model capabilities. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/llm_selector.py#L96-L413) - -**Key Features:** -- Dynamic model selection -- Cost optimization -- Latency optimization -- Capability-based selection -- Multi-criteria decision making - -### Multipart Converters - -These modules handle the conversion of diverse content types (e.g., text, images, tool calls) between the internal Model Context Protocol (MCP) format and the specific input/output formats required by different LLM providers. - -**Implementation Details:** -- [Anthropic Converter](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/multipart_converter_anthropic.py) -- [OpenAI Converter](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/multipart_converter_openai.py) - -**Key Features:** -- Content type conversion -- MCP format standardization -- Provider-specific formatting -- Multi-modal content handling - -### Provider-Specific AugmentedLLM Implementations - -Concrete implementations of the AugmentedLLM abstract class for specific LLM providers (e.g., Anthropic, OpenAI, Google, Azure, Bedrock, Ollama). These classes contain the actual logic for making API calls to their respective LLM services. - -**Implementation Details:** -- [Anthropic Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py#L110-L722) -- [OpenAI Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/llm/augmented_llm_openai.py#L80-L845) - -**Key Features:** -- Provider-specific API integration -- Authentication handling -- Request formatting -- Response parsing -- Error handling - -### Provider-Specific EmbeddingModel Implementations - -Concrete implementations of the EmbeddingModel abstract class for specific embedding providers (e.g., Cohere, OpenAI). They handle the actual API calls to generate embeddings. - -**Implementation Details:** -- [Cohere Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_cohere.py#L18-L72) -- [OpenAI Implementation](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/embedding/embedding_openai.py#L18-L70) - -**Key Features:** -- Provider-specific embedding APIs -- Vector generation -- Batch processing -- Dimension handling - -## Integration Components - -### Agent - -Represents the core intelligent entity within the framework, responsible for understanding tasks, making decisions, and executing actions, often by interacting with LLMs and external tools. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/agents/agent.py#L56-L931) - -### Orchestrator - -Manages and coordinates complex, multi-step workflows, often involving multiple LLM calls, tool uses, and interactions between different agents. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/orchestrator/orchestrator.py#L45-L585) - -### Router - -Intelligently directs incoming requests or internal queries to the most appropriate LLM or embedding model/service based on context, intent, or other routing criteria. - -**Implementation Details:** -- [LLM Router](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_llm.py#L81-L373) -- [Embedding Router](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/router/router_embedding.py#L28-L239) - -### IntentClassifier - -Determines the underlying intent of a user query or system state, leveraging either LLMs or embedding models for classification. - -**Implementation Details:** -- [LLM Intent Classifier](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py#L63-L243) -- [Embedding Intent Classifier](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py#L32-L177) diff --git a/docs/codeboarding/mcp-api-gateway.mdx b/docs/codeboarding/mcp-api-gateway.mdx deleted file mode 100644 index b55fa7b1d..000000000 --- a/docs/codeboarding/mcp-api-gateway.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: "MCP & API Gateway" -description: "Model Context Protocol gateway and server infrastructure for external communication" ---- - -```mermaid -graph LR - MCPAggregator["MCPAggregator"] - ServerRegistry["ServerRegistry"] - ServerContext["ServerContext"] - MCPConnectionManager["MCPConnectionManager"] - MCPServerSettings["MCPServerSettings"] - Agent["Agent"] - Orchestrator["Orchestrator"] - active_agents["Active Agents"] - workflows["Workflows"] - - MCPAggregator -- "uses" --> MCPConnectionManager - MCPAggregator -- "exposes capabilities to" --> Agent - MCPAggregator -- "exposes capabilities to" --> Orchestrator - ServerRegistry -- "initializes" --> MCPConnectionManager - ServerContext -- "uses" --> ServerRegistry - ServerContext -- "depends on" --> ServerRegistry - ServerContext -- "manages" --> active_agents - ServerContext -- "registers" --> workflows - MCPConnectionManager -- "uses" --> MCPServerSettings - ServerRegistry -- "loads" --> MCPServerSettings -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive insights into the MCP API Gateway infrastructure. - - -## Overview - -The MCP & API Gateway component serves as the primary interface for external communication, exposing agent capabilities and workflows via the Model Context Protocol (MCP) and managing connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. - -This component is fundamental to the MCP & API Gateway subsystem because it collectively manages the entire lifecycle of external communication and capability exposure, aligning with the project's 'AI Agent Framework/Orchestration Platform' nature. - -## Core Components - -### MCPAggregator - -The MCPAggregator is a core component responsible for discovering and consolidating capabilities (tools, prompts, and resources) from multiple MCP servers. It acts as a central point for an agent to access and invoke functionalities provided by various remote or local MCP services. It manages persistent connections to servers and provides methods for listing, reading, and calling these aggregated capabilities. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_aggregator.py) - -**Key Features:** -- Capability aggregation from multiple MCP servers -- Persistent connection management -- Unified interface for tools, prompts, and resources -- Central access point for agent capabilities - -### ServerRegistry - -The ServerRegistry is responsible for managing the configuration and initialization of MCP servers. It loads server configurations from a YAML file, registers initialization hooks, and provides methods to start and initialize server processes based on their defined transport (stdio, streamable HTTP, SSE, websocket). It acts as a directory of available MCP servers. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_server_registry.py) - -**Key Features:** -- Server configuration management -- YAML-based configuration loading -- Transport protocol support (stdio, HTTP, SSE, WebSocket) -- Server initialization and lifecycle management -- Directory of available MCP servers - -### ServerContext - -The ServerContext provides the operational context for the MCP application server. It holds references to the FastMCP instance (the FastAPI application for MCP), manages active agents, and initializes the appropriate workflow registry (either InMemoryWorkflowRegistry for asyncio or TemporalWorkflowRegistry for Temporal.io). It also facilitates the registration of workflows and the creation of workflow-specific tools. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/server/app_server.py) - -**Key Features:** -- FastMCP/FastAPI application management -- Active agent management -- Workflow registry initialization -- Workflow registration and tool creation -- Operational context for MCP server - -### MCPConnectionManager - -The MCPConnectionManager is responsible for establishing, maintaining, and closing connections to various MCP servers. It handles the underlying communication protocols and ensures reliable data exchange between the MCPAggregator and the remote MCP services. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/mcp/mcp_connection_manager.py) - -**Key Features:** -- Connection establishment and management -- Protocol handling for multiple transports -- Reliable data exchange -- Connection lifecycle management -- Error handling and recovery - -### MCPServerSettings - -MCPServerSettings defines the configuration parameters for individual MCP servers, including their transport type (e.g., stdio, http, websocket), host, port, and other connection-related details. It is a foundational data structure for setting up and connecting to MCP services. - -**Implementation Details:** -- [View Source](https://github.com/lastmile-ai/mcp-agent/blob/main/src/mcp_agent/config.py) - -**Key Features:** -- Server configuration parameters -- Transport type specification -- Connection details (host, port, etc.) -- Foundational configuration structure -- Service setup and connection management - -## Architecture Benefits - -The MCP & API Gateway architecture provides several key benefits: - -1. **Unified Interface**: The MCPAggregator consolidates capabilities from disparate MCP servers into a single, unified interface for agents, abstracting away connection complexities. - -2. **Multi-Transport Support**: The ServerRegistry supports multiple transport protocols (stdio, HTTP, SSE, WebSocket), enabling flexible deployment and integration scenarios. - -3. **Scalable Architecture**: The separation of concerns between configuration (MCPServerSettings), registry (ServerRegistry), connection management (MCPConnectionManager), and aggregation (MCPAggregator) enables scalable and maintainable architecture. - -4. **Runtime Flexibility**: The ServerContext provides runtime environment management, supporting both asyncio and Temporal.io execution models. - -5. **External Integration**: The component enables seamless integration with external MCP-compliant services, supporting the 'Multi-Agent Coordination Mechanisms' and 'Tool Use Frameworks' aspects of the platform. diff --git a/docs/codeboarding/overview.mdx b/docs/codeboarding/overview.mdx deleted file mode 100644 index 0c5dbc41f..000000000 --- a/docs/codeboarding/overview.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "Architecture Overview" -description: "Comprehensive architectural overview of the mcp-agent framework" ---- - -```mermaid -graph LR - Core_Orchestration_Execution["Core Orchestration & Execution"] - Agent_Workflow_Framework["Agent & Workflow Framework"] - LLM_External_Tooling["LLM & External Tooling"] - MCP_API_Gateway["MCP & API Gateway"] - Intent_Interaction_Management["Intent & Interaction Management"] - - Core_Orchestration_Execution -- "Initializes/Configures" --> Agent_Workflow_Framework - Core_Orchestration_Execution -- "Manages" --> Agent_Workflow_Framework - Agent_Workflow_Framework -- "Uses" --> LLM_External_Tooling - Agent_Workflow_Framework -- "Executes via" --> Core_Orchestration_Execution - LLM_External_Tooling -- "Provides services to" --> Agent_Workflow_Framework - LLM_External_Tooling -- "Provides services to" --> Intent_Interaction_Management - MCP_API_Gateway -- "Exposes" --> Core_Orchestration_Execution - MCP_API_Gateway -- "Sends requests to" --> Intent_Interaction_Management - Intent_Interaction_Management -- "Routes requests to" --> Core_Orchestration_Execution - Intent_Interaction_Management -- "Utilizes" --> LLM_External_Tooling - - click Core_Orchestration_Execution href "/codeboarding/core-orchestration-execution" "Details" - click Agent_Workflow_Framework href "/codeboarding/agent-workflow-framework" "Details" - click LLM_External_Tooling href "/codeboarding/llm-external-tooling" "Details" - click MCP_API_Gateway href "/codeboarding/mcp-api-gateway" "Details" - click Intent_Interaction_Management href "/codeboarding/intent-interaction-management" "Details" -``` - - -This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework. - - -## Architecture Overview - -The `mcp-agent` project is designed as a robust AI Agent Framework and Orchestration Platform, emphasizing modularity, extensibility, and asynchronous execution. The architecture is centered around five key components that manage the lifecycle, execution, and interaction of AI agents and their workflows. - -### Core Components - -#### [Core Orchestration & Execution](/codeboarding/core-orchestration-execution) -This component is the central nervous system of the application. It handles the overall application lifecycle, loads global configurations, and manages the execution of tasks and complex workflows. It supports both asynchronous and durable execution models, ensuring robust workflow state management. - -**Key Classes**: -- `mcp_agent.app.MCPApp` - Main application orchestrator -- `mcp_agent.config.Settings` - Configuration management -- `mcp_agent.executor.executor.Executor` - Task execution engine -- `mcp_agent.executor.workflow.Workflow` - Workflow management - -#### [Agent & Workflow Framework](/codeboarding/agent-workflow-framework) -This component defines the foundational interfaces and common behaviors for all AI agents. It implements reusable multi-agent workflow patterns (e.g., orchestration, parallel execution, swarm intelligence, evaluation), providing structured approaches for complex agentic behaviors. - -**Key Classes**: -- `mcp_agent.agents.agent.Agent` - Base agent implementation -- `mcp_agent.workflows.orchestrator.orchestrator.Orchestrator` - Orchestration patterns -- `mcp_agent.workflows.parallel.parallel_llm.ParallelLLM` - Parallel execution -- `mcp_agent.workflows.swarm.swarm.Swarm` - Swarm intelligence - -#### [LLM & External Tooling](/codeboarding/llm-external-tooling) -This component provides a unified and abstracted interface for interacting with various Large Language Model (LLM) and embedding providers. It handles model selection, request parameterization, and content conversion. Additionally, it offers a flexible framework for defining and integrating external tools that agents can leverage. - -**Key Classes**: -- `mcp_agent.workflows.llm.augmented_llm.AugmentedLLM` - Enhanced LLM interface -- `mcp_agent.workflows.llm.llm_selector.ModelSelector` - Model selection logic -- `mcp_agent.workflows.embedding.embedding_base.EmbeddingModel` - Embedding models - -#### [MCP & API Gateway](/codeboarding/mcp-api-gateway) -This component serves as the primary interface for external communication. It exposes agent capabilities and workflows via the Model Context Protocol (MCP) and manages connections to other MCP servers. It provides the necessary server-side infrastructure for remote access and interaction. - -**Key Classes**: -- `mcp_agent.mcp.mcp_aggregator.MCPAggregator` - MCP server aggregation -- `mcp_agent.mcp.mcp_server_registry.ServerRegistry` - Server registry -- `mcp_agent.server.app_server.ServerContext` - Server context management - -#### [Intent & Interaction Management](/codeboarding/intent-interaction-management) -This component is responsible for understanding user intent and directing incoming requests or messages to the appropriate agent or workflow. It supports both LLM-based and embedding-based classification methods and manages direct human interaction, including console input and elicitation. - -**Key Classes**: -- `mcp_agent.workflows.router.router_base.Router` - Request routing -- `mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier` - Intent classification -- `mcp_agent.human_input.handler` - Human input handling diff --git a/docs/docs.json b/docs/docs.json index a20447e51..d22b93040 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -66,12 +66,13 @@ { "group": "Architecture", "pages": [ - "codeboarding/overview", - "codeboarding/core-orchestration-execution", - "codeboarding/agent-workflow-framework", - "codeboarding/llm-external-tooling", - "codeboarding/mcp-api-gateway", - "codeboarding/intent-interaction-management" + "codeboarding/analysis", + "codeboarding/Core_Application_Setup", + "codeboarding/Agent_Execution_Workflow_Engine", + "codeboarding/Agent_Core_LLM_Integration", + "codeboarding/Agent_Workflow_Patterns", + "codeboarding/MCP_Service_Integration", + "codeboarding/Human_Interaction_Layer" ] } ] From 56518eb37f72c72edc6ee204454e1fb100005cef Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 7 Jul 2025 03:49:41 +0200 Subject: [PATCH 5/9] Small link fix --- docs/codeboarding/analysis.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/codeboarding/analysis.mdx b/docs/codeboarding/analysis.mdx index 3ddb6ef93..9ab0fa36c 100644 --- a/docs/codeboarding/analysis.mdx +++ b/docs/codeboarding/analysis.mdx @@ -38,7 +38,7 @@ This documentation was generated by [CodeBoarding](https://github.com/CodeBoardi The `mcp-agent` project provides a robust framework for developing AI agents. At its core, the **Core Application & Setup** component initializes the entire system and manages configurations. The **Agent Execution & Workflow Engine** then takes over, orchestrating the execution of various **Agent Workflow Patterns** (like orchestration, routing, or parallel processing) which define the agent's high-level behaviors. These workflows, in turn, leverage the **Agent Core & LLM Integration** component to interact with Large Language Models and perform agent-specific actions. The **MCP Service Integration** component is crucial for discovering and connecting to external Model Context Protocol (MCP) servers, providing the necessary tools and resources to the agents. Finally, the **Human Interaction Layer** enables human-in-the-loop capabilities, allowing agents to request and receive input from users, which is then processed by the Execution Engine. -### Core Application & Setup [[Expand]](./core-application-setup) +### Core Application & Setup [[Expand]](./Core_Application_Setup) Initializes the entire agent framework, establishes the global application context, and manages the loading, parsing, and provision of application settings and sensitive information. It acts as the central orchestrator for the agent's environment and ensures all components operate with correct parameters. @@ -48,7 +48,7 @@ Initializes the entire agent framework, establishes the global application conte - `mcp_agent/config.py` (1:1) -### Agent Execution & Workflow Engine [[Expand]](./agent-execution-workflow-engine) +### Agent Execution & Workflow Engine [[Expand]](./Agent_Execution_Workflow_Engine) Manages the lifecycle and execution of tasks, activities, and complex workflows. It provides mechanisms for registering executable units and handling their state, supporting both immediate asynchronous execution and durable, long-running workflows. @@ -61,7 +61,7 @@ Manages the lifecycle and execution of tasks, activities, and complex workflows. - `mcp_agent/executor/workflow.py` (1:1) -### Agent Core & LLM Integration [[Expand]](./agent-core-llm-integration) +### Agent Core & LLM Integration [[Expand]](./Agent_Core_LLM_Integration) Defines the fundamental interface and capabilities of an AI agent. It encapsulates interactions with Large Language Models (LLMs), external tools, prompts, and resources, providing a consistent and extensible model for agent behavior. It also offers a standardized and augmented interface for interacting with various LLM providers. @@ -72,7 +72,7 @@ Defines the fundamental interface and capabilities of an AI agent. It encapsulat - `mcp_agent/workflows/llm/llm_selector.py` (1:1) -### MCP Service Integration [[Expand]](./mcp-service-integration) +### MCP Service Integration [[Expand]](./MCP_Service_Integration) Serves as a central point for discovering, collecting, and managing capabilities (tools, prompts, resources) exposed by various Model Context Protocol (MCP) servers. It also manages the underlying network connections and communication sessions with these external services. @@ -83,7 +83,7 @@ Serves as a central point for discovering, collecting, and managing capabilities - `mcp_agent/mcp/mcp_server_registry.py` (1:1) -### Agent Workflow Patterns [[Expand]](./agent-workflow-patterns) +### Agent Workflow Patterns [[Expand]](./Agent_Workflow_Patterns) Implements various complex, multi-step agent behaviors and patterns. This includes orchestrating sequences of actions, routing requests, classifying user intents, parallelizing LLM calls, and facilitating collaborative problem-solving among multiple agents. @@ -96,7 +96,7 @@ Implements various complex, multi-step agent behaviors and patterns. This includ - `mcp_agent/workflows/swarm/swarm.py` (1:1) -### Human Interaction Layer [[Expand]](./human-interaction-layer) +### Human Interaction Layer [[Expand]](./Human_Interaction_Layer) Handles all interactions requiring human input or feedback. It provides mechanisms for agents to request information from users and process their responses, enabling human-in-the-loop workflows. From 52fd76fe5cb8eb9e89e310bf4a63819a4788f0a6 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 7 Jul 2025 04:18:32 +0200 Subject: [PATCH 6/9] Updated version --- .github/workflows/doc-updates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-updates.yml b/.github/workflows/doc-updates.yml index 3c8d08ad8..8e220ccf0 100644 --- a/.github/workflows/doc-updates.yml +++ b/.github/workflows/doc-updates.yml @@ -67,7 +67,7 @@ jobs: - name: Fetch CodeBoarding Documentation timeout-minutes: 30 id: codeboarding - uses: CodeBoarding/CodeBoarding-GHAction@v0.1.0 + uses: CodeBoarding/CodeBoarding-GHAction@0.1.2 with: repository_url: ${{ github.event.inputs.repository_url || 'https://github.com/lastmile-ai/mcp-agent' }} source_branch: ${{ steps.set-branches.outputs.source_branch }} From 5a795b2e92a618dfda1c9015d33f877060063047 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 7 Jul 2025 05:00:08 +0200 Subject: [PATCH 7/9] name adjustment --- docs/codeboarding/{analysis.mdx => on_boarding.mdx} | 0 docs/docs.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/codeboarding/{analysis.mdx => on_boarding.mdx} (100%) diff --git a/docs/codeboarding/analysis.mdx b/docs/codeboarding/on_boarding.mdx similarity index 100% rename from docs/codeboarding/analysis.mdx rename to docs/codeboarding/on_boarding.mdx diff --git a/docs/docs.json b/docs/docs.json index d22b93040..074a6e72f 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -66,7 +66,7 @@ { "group": "Architecture", "pages": [ - "codeboarding/analysis", + "codeboarding/on_boarding", "codeboarding/Core_Application_Setup", "codeboarding/Agent_Execution_Workflow_Engine", "codeboarding/Agent_Core_LLM_Integration", From 90163e5701d2df0d63934022e88e1463480fabab Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 7 Jul 2025 05:10:11 +0200 Subject: [PATCH 8/9] fixed references. --- .codeboarding/Agent_Core_LLM_Integration.json | 28 ++++++------ .../Agent_Execution_Workflow_Engine.json | 18 ++++---- .codeboarding/Agent_Workflow_Patterns.json | 44 +++++++++---------- .codeboarding/Core_Application_Setup.json | 32 +++++++------- .codeboarding/MCP_Service_Integration.json | 10 ++--- .codeboarding/analysis.json | 40 ++++++++--------- 6 files changed, 86 insertions(+), 86 deletions(-) diff --git a/.codeboarding/Agent_Core_LLM_Integration.json b/.codeboarding/Agent_Core_LLM_Integration.json index c34e6256b..86daaa209 100644 --- a/.codeboarding/Agent_Core_LLM_Integration.json +++ b/.codeboarding/Agent_Core_LLM_Integration.json @@ -7,7 +7,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.agents.agent.Agent", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/agents/agent.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/agents/agent.py", "reference_start_line": 56, "reference_end_line": 934 } @@ -19,7 +19,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", "reference_start_line": 218, "reference_end_line": 668 } @@ -31,7 +31,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", "reference_start_line": 96, "reference_end_line": 413 } @@ -43,37 +43,37 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", "reference_start_line": 110, "reference_end_line": 722 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_azure.AzureAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", "reference_start_line": 82, "reference_end_line": 491 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", "reference_start_line": 48, "reference_end_line": 349 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_google.GoogleAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", "reference_start_line": 34, "reference_end_line": 319 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_ollama.OllamaAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_ollama.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_ollama.py", "reference_start_line": 16, "reference_end_line": 78 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_openai.OpenAIAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", "reference_start_line": 80, "reference_end_line": 845 } @@ -85,31 +85,31 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicMCPTypeConverter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", "reference_start_line": 777, "reference_end_line": 886 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_azure.MCPAzureTypeConverter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_azure.py", "reference_start_line": 524, "reference_end_line": 614 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_bedrock.BedrockMCPTypeConverter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_bedrock.py", "reference_start_line": 437, "reference_end_line": 499 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_google.GoogleMCPTypeConverter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_google.py", "reference_start_line": 403, "reference_end_line": 518 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_openai.MCPOpenAITypeConverter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_openai.py", "reference_start_line": 949, "reference_end_line": 1055 } diff --git a/.codeboarding/Agent_Execution_Workflow_Engine.json b/.codeboarding/Agent_Execution_Workflow_Engine.json index 291836fc5..2dc5cc681 100644 --- a/.codeboarding/Agent_Execution_Workflow_Engine.json +++ b/.codeboarding/Agent_Execution_Workflow_Engine.json @@ -7,7 +7,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/executor.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/executor.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/executor.py", "reference_start_line": 0, "reference_end_line": 0 }, @@ -25,13 +25,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/workflow.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/workflow.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent/executor/temporal/interactive_workflow.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/temporal/interactive_workflow.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/temporal/interactive_workflow.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -43,7 +43,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/task_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/task_registry.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -55,13 +55,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/signal_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/signal_registry.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent/executor/workflow_signal.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow_signal.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/workflow_signal.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -73,7 +73,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/decorator_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/decorator_registry.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -85,13 +85,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/workflow_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/workflow_registry.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent/executor/temporal/workflow_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/temporal/workflow_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/temporal/workflow_registry.py", "reference_start_line": 0, "reference_end_line": 0 } diff --git a/.codeboarding/Agent_Workflow_Patterns.json b/.codeboarding/Agent_Workflow_Patterns.json index ef351858f..14c0c506c 100644 --- a/.codeboarding/Agent_Workflow_Patterns.json +++ b/.codeboarding/Agent_Workflow_Patterns.json @@ -7,19 +7,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", "reference_start_line": 218, "reference_end_line": 668 }, { "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", "reference_start_line": 96, "reference_end_line": 413 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm_anthropic.AnthropicAugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py", "reference_start_line": 110, "reference_end_line": 722 } @@ -31,19 +31,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.embedding.embedding_base.EmbeddingModel", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_base.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_base.py", "reference_start_line": 13, "reference_end_line": 31 }, { "qualified_name": "mcp_agent.workflows.embedding.embedding_cohere.CohereEmbeddingModel", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_cohere.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_cohere.py", "reference_start_line": 18, "reference_end_line": 72 }, { "qualified_name": "mcp_agent.workflows.embedding.embedding_openai.OpenAIEmbeddingModel", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/embedding/embedding_openai.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/embedding/embedding_openai.py", "reference_start_line": 18, "reference_end_line": 70 } @@ -55,19 +55,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator.Orchestrator", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", "reference_start_line": 45, "reference_end_line": 585 }, { "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_models.AgentTask", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_models.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_models.py", "reference_start_line": 26, "reference_end_line": 31 }, { "qualified_name": "mcp_agent.workflows.orchestrator.orchestrator_prompts", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -79,19 +79,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.router.router_base.Router", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_base.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_base.py", "reference_start_line": 63, "reference_end_line": 275 }, { "qualified_name": "mcp_agent.workflows.router.router_llm.LLMRouter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_llm.py", "reference_start_line": 81, "reference_end_line": 373 }, { "qualified_name": "mcp_agent.workflows.router.router_embedding.EmbeddingRouter", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_embedding.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_embedding.py", "reference_start_line": 28, "reference_end_line": 239 } @@ -103,19 +103,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_base.IntentClassifier", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", "reference_start_line": 42, "reference_end_line": 85 }, { "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_llm.LLMIntentClassifier", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py", "reference_start_line": 63, "reference_end_line": 243 }, { "qualified_name": "mcp_agent.workflows.intent_classifier.intent_classifier_embedding.EmbeddingIntentClassifier", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py", "reference_start_line": 32, "reference_end_line": 177 } @@ -127,19 +127,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.parallel.parallel_llm.ParallelLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", "reference_start_line": 23, "reference_end_line": 279 }, { "qualified_name": "mcp_agent.workflows.parallel.fan_in.FanIn", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/fan_in.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/fan_in.py", "reference_start_line": 30, "reference_end_line": 422 }, { "qualified_name": "mcp_agent.workflows.parallel.fan_out.FanOut", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/fan_out.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/fan_out.py", "reference_start_line": 23, "reference_end_line": 243 } @@ -151,19 +151,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.swarm.swarm.Swarm", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", "reference_start_line": 189, "reference_end_line": 310 }, { "qualified_name": "mcp_agent.workflows.swarm.swarm_anthropic.AnthropicSwarm", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm_anthropic.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm_anthropic.py", "reference_start_line": 8, "reference_end_line": 41 }, { "qualified_name": "mcp_agent.workflows.swarm.swarm_openai.OpenAISwarm", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm_openai.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm_openai.py", "reference_start_line": 8, "reference_end_line": 40 } @@ -175,7 +175,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.evaluator_optimizer.evaluator_optimizer.EvaluatorOptimizerLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py", "reference_start_line": 47, "reference_end_line": 475 } diff --git a/.codeboarding/Core_Application_Setup.json b/.codeboarding/Core_Application_Setup.json index 0b67cf8ed..577b8dcf8 100644 --- a/.codeboarding/Core_Application_Setup.json +++ b/.codeboarding/Core_Application_Setup.json @@ -7,7 +7,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.app.MCPApp", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/app.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/app.py", "reference_start_line": 34, "reference_end_line": 508 } @@ -19,43 +19,43 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.config.Settings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.AnthropicSettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.OpenAISettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.TemporalSettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.AzureSettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.BedrockSettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.config.GoogleSettings", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -67,7 +67,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.executor.decorator_registry.DecoratorRegistry", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/decorator_registry.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -79,7 +79,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.executor.signal_registry.SignalRegistry", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/signal_registry.py", "reference_start_line": 3, "reference_end_line": 29 } @@ -91,7 +91,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.executor.task_registry.ActivityRegistry", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/task_registry.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -103,19 +103,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.mcp.mcp_server_registry.ServerRegistry", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", "reference_start_line": 0, "reference_end_line": 0 }, { "qualified_name": "mcp_agent.mcp.mcp_aggregator.MCPAggregator", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", "reference_start_line": 77, "reference_end_line": 1357 } @@ -127,13 +127,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.workflows.llm.llm_selector.ModelSelector", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", "reference_start_line": 96, "reference_end_line": 413 }, { "qualified_name": "mcp_agent.workflows.llm.augmented_llm.AugmentedLLM", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", "reference_start_line": 218, "reference_end_line": 668 } diff --git a/.codeboarding/MCP_Service_Integration.json b/.codeboarding/MCP_Service_Integration.json index 41cde3966..1b55ab249 100644 --- a/.codeboarding/MCP_Service_Integration.json +++ b/.codeboarding/MCP_Service_Integration.json @@ -7,7 +7,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.mcp_aggregator.MCPAggregator", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", "reference_start_line": 77, "reference_end_line": 1357 } @@ -19,7 +19,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.mcp_connection_manager.MCPConnectionManager", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -31,7 +31,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.mcp_server_registry.ServerRegistry", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -43,7 +43,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.mcp_agent_client_session.MCPClientSession", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_agent_client_session.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_agent_client_session.py", "reference_start_line": 0, "reference_end_line": 0 } @@ -55,7 +55,7 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent.mcp.gen_client", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/gen_client.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/gen_client.py", "reference_start_line": 15, "reference_end_line": 40 } diff --git a/.codeboarding/analysis.json b/.codeboarding/analysis.json index d9b3d5d06..3a73d561e 100644 --- a/.codeboarding/analysis.json +++ b/.codeboarding/analysis.json @@ -7,13 +7,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/app.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/app.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/app.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/config.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/config.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/config.py", "reference_start_line": 1, "reference_end_line": 1 } @@ -25,31 +25,31 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/executor/executor.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/executor.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/executor.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/executor/task_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/task_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/task_registry.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/executor/signal_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/signal_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/signal_registry.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/executor/decorator_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/decorator_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/decorator_registry.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/executor/workflow.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/executor/workflow.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/executor/workflow.py", "reference_start_line": 1, "reference_end_line": 1 } @@ -61,19 +61,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/agents/agent.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/agents/agent.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/agents/agent.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/llm/augmented_llm.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/augmented_llm.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/llm/llm_selector.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/llm/llm_selector.py", "reference_start_line": 1, "reference_end_line": 1 } @@ -85,19 +85,19 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/mcp/mcp_aggregator.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_aggregator.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/mcp/mcp_connection_manager.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_connection_manager.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/mcp/mcp_server_registry.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/mcp/mcp_server_registry.py", "reference_start_line": 1, "reference_end_line": 1 } @@ -109,31 +109,31 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/workflows/orchestrator/orchestrator.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/orchestrator/orchestrator.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/router/router_base.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/router/router_base.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/router/router_base.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/intent_classifier/intent_classifier_base.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/parallel/parallel_llm.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/parallel/parallel_llm.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/workflows/swarm/swarm.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/workflows/swarm/swarm.py", "reference_start_line": 1, "reference_end_line": 1 } @@ -145,13 +145,13 @@ "referenced_source_code": [ { "qualified_name": "mcp_agent/human_input/handler.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/human_input/handler.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/human_input/handler.py", "reference_start_line": 1, "reference_end_line": 1 }, { "qualified_name": "mcp_agent/human_input/types.py", - "reference_file": "/home/ivan/StartUp/CodeBoarding/repos/mcp-agent/src/mcp_agent/human_input/types.py", + "reference_file": "/mnt/e/StartUp/mcp-agent/src/mcp_agent/human_input/types.py", "reference_start_line": 1, "reference_end_line": 1 } From 15d5cb9610d79b65276c4f13e94bd9bc3bff6231 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Thu, 24 Jul 2025 00:04:44 -0700 Subject: [PATCH 9/9] Fixed linking issues. --- docs/codeboarding/on_boarding.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/codeboarding/on_boarding.mdx b/docs/codeboarding/on_boarding.mdx index 9ab0fa36c..0f73455dc 100644 --- a/docs/codeboarding/on_boarding.mdx +++ b/docs/codeboarding/on_boarding.mdx @@ -22,12 +22,12 @@ graph LR Agent_Workflow_Patterns -- "Orchestrates" --> Agent_Core_LLM_Integration Agent_Workflow_Patterns -- "Leverages" --> MCP_Service_Integration Human_Interaction_Layer -- "Provides input to" --> Agent_Execution_Workflow_Engine - click Core_Application_Setup href "/codeboarding/Core_Application_Setup.md" "Details" - click Agent_Execution_Workflow_Engine href "/codeboarding/Agent_Execution_Workflow_Engine.md" "Details" - click Agent_Core_LLM_Integration href "/codeboarding/Agent_Core_LLM_Integration.md" "Details" - click MCP_Service_Integration href "/codeboarding/MCP_Service_Integration.md" "Details" - click Agent_Workflow_Patterns href "/codeboarding/Agent_Workflow_Patterns.md" "Details" - click Human_Interaction_Layer href "/codeboarding/Human_Interaction_Layer.md" "Details" + click Core_Application_Setup href "/codeboarding/Core_Application_Setup.mdx" "Details" + click Agent_Execution_Workflow_Engine href "/codeboarding/Agent_Execution_Workflow_Engine.mdx" "Details" + click Agent_Core_LLM_Integration href "/codeboarding/Agent_Core_LLM_Integration.mdx" "Details" + click MCP_Service_Integration href "/codeboarding/MCP_Service_Integration.mdx" "Details" + click Agent_Workflow_Patterns href "/codeboarding/Agent_Workflow_Patterns.mdx" "Details" + click Human_Interaction_Layer href "/codeboarding/Human_Interaction_Layer.mdx" "Details" ```