Skip to content

⚡ Bolt: [performance improvement] batch fetch MCP OAuth tokens (#36) - #152

Open
Donach wants to merge 1 commit into
cfx/android-hermes-clientfrom
jules-11641741275309263922-ddb46ef2
Open

⚡ Bolt: [performance improvement] batch fetch MCP OAuth tokens (#36)#152
Donach wants to merge 1 commit into
cfx/android-hermes-clientfrom
jules-11641741275309263922-ddb46ef2

Conversation

@Donach

@Donach Donach commented Jul 23, 2026

Copy link
Copy Markdown

⚡ Bolt: [performance improvement] batch fetch MCP OAuth tokens (#36)

💡 What: Implemented a batched token fetch using Drizzle's inArray and populated an in-memory Map to eliminate individual getToken calls inside a loop.
🎯 Why: The injectPerUserOAuthTokens hook in the FeathersJS layer was executing individual getToken database queries for every OAuth MCP server within a Promise.all loop. This caused an N+1 query problem, increasing latency linearly with the number of attached OAuth MCP servers.
📊 Impact: Reduces database queries during token injection from O(N) to O(1), significantly reducing latency for the mcp-servers list route, especially for users with multiple OAuth servers.
🔬 Measurement: Verify by executing the mcp-servers or session-mcp-servers list endpoint and observing the reduced number of Drizzle query logs and faster request completion time.


PR created automatically by Jules for task 11641741275309263922 started by @Donach

💡 What: Implemented a batched token fetch using Drizzle's `inArray` and populated an in-memory Map to eliminate individual `getToken` calls inside a loop.
🎯 Why: The `injectPerUserOAuthTokens` hook in the FeathersJS layer was executing individual `getToken` database queries for every OAuth MCP server within a `Promise.all` loop. This caused an N+1 query problem, increasing latency linearly with the number of attached OAuth MCP servers.
📊 Impact: Reduces database queries during token injection from O(N) to O(1), significantly reducing latency for the `mcp-servers` list route, especially for users with multiple OAuth servers.
🔬 Measurement: Verify by executing the `mcp-servers` or `session-mcp-servers` list endpoint and observing the reduced number of Drizzle query logs and faster request completion time.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant