my browser agent repo i have 2 MCP, one which i created myself which has all bro#380
my browser agent repo i have 2 MCP, one which i created myself which has all bro#380shivammittal274 wants to merge 2 commits intomainfrom
Conversation
…myself which has all bro Task ID: k0jwkDy_
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. To sign the CLA, please add a comment to this PR with the following text: You only need to sign once. After signing, this check will pass automatically. Troubleshooting
You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**. |
Greptile SummaryThis PR adds Klavis MCP tool integration to unify external tools (Gmail, Slack, etc.) with the browser MCP server. It introduces a pooling mechanism with TTL-based eviction to manage Klavis Strata instances and proxy their tools into the main MCP server. Key Changes:
Issues Found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as MCP Client
participant Route as MCP Route Handler
participant Pool as KlavisStrataPool
participant KlavisAPI as Klavis API
participant Strata as Klavis Strata
participant MCP as MCP Server
Client->>Route: POST /mcp (with X-Enabled-MCP-Servers)
Route->>Pool: ensureTools(browserosId, enabledServers)
alt Cache miss or expired
Pool->>KlavisAPI: createStrata(userId, servers)
KlavisAPI-->>Pool: strataServerUrl
Pool->>Strata: POST tools/list
Strata-->>Pool: [tool descriptors]
Pool->>MCP: registerTool(resolvedName, handler)
Note over Pool,MCP: Handles name collisions<br/>by prefixing with klavis_
Pool-->>Route: Tools registered
else Cache hit
Pool-->>Route: Tools already registered
end
Route->>MCP: connect(transport)
MCP-->>Client: Tool list (browser + Klavis)
Client->>MCP: Call Klavis tool
MCP->>Pool: executeToolCall(toolName, args)
Pool->>Strata: POST tools/call
Strata-->>Pool: result
Pool-->>MCP: content + isError
MCP-->>Client: Tool result
Last reviewed commit: 87c4519 |
| const pool = deps.browserosId | ||
| ? new KlavisStrataPool(new KlavisClient(), mcpServer, browserToolNames) | ||
| : undefined |
There was a problem hiding this comment.
Memory leak - pool instance is never disposed. The pool has a setInterval timer (line 34 in klavis-strata-pool.ts) that will run indefinitely. Store the pool at module or server level and call pool.dispose() on server shutdown.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/server/src/api/routes/mcp.ts
Line: 30-32
Comment:
Memory leak - `pool` instance is never disposed. The pool has a `setInterval` timer (line 34 in klavis-strata-pool.ts) that will run indefinitely. Store the pool at module or server level and call `pool.dispose()` on server shutdown.
How can I resolve this? If you propose a fix, please make it concise.
Summary
my browser agent repo i have 2 MCP, one which i created myself which has all browser mcp tools, and second i have klavis mcp, which is used to check all like gmail, slack etc, klavis exposes all third party tools directly, so if you check tool loop agent or single agent, i am passng klavis mcp urls directly, i need to expose klavis mcp tools within browser mcp as well, so that this can be unified, current agent has thode 2 MCP, i am thinking can we unify in one, lets thonk and try to work
Changes
Agent Metadata
Generated by coding-agent v3