feat: accept api_key for authentication in create_new_artist MCP tool#118
Merged
sweetmantech merged 8 commits intotestfrom Jan 15, 2026
Merged
feat: accept api_key for authentication in create_new_artist MCP tool#118sweetmantech merged 8 commits intotestfrom
sweetmantech merged 8 commits intotestfrom
Conversation
- Add optional api_key parameter to resolve account_id automatically - Use getApiKeyDetails to validate API key and get accountId - Support account_id override for org API keys with access validation - Return clear error messages for invalid keys or access denied - Add comprehensive tests for new authentication flow 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 |
- Implement withMcpAuth wrapper for MCP server-level authentication - Remove api_key parameter from create_new_artist tool schema - Tool now receives accountId via extra.authInfo from the auth layer - MCP server accepts API key via Authorization: Bearer or x-api-key header - Update tests to use new auth flow with mock authInfo Co-Authored-By: Claude Opus 4.5 <[email protected]>
Unauthenticated requests will now receive a 401 response. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Follow SRP - move auth verification to its own module. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove x-api-key header support, use only Authorization: Bearer. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Export McpAuthInfo and McpAuthInfoExtra types from verifyApiKey.ts for use in tool handlers. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Move account resolution logic with org access validation to its own module. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
sweetmantech
added a commit
that referenced
this pull request
Jan 15, 2026
…#118) (#119) * feat: accept api_key for authentication in create_new_artist MCP tool - Add optional api_key parameter to resolve account_id automatically - Use getApiKeyDetails to validate API key and get accountId - Support account_id override for org API keys with access validation - Return clear error messages for invalid keys or access denied - Add comprehensive tests for new authentication flow * refactor: move API key authentication to MCP server level - Implement withMcpAuth wrapper for MCP server-level authentication - Remove api_key parameter from create_new_artist tool schema - Tool now receives accountId via extra.authInfo from the auth layer - MCP server accepts API key via Authorization: Bearer or x-api-key header - Update tests to use new auth flow with mock authInfo * feat: require API key authentication for MCP server Unauthenticated requests will now receive a 401 response. * refactor: extract verifyApiKey to lib/mcp/verifyApiKey.ts Follow SRP - move auth verification to its own module. * refactor: use Authorization: Bearer header for MCP API key auth Remove x-api-key header support, use only Authorization: Bearer. * refactor: add McpAuthInfo type for typed auth info access Export McpAuthInfo and McpAuthInfoExtra types from verifyApiKey.ts for use in tool handlers. * refactor: extract resolveAccountId to lib/mcp/resolveAccountId.ts Move account resolution logic with org access validation to its own module. * fix: add index signature to McpAuthInfoExtra for AuthInfo compatibility --------- 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
api_keyparameter tocreate_new_artistMCP toolapi_keyis provided, automatically resolveaccount_idviagetApiKeyDetailsaccount_idoverride for organization API keys (with access validation)account_iddirectly from system promptAuthentication Flow
api_keyprovided → validate and resolveaccountIdaccount_idalso provided → validate org has access to target accountTest plan
🤖 Generated with Claude Code