module documentation
Undocumented
| Function | build |
Return the per-server {server}-call-tool activity for registration. |
| Function | clear |
Drop the cached tool list for server. |
| Async Function | get |
Return the cached session for server, opening one lazily if needed. |
| Async Function | populate |
Connect to the MCP server, list tools, fill _TOOL_CACHE. |
| Class | _ |
Undocumented |
| Class | _ |
A single MCP session held open by a dedicated owner task. |
| Class | _ |
Undocumented |
| Function | _agent |
Undocumented |
| Async Function | _evict |
Undocumented |
| Async Function | _list |
Undocumented |
| Constant | _CONNECTIONS |
Undocumented |
| Constant | _MCP |
Undocumented |
| Constant | _TOOL |
Undocumented |
def build_call_tool_activity(server:
str, client_factory: Callable[ [], MCPClient], idle_timeout: timedelta | None = None) -> Callable:
(source)
¶
Return the per-server {server}-call-tool activity for registration.
Reuses a worker-process MCP session opened lazily through client_factory. Idle connections are disconnected after idle_timeout (defaults to _MCP_CONNECTION_IDLE).
async def get_connection(server:
str, client_factory: Callable[ [], MCPClient], idle_timeout: timedelta) -> tuple[ MCPClient, ClientSession, _ConnectionRecord]:
(source)
¶
Return the cached session for server, opening one lazily if needed.
Concurrent first-callers dedupe onto a single connect handshake by awaiting the same record. The returned record is acquired; the caller must release() it once the call completes so idle eviction can resume.