Skip to content

Commit 9ac2442

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 4719c6d commit 9ac2442

28 files changed

+1556
-1365
lines changed

.codeboarding/Agent_Core.json

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

.codeboarding/Agent_Core.mdx

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"description": "The MCPAgent serves as the central control unit for the LLM agent, managing its lifecycle and interactions. A key aspect of its operation involves dynamically configuring the LLM's context through a system prompt. This is achieved by calling the `create_system_message` function, which acts as the `SystemPromptConstructor`. This function gathers tool descriptions, templates, and other contextual information to build a tailored system prompt. The `MCPAgent` then utilizes this constructed system prompt to initialize and guide its internal `AgentExecutor`, which is responsible for executing the LLM's reasoning and tool interactions. This clear separation of concerns ensures that prompt generation is modular and the `MCPAgent` remains focused on orchestration.",
3+
"components": [
4+
{
5+
"name": "MCPAgent",
6+
"description": "The MCPAgent is the core orchestrator of the LLM agent's lifecycle and execution. It manages the entire interaction flow, from processing user queries and maintaining conversation history to orchestrating LLM reasoning, selecting appropriate tools, and generating responses. It acts as the central decision-making unit, leveraging the `create_system_message` function to configure its LLM context and interacting with external layers for LLM execution and tool management.",
7+
"referenced_source_code": [
8+
{
9+
"qualified_name": "MCPAgent",
10+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/mcpagent.py",
11+
"reference_start_line": 48,
12+
"reference_end_line": 1095
13+
}
14+
],
15+
"can_expand": true
16+
},
17+
{
18+
"name": "SystemPromptConstructor",
19+
"description": "The SystemPromptConstructor is a crucial utility function responsible for dynamically constructing the comprehensive system prompt that guides the `MCPAgent`'s behavior. This involves gathering and formatting tool descriptions, and integrating other contextual information to create an effective and well-structured prompt for the underlying LLM, ensuring the agent has the necessary context to perform its tasks.",
20+
"referenced_source_code": [
21+
{
22+
"qualified_name": "create_system_message",
23+
"reference_file": "/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/prompts/system_prompt_builder.py",
24+
"reference_start_line": 59,
25+
"reference_end_line": 103
26+
}
27+
],
28+
"can_expand": false
29+
}
30+
],
31+
"components_relations": [
32+
{
33+
"relation": "calls",
34+
"src_name": "MCPAgent",
35+
"dst_name": "SystemPromptConstructor"
36+
},
37+
{
38+
"relation": "configures with",
39+
"src_name": "MCPAgent",
40+
"dst_name": "SystemPromptConstructor"
41+
}
42+
]
43+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Agent Orchestration Core
2+
```mermaid
3+
graph LR
4+
MCPAgent["MCPAgent"]
5+
SystemPromptConstructor["SystemPromptConstructor"]
6+
MCPAgent -- "calls" --> SystemPromptConstructor
7+
MCPAgent -- "configures with" --> SystemPromptConstructor
8+
```
9+
10+
### Details
11+
12+
The MCPAgent serves as the central control unit for the LLM agent, managing its lifecycle and interactions. A key aspect of its operation involves dynamically configuring the LLM's context through a system prompt. This is achieved by calling the `create_system_message` function, which acts as the `SystemPromptConstructor`. This function gathers tool descriptions, templates, and other contextual information to build a tailored system prompt. The `MCPAgent` then utilizes this constructed system prompt to initialize and guide its internal `AgentExecutor`, which is responsible for executing the LLM's reasoning and tool interactions. This clear separation of concerns ensures that prompt generation is modular and the `MCPAgent` remains focused on orchestration.
13+
14+
### MCPAgent
15+
The MCPAgent is the core orchestrator of the LLM agent's lifecycle and execution. It manages the entire interaction flow, from processing user queries and maintaining conversation history to orchestrating LLM reasoning, selecting appropriate tools, and generating responses. It acts as the central decision-making unit, leveraging the `create_system_message` function to configure its LLM context and interacting with external layers for LLM execution and tool management.
16+
17+
18+
**Related Classes/Methods**:
19+
20+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/mcpagent.py#L48-L1095" target="_blank" rel="noopener noreferrer">QName:`MCPAgent` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/mcpagent.py`, Lines:(48:1095)</a>
21+
22+
23+
### SystemPromptConstructor
24+
The SystemPromptConstructor is a crucial utility function responsible for dynamically constructing the comprehensive system prompt that guides the `MCPAgent`'s behavior. This involves gathering and formatting tool descriptions, and integrating other contextual information to create an effective and well-structured prompt for the underlying LLM, ensuring the agent has the necessary context to perform its tasks.
25+
26+
27+
**Related Classes/Methods**:
28+
29+
- <a href="https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/prompts/system_prompt_builder.py#L59-L103" target="_blank" rel="noopener noreferrer">QName:`create_system_message` FileRef: `/home/ubuntu/CodeBoarding/repo/mcp-use/mcp_use/agents/prompts/system_prompt_builder.py`, Lines:(59:103)</a>

0 commit comments

Comments
 (0)