fix(mcp): reuse sessionID for consecutive MCP tool calls, fix dynamic args clearing, fix refreshing tools on save#2158
Merged
waleedlatif1 merged 5 commits intostagingfrom Dec 2, 2025
Merged
Conversation
… args clearing, fix refreshing tools on save
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryThis PR implements session ID reuse for consecutive MCP tool calls, fixes dynamic parameter clearing, and improves autofill prevention in form inputs. Key changes:
Issues found:
Confidence Score: 2/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Component as MCP Dynamic Args
participant Service as MCP Service
participant Client as MCP Client
participant Transport as StreamableHTTPTransport
participant Server as MCP Server
User->>Component: Enter tool parameter
Component->>Component: updateParameter()
Note over Component: Check if value empty<br/>Clear param if empty<br/>Otherwise update args
User->>Service: Execute MCP tool
Service->>Service: getCachedSessionId(serverId)
alt Session ID cached
Service->>Client: new McpClient(config, policy, cachedSessionId)
Client->>Transport: new StreamableHTTPTransport(url, {sessionId})
Client->>Server: connect() with cached session
alt Session valid
Server-->>Client: Connected
Client->>Service: getSessionId()
Service->>Service: cacheSessionId(serverId, sessionId)
else Session invalid/expired
Server-->>Client: Session error
Service->>Service: isSessionError() checks message
Service->>Service: clearCachedSessionId(serverId)
Service->>Client: new McpClient(config, policy) [fresh]
Client->>Transport: new StreamableHTTPTransport(url)
Client->>Server: connect() without session
Server-->>Client: Connected
Client->>Service: getSessionId()
Service->>Service: cacheSessionId(serverId, newSessionId)
end
else No cached session
Service->>Client: new McpClient(config, policy)
Client->>Transport: new StreamableHTTPTransport(url)
Client->>Server: connect()
Server-->>Client: Connected
Client->>Service: getSessionId()
Service->>Service: cacheSessionId(serverId, sessionId)
end
Service->>Client: callTool(toolCall)
Client->>Server: Execute tool
Server-->>Client: Tool result
Client-->>Service: Tool result
Service->>Client: disconnect()
Service-->>User: Tool result
|
...anel/components/editor/components/sub-block/components/mcp-dynamic-args/mcp-dynamic-args.tsx
Outdated
Show resolved
Hide resolved
...anel/components/editor/components/sub-block/components/mcp-dynamic-args/mcp-dynamic-args.tsx
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist