-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(mcp): reuse sessionID for consecutive MCP tool calls, fix dynamic args clearing, fix refreshing tools on save #2158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… args clearing, fix refreshing tools on save
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 5 comments
Summary
Type of Change
Testing
Tested manually
Checklist