Skip to content

Conversation

@continue
Copy link
Contributor

@continue continue bot commented Oct 7, 2025

Description

This PR adds an apiKey field to the mcpServers block schema in packages/config-yaml and implements it as a Bearer token in the Authorization header across both the core MCP connection and the CLI MCP service.

Changes

  • Schema: Added apiKey field to sseOrHttpMcpServerSchema in packages/config-yaml/src/schemas/mcp/index.ts
  • Core Implementation: Updated MCPConnection.ts to merge apiKey as Authorization: Bearer <apiKey> header in both SSE and HTTP transports
  • CLI Implementation: Updated MCPService.ts to merge apiKey as Authorization: Bearer <apiKey> header in both SSE and HTTP transports
  • Type Definitions: Added apiKey?: string to InternalSseMcpOptions and InternalStreamableHttpMcpOptions in core/index.d.ts
  • Converter: Updated yamlToContinueConfig.ts to pass through the apiKey field

Usage Example

Users can now specify an apiKey directly in their mcpServers config instead of needing to use requestOptions.headers:

mcpServers:
  - name: my-server
    url: https://api.example.com/mcp
    apiKey: sk-1234567890abcdef

This will automatically set the Authorization: Bearer sk-1234567890abcdef header.

Fixes CON-4281


This agent session was co-authored by nate and Continue.


Summary by cubic

Add apiKey to the mcpServers schema and automatically send it as a Bearer token in Authorization headers for SSE and streamable HTTP transports. This simplifies MCP auth configuration and fulfills CON-4281.

  • New Features

    • Added apiKey to sseOrHttpMcpServerSchema.
    • Automatically sets Authorization: Bearer in core MCPConnection and CLI MCPService.
    • Updated types and yaml converter to support apiKey.
  • Migration

    • Use mcpServers.apiKey to enable Bearer auth.
    • Remove duplicate Authorization headers from requestOptions if present.

- Add apiKey field to sseOrHttpMcpServerSchema in packages/config-yaml
- Update MCPConnection.ts to merge apiKey as Bearer token in Authorization header
- Update CLI MCPService to merge apiKey as Bearer token in Authorization header
- Add apiKey to InternalSseMcpOptions and InternalStreamableHttpMcpOptions types
- Update yamlToContinueConfig converter to pass through apiKey field

Fixes CON-4281

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: nate <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Oct 7, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 7, 2025
@sestinj sestinj marked this pull request as ready for review October 7, 2025 18:21
@sestinj sestinj requested a review from a team as a code owner October 7, 2025 18:21
@sestinj sestinj requested review from RomneyDa and removed request for a team October 7, 2025 18:21
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 7, 2025
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@sestinj sestinj merged commit 9164448 into main Oct 8, 2025
60 of 63 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Oct 8, 2025
@sestinj sestinj deleted the continuebot/con-4281 branch October 8, 2025 15:33
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2025
@sestinj
Copy link
Contributor

sestinj commented Oct 8, 2025

🎉 This PR is included in version 1.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 12, 2025

🎉 This PR is included in version 1.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 15, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

lgtm This PR has been approved by a maintainer released size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants