feat: pass auth info to local MCP server#122
Merged
sweetmantech merged 7 commits intotestfrom Jan 16, 2026
Merged
Conversation
Add AuthenticatedInMemoryTransport wrapper to inject accountId into MCP tool calls. This allows tools like create_new_artist to resolve the authenticated user without requiring HTTP auth headers. Co-Authored-By: Claude Opus 4.5 <[email protected]>
RED-GREEN-REFACTOR: - Add tests for orgId extraction in validateChatRequest - Add tests for orgId passing in setupToolsForRequest - Update ChatRequestBody type to include orgId - Extract orgId from API key details in validateChatRequest - Pass orgId through AuthenticatedInMemoryTransport to MCP tools This enables MCP tools like create_new_artist to properly resolve organization context when called via org API keys. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Update test files and email handler to include required orgId field. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Pass orgId through getGeneralAgent to getSystemPrompt so the AI model can see the organization context in the system prompt. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Test if system prompt orgId is sufficient without MCP auth injection. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Mock @/lib/keys/getApiKeyDetails and MCP SDK modules to prevent Supabase import chain errors in test files. Co-Authored-By: Claude Opus 4.5 <[email protected]>
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
AuthenticatedInMemoryTransportwrapper to inject auth info into MCP messagesorgIdfrom API key details invalidateChatRequestaccountIdandorgIdto MCP tools via authenticated transportTest plan
validateChatRequestreturningorgIdsetupToolsForRequestwithorgIdcreate_new_artisttool works with proper auth context🤖 Generated with Claude Code