Skip to content

fix(plugin-mcp): accept Payload API key auth scheme#16715

Open
Baijack-star wants to merge 1 commit into
payloadcms:mainfrom
Baijack-star:fix-plugin-mcp-api-key-auth
Open

fix(plugin-mcp): accept Payload API key auth scheme#16715
Baijack-star wants to merge 1 commit into
payloadcms:mainfrom
Baijack-star:fix-plugin-mcp-api-key-auth

Conversation

@Baijack-star
Copy link
Copy Markdown

Summary

  • parse MCP API keys from both Authorization: Bearer <key> and Payload convention Authorization: payload-mcp-api-keys API-Key <key>
  • fix getDefaultMcpAccessSettings(overrideApiKey) so an override key is used directly instead of being lost to the previous ?? / ternary precedence shape
  • add integration coverage for tools/list using the Payload API-Key authorization scheme
  • update MCP docs to mention both accepted authorization forms

Verification

  • git diff --check
  • corepack pnpm exec prettier --check packages/plugin-mcp/src/endpoints/mcp.ts test/plugin-mcp/int.spec.ts docs/plugins/mcp.mdx
  • PAYLOAD_DATABASE=sqlite corepack pnpm exec vitest --run --project int test/plugin-mcp/int.spec.ts --no-cache

Notes from local setup: the repo currently declares engines requiring Node >=24.15.0; this machine has Node v24.13.0, so pnpm emitted engine warnings for several workspace packages. The targeted SQLite integration suite still passed.

Refs #16572

@Baijack-star Baijack-star changed the title Accept Payload API key auth for MCP endpoint fix(plugin-mcp): accept Payload API key auth scheme May 22, 2026
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