Skip to content

Commit 4719c6d

Browse files
committed
docs: update codeboarding documentation and generate architecture
## 📚 Documentation Update This commit contains updated documentation files fetched from the CodeBoarding service and automatically generated architecture documentation. ### 📊 Summary - Documentation files created/updated: 7 - JSON files created/updated: 8 - Documentation directory: .codeboarding/ - JSON directory: .codeboarding/ - Output format: .mdx - Repository analyzed: https://github.com/mcp-use/mcp-use - Architecture documentation: docs/development/architecture.mdx (auto-generated) The generated .mdx files have been automatically appended to the development documentation, and the architecture.mdx file has been generated from the CodeBoarding analysis files. 🤖 This commit was automatically generated by the CodeBoarding documentation update workflow.
1 parent 8be3184 commit 4719c6d

20 files changed

+1407
-920
lines changed

.codeboarding/Agent_Core.json

Lines changed: 38 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,74 @@
11
{
2-
"description": "The `Agent Core` subsystem is the central orchestrator within the `mcp-use` framework, responsible for the agent's decision-making, lifecycle, and overall execution flow. It integrates various components to interact with the external environment and manage its operational state.",
2+
"description": "The Agent Core subsystem is the central intelligence unit responsible for orchestrating AI agent behavior, managing conversation flow, and coordinating tool usage within the mcp_use project. It is primarily encapsulated within the mcp_use.agents package.",
33
"components": [
44
{
5-
"name": "Agent Core",
6-
"description": "The primary intelligence and orchestration unit. It manages the agent's lifecycle, decision-making processes, and coordinates interactions with other components to execute tasks and communicate with external services.",
5+
"name": "MCPAgent",
6+
"description": "The central orchestrator and concrete implementation of an AI agent. It manages the agent's reasoning loop, maintains conversation history, integrates with Large Language Models (LLMs), handles tool execution, and processes structured outputs. It embodies the core intelligence and operational flow of the agent.",
77
"referenced_source_code": [
88
{
99
"qualified_name": "mcp_use.agents.mcpagent.MCPAgent",
10-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/agents/mcpagent.py",
11-
"reference_start_line": 1,
12-
"reference_end_line": 1
10+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/mcpagent.py",
11+
"reference_start_line": 44,
12+
"reference_end_line": 1011
1313
}
14-
]
14+
],
15+
"can_expand": true
1516
},
1617
{
17-
"name": "Base Agent",
18-
"description": "Provides the foundational structure and common functionalities for all agents within the framework. It serves as an abstract base class that `Agent Core` extends.",
18+
"name": "BaseAgent",
19+
"description": "An abstract base class that defines the foundational interface and common behaviors for all agents within the framework. It establishes a contract for agent lifecycle management (e.g., initialization, execution, querying) and state tracking (e.g., maximum steps, previous steps).",
1920
"referenced_source_code": [
2021
{
2122
"qualified_name": "mcp_use.agents.base.BaseAgent",
22-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/agents/base.py",
23-
"reference_start_line": 1,
24-
"reference_end_line": 1
23+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/base.py",
24+
"reference_start_line": 13,
25+
"reference_end_line": 61
2526
}
26-
]
27+
],
28+
"can_expand": true
2729
},
2830
{
29-
"name": "MCP Server Registry/Connector",
30-
"description": "Manages connections and interactions with various MCP (Multi-Agent Communication Protocol) servers. It acts as an interface for the `Agent Core` to discover and communicate with available services.",
31+
"name": "SystemPromptBuilder",
32+
"description": "A utility component responsible for dynamically constructing the system prompt provided to the LLM. It incorporates descriptions of available tools, additional instructions, and selects appropriate prompt templates based on the agent's configuration.",
3133
"referenced_source_code": [
3234
{
33-
"qualified_name": "mcp_use.managers.server_manager.ServerManager",
34-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/managers/server_manager.py",
35-
"reference_start_line": 16,
36-
"reference_end_line": 89
37-
}
38-
]
39-
},
40-
{
41-
"name": "LLM Integration Layer",
42-
"description": "Facilitates the processing of outputs from Large Language Models (LLMs) and integrates with LangChain-based tools. It acts as an adapter, translating agent requests into LLM-compatible formats and vice-versa.",
43-
"referenced_source_code": [
44-
{
45-
"qualified_name": "mcp_use.adapters.langchain_adapter.LangChainAdapter",
46-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/adapters/langchain_adapter.py",
35+
"qualified_name": "mcp_use.agents.prompts.system_prompt_builder.SystemPromptBuilder",
36+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/prompts/system_prompt_builder.py",
4737
"reference_start_line": 1,
48-
"reference_end_line": 1
38+
"reference_end_line": 1000
4939
}
50-
]
40+
],
41+
"can_expand": true
5142
},
5243
{
53-
"name": "Telemetry",
54-
"description": "Responsible for emitting telemetry events, providing insights into the agent's operational status, performance, and interactions. This component supports observability within the `Agent Core` subsystem.",
44+
"name": "RemoteAgent",
45+
"description": "A specialized agent implementation or a component that facilitates communication with external, remotely hosted agent services. It handles the serialization of requests, deserialization of responses, and manages underlying network interactions (e.g., API keys, base URLs). It also includes logic for parsing structured output received from remote services.",
5546
"referenced_source_code": [
5647
{
57-
"qualified_name": "mcp_use.telemetry.telemetry.Telemetry",
58-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/telemetry/telemetry.py",
59-
"reference_start_line": 55,
60-
"reference_end_line": 305
48+
"qualified_name": "mcp_use.agents.remote.RemoteAgent",
49+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/remote.py",
50+
"reference_start_line": 18,
51+
"reference_end_line": 239
6152
}
62-
]
63-
},
64-
{
65-
"name": "MCP Session",
66-
"description": "Manages the state and context of an agent's session. It encapsulates session-specific data and provides mechanisms for maintaining continuity across interactions.",
67-
"referenced_source_code": [
68-
{
69-
"qualified_name": "mcp_use.session.MCPSession",
70-
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/session.py",
71-
"reference_start_line": 1,
72-
"reference_end_line": 1
73-
}
74-
]
53+
],
54+
"can_expand": true
7555
}
7656
],
7757
"components_relations": [
7858
{
79-
"relation": "uses",
80-
"src_name": "Agent Core",
81-
"dst_name": "MCP Server Registry/Connector"
82-
},
83-
{
84-
"relation": "uses",
85-
"src_name": "Agent Core",
86-
"dst_name": "LLM Integration Layer"
59+
"relation": "inherits from",
60+
"src_name": "MCPAgent",
61+
"dst_name": "BaseAgent"
8762
},
8863
{
8964
"relation": "uses",
90-
"src_name": "Agent Core",
91-
"dst_name": "Telemetry"
65+
"src_name": "MCPAgent",
66+
"dst_name": "SystemPromptBuilder"
9267
},
9368
{
94-
"relation": "is related to",
95-
"src_name": "Agent Core",
96-
"dst_name": "MCP Session"
97-
},
98-
{
99-
"relation": "inherits from",
100-
"src_name": "Agent Core",
101-
"dst_name": "Base Agent"
69+
"relation": "delegates to",
70+
"src_name": "MCPAgent",
71+
"dst_name": "RemoteAgent"
10272
}
10373
]
10474
}

