Skip to content

Conversation

@himanshusinghs
Copy link
Collaborator

@himanshusinghs himanshusinghs commented Nov 26, 2025

Proposed changes

This PR adds a guide targeting developers, explaining how to extend the MongoDB MCP server using the exports available from the library. Includes working code examples for the following use-cases:

  1. Override Server Configuration
  2. Per-Session Configuration
  3. Adding Custom Tools

Most of the document was written by CoPilot, so it'd be nice to actually ready through it once. I have ensured correctness of the material particularly API reference and examples.

The library exports were also modified a bit to support the examples mentioned in the guide.

Depends on #766

Checklist

@himanshusinghs himanshusinghs requested a review from a team as a code owner November 26, 2025 20:37
The MongoDB MCP Server can be embedded in your own Node.js applications and customized to meet specific requirements. The library exports provide full control over:

- Server configuration and initialization
- Per-session(MCP Client session) configuration hooks
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Per-session(MCP Client session) configuration hooks
- Per-session (MCP Client session) configuration hooks


### ToolBase

Base class for implementing custom tools.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be listing code implementations of classes for the most part. Not sure how useful that is.
Text here lives/should live in JSDoc. these are just different classes exported by the library; I don't see any value in barebones listing them in markdown.

It'd be better to see them as they're being imported / used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea and then there's the headache of always keeping them up to date. I guess I will move the JSDoc to the actual classes itself and link to the class here for the API reference.

@himanshusinghs himanshusinghs force-pushed the chore/disallow-overriding-of-internal-tools branch 3 times, most recently from b232a56 to 9cc5526 Compare November 27, 2025 16:11
@himanshusinghs himanshusinghs force-pushed the chore/MCP-299-mcp-lib-code-examples branch from 1b64989 to 5d00ab6 Compare November 27, 2025 16:14
@himanshusinghs himanshusinghs force-pushed the chore/MCP-299-mcp-lib-code-examples branch from 5d00ab6 to 64cb9bf Compare November 27, 2025 17:05
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