feat: support custom static auth header injection for remote MCP catalog entries#3724
Open
worthyfarmstead-rgb wants to merge 1 commit intoarchestra-ai:mainfrom
Open
Conversation
…log entries Adds a `headerName` property to userConfig fields, enabling catalog admins to specify that a secret value should be injected as a custom HTTP header (e.g. `x-api-key`) instead of the default `Authorization` header. Backend: iterates over userConfig fields with `headerName` set and injects the corresponding secret as that header for both local and remote transports. Frontend: adds a "Custom header" auth method option with a text input for the header name, and round-trips the configuration through form transforms. Closes archestra-ai#3717 Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
|
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
Adds support for custom static HTTP header injection in MCP catalog entries, enabling integration with upstream MCP servers that require API keys in non-Authorization headers (e.g.
x-api-key).Closes #3717
Problem
Static credentials for remote MCP servers currently only support
Authorizationheader injection viaaccess_tokenorraw_access_token. Many third-party APIs and MCP wrappers expect API keys in custom headers likex-api-key, which today requires a proxy or upstream server modification.Solution
Extends the existing
UserConfigFieldSchemawith an optionalheaderNameproperty. When a catalog admin configures a credential field withheaderName, the backend injects the corresponding secret value as that HTTP header instead of the defaultAuthorizationheader.Changes
Backend (
platform/backend)types/mcp-catalog.ts: AddedheaderName: z.string().optional()toUserConfigFieldSchemaclients/mcp-client.ts: Added custom header injection loop for both local (streamable-http) and remote transport paths — iterates overcatalogItem.userConfigentries and injects any field withheaderNamesetFrontend (
platform/frontend)mcp-catalog-form.types.ts: Addedcustom_headertoauthMethodenum andcustomHeaderNamefieldmcp-catalog-form.utils.ts: Handles form→API and API→form transforms for the new auth methodmcp-catalog-form.tsx: Added "Custom header" radio option with header name input fieldDesign decisions
headerName/headerValue) but extends it to static userConfig fieldsheaderNameare unaffectedaccess_token/raw_access_tokenfallback chainheaderNamevaluesTest plan
x-api-keyx-api-key: <value>