.codeboarding/Agent_Core.mdx

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,50 @@
11
# Agent Core
22
```mermaid
33
graph LR
4-
Agent_Core["Agent Core"]
5-
Base_Agent["Base Agent"]
6-
MCP_Server_Registry_Connector["MCP Server Registry/Connector"]
7-
LLM_Integration_Layer["LLM Integration Layer"]
8-
Telemetry["Telemetry"]
9-
MCP_Session["MCP Session"]
10-
Agent_Core -- "uses" --> MCP_Server_Registry_Connector
11-
Agent_Core -- "uses" --> LLM_Integration_Layer
12-
Agent_Core -- "uses" --> Telemetry
13-
Agent_Core -- "is related to" --> MCP_Session
14-
Agent_Core -- "inherits from" --> Base_Agent
15-
click Agent_Core href "/codeboarding/Agent_Core.md" "Details"
4+
MCPAgent["MCPAgent"]
5+
BaseAgent["BaseAgent"]
6+
SystemPromptBuilder["SystemPromptBuilder"]
7+
RemoteAgent["RemoteAgent"]
8+
MCPAgent -- "inherits from" --> BaseAgent
9+
MCPAgent -- "uses" --> SystemPromptBuilder
10+
MCPAgent -- "delegates to" --> RemoteAgent
1611
```
1712

1813
### Details
1914

20-
The `Agent Core` subsystem is the central orchestrator within the `mcp-use` framework, responsible for the agent's decision-making, lifecycle, and overall execution flow. It integrates various components to interact with the external environment and manage its operational state.
15+
The Agent Core subsystem is the central intelligence unit responsible for orchestrating AI agent behavior, managing conversation flow, and coordinating tool usage within the mcp_use project. It is primarily encapsulated within the mcp_use.agents package.
2116

