Skip to content

Commit ca5109b

Browse files
committed
docs: update codeboarding documentation
## 📚 Documentation Update This commit contains updated documentation files fetched from the CodeBoarding service. ### 📊 Summary - Documentation files created/updated: 5 - JSON files created/updated: 6 - Documentation directory: .codeboarding/ - JSON directory: .codeboarding/ - Output format: .mdx - Repository analyzed: https://github.com/CodeBoarding/mcp-use The generated .mdx files have been automatically appended to the development documentation. 🤖 This commit was automatically generated by the CodeBoarding documentation update workflow.
1 parent 3d27000 commit ca5109b

12 files changed

+1417
-0
lines changed
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"description": "One paragraph explaining the functionality which is represented by this graph. What the main flow is and what is its purpose.",
3+
"components": [
4+
{
5+
"name": "MCPClient",
6+
"description": "Serves as the primary entry point for users. It is responsible for loading and managing configurations, adding/removing MCP server definitions, and crucially, creating and managing multiple `MCPSession` instances. It acts as the central hub for client-side server and session orchestration.",
7+
"referenced_source_code": [
8+
{
9+
"qualified_name": "mcp_use.client",
10+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/client.py",
11+
"reference_start_line": 0,
12+
"reference_end_line": 0
13+
}
14+
]
15+
},
16+
{
17+
"name": "MCPSession",
18+
"description": "Encapsulates a single, active connection to an MCP server. It handles the low-level details of connecting, disconnecting, and initializing the session, which includes discovering available tools from the connected server. It acts as a wrapper around various `BaseConnector` implementations for actual network communication.",
19+
"referenced_source_code": [
20+
{
21+
"qualified_name": "mcp_use.session",
22+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/session.py",
23+
"reference_start_line": 0,
24+
"reference_end_line": 0
25+
}
26+
]
27+
},
28+
{
29+
"name": "BaseConnector",
30+
"description": "An abstract base class that defines the interface for various network communication protocols (e.g., HTTP, WebSocket, StdIO, Sandbox). Concrete connector implementations inherit from this class, providing the actual mechanism for `MCPSession` to communicate with MCP servers.",
31+
"referenced_source_code": [
32+
{
33+
"qualified_name": "mcp_use.connectors.base",
34+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/connectors/base.py",
35+
"reference_start_line": 0,
36+
"reference_end_line": 0
37+
}
38+
]
39+
},
40+
{
41+
"name": "ServerManager",
42+
"description": "Manages the registry of active MCP servers and their exposed tools. It provides functionalities to register, retrieve, and manage server definitions, which are then utilized by `MCPClient` and `MCPAgent`.",
43+
"referenced_source_code": [
44+
{
45+
"qualified_name": "mcp_use.managers.server_manager",
46+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/managers/server_manager.py",
47+
"reference_start_line": 0,
48+
"reference_end_line": 0
49+
}
50+
]
51+
},
52+
{
53+
"name": "MCPAgent",
54+
"description": "Represents the core LLM agent within the framework. It interacts with `MCPSession` to establish and manage its connection to the MCP server, enabling it to utilize the tools and functionalities exposed by the server for task execution.",
55+
"referenced_source_code": [
56+
{
57+
"qualified_name": "mcp_use.agents.mcpagent",
58+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/agents/mcpagent.py",
59+
"reference_start_line": 0,
60+
"reference_end_line": 0
61+
}
62+
]
63+
},
64+
{
65+
"name": "mcp_use.config",
66+
"description": "This module is responsible for managing configuration settings for the `mcp-use` framework, including server definitions and other operational parameters. It provides mechanisms for loading, saving, and accessing these settings.",
67+
"referenced_source_code": [
68+
{
69+
"qualified_name": "mcp_use.config",
70+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/config.py",
71+
"reference_start_line": 0,
72+
"reference_end_line": 0
73+
}
74+
]
75+
},
76+
{
77+
"name": "mcp_use.logging",
78+
"description": "Provides a centralized logging utility for the entire `mcp-use` framework. It ensures consistent and configurable logging of events, errors, and debugging information across various components, including client and session activities.",
79+
"referenced_source_code": [
80+
{
81+
"qualified_name": "mcp_use.logging",
82+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/logging.py",
83+
"reference_start_line": 0,
84+
"reference_end_line": 0
85+
}
86+
]
87+
},
88+
{
89+
"name": "BaseAdapter",
90+
"description": "An abstract base class for adapters that convert between `mcp-use`'s internal tool representation and external frameworks (e.g., LangChain). While not directly part of session management, it's crucial for the discoverability and usability of tools exposed through sessions.",
91+
"referenced_source_code": [
92+
{
93+
"qualified_name": "mcp_use.adapters.base",
94+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/adapters/base.py",
95+
"reference_start_line": 0,
96+
"reference_end_line": 0
97+
}
98+
]
99+
},
100+
{
101+
"name": "Telemetry",
102+
"description": "This component is responsible for collecting and reporting telemetry data and events related to the framework's operation, including agent executions and client interactions. It provides insights into usage and performance.",
103+
"referenced_source_code": [
104+
{
105+
"qualified_name": "mcp_use.telemetry.telemetry",
106+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/telemetry/telemetry.py",
107+
"reference_start_line": 0,
108+
"reference_end_line": 0
109+
}
110+
]
111+
},
112+
{
113+
"name": "WebSocketConnectionManager",
114+
"description": "Manages the lifecycle of WebSocket connections, handling the low-level details of establishing, maintaining, and closing WebSocket communication channels. It works in conjunction with `WebSocketConnector`.",
115+
"referenced_source_code": [
116+
{
117+
"qualified_name": "mcp_use.task_managers.websocket",
118+
"reference_file": "/mnt/e/StartUp/mcp-use/mcp_use/task_managers/websocket.py",
119+
"reference_start_line": 0,
120+
"reference_end_line": 0
121+
}
122+
]
123+
}
124+
],
125+
"components_relations": [
126+
{
127+
"relation": "creates and manages",
128+
"src_name": "MCPClient",
129+
"dst_name": "MCPSession"
130+
},
131+
{
132+
"relation": "uses",
133+
"src_name": "MCPClient",
134+
"dst_name": "ServerManager"
135+
},
136+
{
137+
"relation": "uses",
138+
"src_name": "MCPClient",
139+
"dst_name": "mcp_use.config"
140+
},
141+
{
142+
"relation": "uses",
143+
"src_name": "MCPClient",
144+
"dst_name": "mcp_use.logging"
145+
},
146+
{
147+
"relation": "uses",
148+
"src_name": "MCPClient",
149+
"dst_name": "Telemetry"
150+
},
151+
{
152+
"relation": "uses",
153+
"src_name": "MCPSession",
154+
"dst_name": "BaseConnector"
155+
},
156+
{
157+
"relation": "uses",
158+
"src_name": "MCPSession",
159+
"dst_name": "mcp_use.logging"
160+
},
161+
{
162+
"relation": "uses",
163+
"src_name": "MCPAgent",
164+
"dst_name": "MCPSession"
165+
},
166+
{
167+
"relation": "uses",
168+
"src_name": "MCPAgent",
169+
"dst_name": "ServerManager"
170+
},
171+
{
172+
"relation": "uses",
173+
"src_name": "MCPAgent",
174+
"dst_name": "Telemetry"
175+
},
176+
{
177+
"relation": "uses",
178+
"src_name": "ServerManager",
179+
"dst_name": "BaseAdapter"
180+
}
181+
]
182+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: "Client Session Management"
3+
description: "Client Session Management component details"
4+
---
5+
6+
7+
```mermaid
8+
graph LR
9+
MCPClient["MCPClient"]
10+
MCPSession["MCPSession"]
11+
BaseConnector["BaseConnector"]
12+
ServerManager["ServerManager"]
13+
MCPAgent["MCPAgent"]
14+
mcp_use_config["mcp_use.config"]
15+
mcp_use_logging["mcp_use.logging"]
16+
BaseAdapter["BaseAdapter"]
17+
Telemetry["Telemetry"]
18+
WebSocketConnectionManager["WebSocketConnectionManager"]
19+
MCPClient -- "creates and manages" --> MCPSession
20+
MCPClient -- "uses" --> ServerManager
21+
MCPClient -- "uses" --> mcp_use_config
22+
MCPClient -- "uses" --> mcp_use_logging
23+
MCPClient -- "uses" --> Telemetry
24+
MCPSession -- "uses" --> BaseConnector
25+
MCPSession -- "uses" --> mcp_use_logging
26+
MCPAgent -- "uses" --> MCPSession
27+
MCPAgent -- "uses" --> ServerManager
28+
MCPAgent -- "uses" --> Telemetry
29+
ServerManager -- "uses" --> BaseAdapter
30+
```
31+
32+
<Info>
33+
This documentation was generated by [CodeBoarding](https://github.com/CodeBoarding/GeneratedOnBoardings) to provide comprehensive architectural insights into the mcp-agent framework.
34+
</Info>
35+
36+
## Details
37+
38+
One paragraph explaining the functionality which is represented by this graph. What the main flow is and what is its purpose.
39+
40+
### MCPClient
41+
Serves as the primary entry point for users. It is responsible for loading and managing configurations, adding/removing MCP server definitions, and crucially, creating and managing multiple `MCPSession` instances. It acts as the central hub for client-side server and session orchestration.
42+
43+
44+
**Related Classes/Methods**:
45+
46+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/client.py" target="_blank" rel="noopener noreferrer">`mcp_use.client`</a>
47+
48+
49+
### MCPSession
50+
Encapsulates a single, active connection to an MCP server. It handles the low-level details of connecting, disconnecting, and initializing the session, which includes discovering available tools from the connected server. It acts as a wrapper around various `BaseConnector` implementations for actual network communication.
51+
52+
53+
**Related Classes/Methods**:
54+
55+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/session.py" target="_blank" rel="noopener noreferrer">`mcp_use.session`</a>
56+
57+
58+
### BaseConnector
59+
An abstract base class that defines the interface for various network communication protocols (e.g., HTTP, WebSocket, StdIO, Sandbox). Concrete connector implementations inherit from this class, providing the actual mechanism for `MCPSession` to communicate with MCP servers.
60+
61+
62+
**Related Classes/Methods**:
63+
64+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/connectors/base.py" target="_blank" rel="noopener noreferrer">`mcp_use.connectors.base`</a>
65+
66+
67+
### ServerManager
68+
Manages the registry of active MCP servers and their exposed tools. It provides functionalities to register, retrieve, and manage server definitions, which are then utilized by `MCPClient` and `MCPAgent`.
69+
70+
71+
**Related Classes/Methods**:
72+
73+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/managers/server_manager.py" target="_blank" rel="noopener noreferrer">`mcp_use.managers.server_manager`</a>
74+
75+
76+
### MCPAgent
77+
Represents the core LLM agent within the framework. It interacts with `MCPSession` to establish and manage its connection to the MCP server, enabling it to utilize the tools and functionalities exposed by the server for task execution.
78+
79+
80+
**Related Classes/Methods**:
81+
82+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/agents/mcpagent.py" target="_blank" rel="noopener noreferrer">`mcp_use.agents.mcpagent`</a>
83+
84+
85+
### mcp_use.config
86+
This module is responsible for managing configuration settings for the `mcp-use` framework, including server definitions and other operational parameters. It provides mechanisms for loading, saving, and accessing these settings.
87+
88+
89+
**Related Classes/Methods**:
90+
91+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/config.py" target="_blank" rel="noopener noreferrer">`mcp_use.config`</a>
92+
93+
94+
### mcp_use.logging
95+
Provides a centralized logging utility for the entire `mcp-use` framework. It ensures consistent and configurable logging of events, errors, and debugging information across various components, including client and session activities.
96+
97+
98+
**Related Classes/Methods**:
99+
100+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/logging.py" target="_blank" rel="noopener noreferrer">`mcp_use.logging`</a>
101+
102+
103+
### BaseAdapter
104+
An abstract base class for adapters that convert between `mcp-use`'s internal tool representation and external frameworks (e.g., LangChain). While not directly part of session management, it's crucial for the discoverability and usability of tools exposed through sessions.
105+
106+
107+
**Related Classes/Methods**:
108+
109+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/adapters/base.py" target="_blank" rel="noopener noreferrer">`mcp_use.adapters.base`</a>
110+
111+
112+
### Telemetry
113+
This component is responsible for collecting and reporting telemetry data and events related to the framework's operation, including agent executions and client interactions. It provides insights into usage and performance.
114+
115+
116+
**Related Classes/Methods**:
117+
118+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/telemetry/telemetry.py" target="_blank" rel="noopener noreferrer">`mcp_use.telemetry.telemetry`</a>
119+
120+
121+
### WebSocketConnectionManager
122+
Manages the lifecycle of WebSocket connections, handling the low-level details of establishing, maintaining, and closing WebSocket communication channels. It works in conjunction with `WebSocketConnector`.
123+
124+
125+
**Related Classes/Methods**:
126+
127+
- <a href="https://github.com/CodeBoarding/mcp-use/blob/main/mcp_use/task_managers/websocket.py" target="_blank" rel="noopener noreferrer">`mcp_use.task_managers.websocket`</a>
128+
129+
130+
131+
132+
### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)

0 commit comments

Comments
 (0)