Skip to content

chore: support for OIDC connectivity between the MCP Server and a MongoDB Cluster MCP-84 #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kmruiz
Copy link
Collaborator

@kmruiz kmruiz commented Aug 13, 2025

Proposed changes

This allows users to use OIDC authentication between the MCP Server and the MongoDB Cluster. It adds a test suite to ensure that the different flows do work as expected.

There is a small change on the test suite. Now describeWithMongoDb allows to specify the mongodb version to download. This is useful if we want to test OIDC in other versions. Also, defaults testing in MongoDB enterprise, as it's like community but with more capabilities, and allows us to test OIDC.

Checklist

chore: first approach to OIDC integration

chore: linter warnings

chore: add jira auto-closing automation - MCP-102 (#441)

chore: add jira auto-closing automation - MCP-102 (#441)

chore: fix apix action version (#448)

chore: fix linter checks

chore: fix tests and eslint config

Ignores any javascript or typescript file that is a test
fixture.

chore: more clean up

chore: add test for token refresh

chore: fix tests and eslint checks
@kmruiz kmruiz marked this pull request as ready for review August 13, 2025 10:47
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 10:47
@kmruiz kmruiz requested a review from a team as a code owner August 13, 2025 10:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements OIDC (OpenID Connect) authentication support for MongoDB connections, enabling the MCP Server to connect to MongoDB clusters using OIDC authentication flows. The changes introduce comprehensive OIDC support including both authorization code flow and device flow authentication patterns.

  • Adds OIDC authentication support with auth flow and device flow mechanisms
  • Updates ConnectionManager to handle OIDC connection states and authentication flows
  • Expands test infrastructure to support OIDC testing with mock providers and enhanced MongoDB integration testing

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/common/connectionManager.ts Core OIDC implementation with connection state management and authentication flow handling
src/common/config.ts Enhanced driver options configuration and OIDC-related type definitions
tests/integration/common/connectionManager.oidc.test.ts Comprehensive OIDC integration tests covering both auth flows
tests/integration/tools/mongodb/mongodbHelpers.ts Enhanced test helpers with server version detection and OIDC test support
src/tools/mongodb/mongodbTool.ts Added OIDC device flow user prompts for authentication completion
tests/integration/helpers.ts Updated test infrastructure to support driver options configuration
package.json Added OIDC mock provider and semver dependencies for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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