22-
### Agent Core
23-
The primary intelligence and orchestration unit. It manages the agent's lifecycle, decision-making processes, and coordinates interactions with other components to execute tasks and communicate with external services.
17+
### MCPAgent
18+
The central orchestrator and concrete implementation of an AI agent. It manages the agent's reasoning loop, maintains conversation history, integrates with Large Language Models (LLMs), handles tool execution, and processes structured outputs. It embodies the core intelligence and operational flow of the agent.
2419

2520

2621
**Related Classes/Methods**:
2722

28-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/mcpagent.py#L1-L1" target="_blank" rel="noopener noreferrer">`mcp_use.agents.mcpagent.MCPAgent` (1:1)</a>
23+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/mcpagent.py#L44-L1011" target="_blank" rel="noopener noreferrer">QName:`mcp_use.agents.mcpagent.MCPAgent` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/mcpagent.py`, Lines:(44:1011)</a>
2924

3025

31-
### Base Agent
32-
Provides the foundational structure and common functionalities for all agents within the framework. It serves as an abstract base class that `Agent Core` extends.
26+
### BaseAgent
27+
An abstract base class that defines the foundational interface and common behaviors for all agents within the framework. It establishes a contract for agent lifecycle management (e.g., initialization, execution, querying) and state tracking (e.g., maximum steps, previous steps).
3328

3429

3530
**Related Classes/Methods**:
3631

37-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/base.py#L1-L1" target="_blank" rel="noopener noreferrer">`mcp_use.agents.base.BaseAgent` (1:1)</a>
32+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/base.py#L13-L61" target="_blank" rel="noopener noreferrer">QName:`mcp_use.agents.base.BaseAgent` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/base.py`, Lines:(13:61)</a>
3833

3934

40-
### MCP Server Registry/Connector
41-
Manages connections and interactions with various MCP (Multi-Agent Communication Protocol) servers. It acts as an interface for the `Agent Core` to discover and communicate with available services.
35+
### SystemPromptBuilder
36+
A utility component responsible for dynamically constructing the system prompt provided to the LLM. It incorporates descriptions of available tools, additional instructions, and selects appropriate prompt templates based on the agent's configuration.
4237

4338

4439
**Related Classes/Methods**:
4540

46-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/managers/server_manager.py#L16-L89" target="_blank" rel="noopener noreferrer">`mcp_use.managers.server_manager.ServerManager` (16:89)</a>
41+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/prompts/system_prompt_builder.py#L1-L1000" target="_blank" rel="noopener noreferrer">QName:`mcp_use.agents.prompts.system_prompt_builder.SystemPromptBuilder` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/prompts/system_prompt_builder.py`, Lines:(1:1000)</a>
4742

4843

49-
### LLM Integration Layer
50-
Facilitates the processing of outputs from Large Language Models (LLMs) and integrates with LangChain-based tools. It acts as an adapter, translating agent requests into LLM-compatible formats and vice-versa.
44+
### RemoteAgent
45+
A specialized agent implementation or a component that facilitates communication with external, remotely hosted agent services. It handles the serialization of requests, deserialization of responses, and manages underlying network interactions (e.g., API keys, base URLs). It also includes logic for parsing structured output received from remote services.
5146

5247

5348
**Related Classes/Methods**:
5449

55-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/adapters/langchain_adapter.py#L1-L1" target="_blank" rel="noopener noreferrer">`mcp_use.adapters.langchain_adapter.LangChainAdapter` (1:1)</a>
56-
57-
58-
### Telemetry
59-
Responsible for emitting telemetry events, providing insights into the agent's operational status, performance, and interactions. This component supports observability within the `Agent Core` subsystem.
60-
61-
62-
**Related Classes/Methods**:
63-
64-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/telemetry/telemetry.py#L55-L305" target="_blank" rel="noopener noreferrer">`mcp_use.telemetry.telemetry.Telemetry` (55:305)</a>
65-
66-
67-
### MCP Session
68-
Manages the state and context of an agent's session. It encapsulates session-specific data and provides mechanisms for maintaining continuity across interactions.
69-
70-
71-
**Related Classes/Methods**:
72-
73-
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/session.py#L1-L1" target="_blank" rel="noopener noreferrer">`mcp_use.session.MCPSession` (1:1)</a>
50+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/remote.py#L18-L239" target="_blank" rel="noopener noreferrer">QName:`mcp_use.agents.remote.RemoteAgent` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/remote.py`, Lines:(18:239)</a>

.codeboarding/Client_Server_Connectivity.json

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)