Skip to content

Conversation

@gagik
Copy link
Collaborator

@gagik gagik commented Oct 23, 2025

@gagik gagik requested a review from a team as a code owner October 23, 2025 12:35
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 12:35
Copy link
Contributor

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 adds MCP registry publication support to the MongoDB MCP Server project. It introduces a server.json configuration file for the MCP registry, creates a code generation script to keep environment variable documentation synchronized, and updates the CI/CD pipeline to publish to the registry.

Key Changes:

  • Added MCP registry configuration file (server.json) with environment variables and package arguments
  • Created automated script to generate environment variable definitions from Zod schema
  • Updated publish workflow to include MCP registry publication step

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server.json New MCP registry configuration with environment variables and package arguments for npm and OCI packages
src/common/config.ts Refactored UserConfig to use Zod schema with descriptions, enabling automated documentation generation
scripts/generateArguments.ts New script to generate and sync environment variable definitions across server.json from config schema
package.json Added mcpName field and generate:args script for documentation generation
Dockerfile Added MCP server name label for registry identification
.github/workflows/publish.yml Updated workflow to generate arguments, install MCP publisher, and publish to registry

@gagik gagik changed the title chore: add server.json file the MCP registry chore: add MCP registry publishing Oct 23, 2025
run: brew install mcp-publisher

- name: Login to MCP Registry
run: mcp-publisher login github-oidc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not too sure if this is going to work but seems worth trying

@gagik gagik marked this pull request as draft October 23, 2025 12:39
@@ -0,0 +1,670 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
"name": "io.github.mongodb-js/mongodb-mcp-server",
Copy link
Collaborator Author

@gagik gagik Oct 23, 2025

Choose a reason for hiding this comment

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

we can either use io.github.mongodb-js and use GitHub Auth or mongodb.com and use DNS auth. the latter depends on a lot of external approvals I imagine so sticking to GitHub

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can also use an auth token, though OIDC publishing will also be great to adopt for NPM in the future: https://github.blog/changelog/2025-07-31-npm-trusted-publishing-with-oidc-is-generally-available/

/**
* This script generates environment variable definitions and updates:
* - server.json environmentVariables arrays
* - TODO: README.md configuration table
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this needed some extra handling but will be great to have in the future.

@gagik gagik marked this pull request as ready for review October 23, 2025 12:43
vectorSearchDimensions: number;
vectorSearchSimilarityFunction: Similarity;
}
export const UserConfigSchema = z.object({
Copy link
Collaborator Author

@gagik gagik Oct 23, 2025

Choose a reason for hiding this comment

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

I want to turn this into a single source of truth for our arguments. This should be useful in the future, including for runtime validation.

loggers: z
.array(z.enum(["stderr", "disk", "mcp"]))
.default(["disk", "mcp"])
.describe("Comma separated values, possible values are 'mcp', 'disk' and 'stderr'."),
Copy link
Collaborator

Choose a reason for hiding this comment

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

The description doesn't seem to match the type.

Copy link
Collaborator Author

@gagik gagik Oct 23, 2025

Choose a reason for hiding this comment

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

Yeah these are copied over from README.md but the schema were created with (eventual) validation in mind. Definitely a confusing setup the way it is, so will remove all the descriptions for now since I dropped my bonus goal to get this to handle README.md

Copy link
Collaborator Author

@gagik gagik Oct 23, 2025

Choose a reason for hiding this comment

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

So... I think for the time being this is fine, this isn't something we're consuming yet and as far as user-facing description and program-facing validation, it still makes sense.
In the future we should adopt https://zod.dev/metadata and have multiple fields to define this. This needs a Zod version bump otherwise I'd use it now

@gagik gagik force-pushed the gagik/publish-marketplace branch from ed41cc3 to e42a448 Compare October 23, 2025 13:24
httpHeaders: z
.record(z.string())
.describe(
"Custom HTTP headers to include in responses from the HTTP server (only used when transport is 'http'). Useful for adding CORS headers, authentication tokens, or other custom headers required by your client application."
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is this accurate? my interpretation of when one would use this @nirinchev

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, these are headers that the http server will validate when making requests. This is e.g. what we do for the auth header by the vscode extension.

RELEASE_CHANNEL: ${{ steps.npm-tag.outputs.RELEASE_CHANNEL }}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this in the wrong job?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is it? seems to be the way we get the token everywhere

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're adding this to the check job, but seems like you're trying to use it in the publish job. Step outputs cannot be passed across jobs.

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Update server.json version and arguments
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this at least temporarily as the last step? I expect there may be rough edges in the first couple of runs, so don't want this failing to impact the other steps.

@gagik gagik force-pushed the gagik/publish-marketplace branch from 6ba4c47 to a01db62 Compare October 23, 2025 14:40
@gagik gagik force-pushed the gagik/publish-marketplace branch from 160fe40 to 97c7585 Compare October 23, 2025 15:02
@gagik gagik force-pushed the gagik/publish-marketplace branch from ece3085 to 5e82dc1 Compare October 23, 2025 16:06
@gagik gagik force-pushed the gagik/publish-marketplace branch from 5e82dc1 to d3b80f5 Compare October 23, 2025 16:08
@gagik gagik enabled auto-merge (squash) October 23, 2025 16:11
@gagik gagik merged commit b6bfdfe into main Oct 23, 2025
19 checks passed
@gagik gagik deleted the gagik/publish-marketplace branch October 23, 2025 16:22
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.

3 participants