mongodb-js/mongodb-mcp-server/mongodb-mcp-v3-migration
Claude Code and agent skill by mongodb-js/mongodb-mcp-server
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Migrates external consumer code from the mongodb-mcp-server v1/v2 single-package API to the v3 scoped-package structure. In v3, mongodb-mcp-server is a binary-only package (npx / MCPB); library embedding uses @mongodb-js/mcp-cli, @mongodb-js/mcp-core, @mongodb-js/mcp-http-runners, @mongodb-js/mcp-tools-*, and the other @mongodb-js/mcp-* packages. Use when asked to migrate a project embedding or extending mongodb-mcp-server ("update my code to v3", "fix imports after the v3 release", "migrate my custom server/tools to the new packages"), or by external users following the v3 migration guide.
Install
npx vskill@latest install mongodb-js/mongodb-mcp-server/mongodb-mcp-v3-migrationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as mongodb-js/mongodb-mcp-server/mongodb-mcp-v3-migration.
MongoDB MCP Server v1 → v3 migration
This skill migrates consumer code: projects that embed, customize, or extend mongodb-mcp-server as a library (custom CLIs, HTTP hosts, custom tools, selective tool registration, request-scoped configuration). It runs in the consumer's repository, not the mongodb-mcp-server repo.
`MCP_SERVER_LIBRARY.md` now documents the v3 API surface (the scoped @mongodb-js/mcp-* packages, runMcpCli, CliServer, MCPHttpServer.createServerForRequest, ToolBase/ ToolClass, …). Use it as the reference for the migration target; the before/after sections in this skill and its inventory script map v1/v2 consumer code onto that surface.
v3 is sessionless. The v3 server has noSession/CliSessionobject and noper-client session state anywhere. Each HTTP request (or stdio connection) gets a freshrequest-scopedCliServerbuilt bycreateServerFromConfig; every heavy dependency(connections, exports, API client, telemetry, metrics, keychain) is built once perprocess insideSharedServerServicesand shared. Tools/resources read services offthis.server(there is nosession), and per-client identity travels on the toolrequest (ToolExecutionContext.request.clientInfo) rather than on a session object.
The core rule
`mongodb-mcp-server` is not a library in v3.
- End users:
npx mongodb-mcp-serveror the MCPB binary only. - Do not
npm install mongodb-mcp-serverandimport { … } from "mongodb-mcp-server"in application code. - Do not use the legacy
mongodb-mcp-server/toolsormongodb-mcp-server/webentry points.
Embed via the scoped packages instead: `@mongodb-js/mcp-cli` (custom CLI), `@mongodb-js/mcp-*` for everything else.
Step 1 — Inventory consumer code
The script lists every file that imports mongodb-mcp-server, shows the matched import lines, and classifies each imported symbol to its v3 package. Anything reported as unrecognized — manual review is a symbol the table doesn't know: look it up in the v3 migration guide and the package's API report before deciding.
Then get the full picture of every usage site:
Step 2 — Classify the use case
Pick the row(s) that match what the consumer does; install those packages (v3):
| Use case | npm install | Primary v3 imports | |
|---|---|---|---|
| Custom CLI (most v1 embeds) | @mongodb-js/mcp-cli + needed tool packages | runMcpCli, createRunnerFromConfig, create*FromConfig, Resources, CliServer | |
| Host MCP over stdio | @mongodb-js/mcp-core | StdioRunner, SessionStore, Keychain, Elicitation, NoopTelemetry, InMemoryTransport | |
| Host MCP over HTTP | @mongodb-js/mcp-http-runners @mongodb-js/mcp-core | StreamableHttpRunner, MCPHttpServer, MonitoringServer | |
| Embed server (advanced) | cli + core + http-runners + metrics + logging + telemetry + tools | CliServer, createSharedServicesFromConfig, createServerFromConfig, createRunnerFromConfig, startRunner | |
| Config parsing / overrides | @mongodb-js/mcp-cli | UserConfig, UserConfigSchema, parseUserConfig, applyConfigOverrides, configRegistry | |
| Custom tools (any category) | @mongodb-js/mcp-core @mongodb-js/mcp-types | ToolBase, ToolClass, OperationType, ToolCategory | |
| MongoDB tools + connections | @mongodb-js/mcp-tools-mongodb | FindTool, MongoDBToolBase, MCPConnectionManager, ErrorCodes, MongoDBError | |
| Atlas Admin API tools | @mongodb-js/mcp-tools-atlas @mongodb-js/mcp-atlas-api-client | AtlasTools, ApiClient, ClientCredentialsAuthProvider | |
| Atlas Local tools | @mongodb-js/mcp-tools-atlas-local | AtlasLocalTools, createAtlasLocalClient | |
| Assistant / knowledge tools | @mongodb-js/mcp-tools-assistant | AssistantTools | |
| Telemetry | @mongodb-js/mcp-atlas-telemetry | AtlasTelemetry, EventCache, TelemetryConfig | |
| Logging | @mongodb-js/mcp-logging | ConsoleLogger, DiskLogger, McpLogger | |
| Metrics | @mongodb-js/mcp-metrics | PrometheusMetrics, createDefaultMetrics | |
| MCP UI resources | @mongodb-js/mcp-ui | UIRegistry | |
| Shared types | @mongodb-js/mcp-types | TransportRequestContext, ITransportRunner, ToolServer, ToolServices, ServerMetadata |
Step 3 — Install and migrate the big three use cases
3a. Custom CLI → runMcpCli
Most v1 embeds become one runMcpCli call (same flow as the official v3 binary): parse config → handlers → create server → start stdio/HTTP.
Escalation ladder if they need more control: createServerFromConfig / createRunnerFromConfig + startRunner (both @mongodb-js/mcp-cli) → CliServer + @mongodb-js/mcp-http-runners for per-request HTTP.
3b. HTTP host → MCPHttpServer + StreamableHttpRunner
Per-request server creation moved off the runner. In v1, createServerForRequest lived on StreamableHttpRunner; in v3 it lives on `MCPHttpServer`. Runners no longer accept userConfig or build the server — build the server first, attach transport. The simplest path is the CLI's own CliMcpHttpServer + createHttpTransportRunnerFromConfig, which wires an MCPHttpServer that builds a fresh request-scoped CliServer per request from SharedServerServices:
To also apply per-request config overrides or control connection isolation, subclass MCPHttpServer and override createServerForRequest to return a request-scoped CliServer built with createServerFromConfig.
Note the v3 MCPHttpServer takes options.http and an optional sessionOptions for the legacy 2025-era lifecycle — there is no session: block and no SessionStore to build. App-level services (keychain, connectionStore, exportsManager, apiClient, telemetry, …) are built once by createSharedServicesFromConfig and passed in as SharedServerServices; the request-scoped server holds no per-client session state (hosts that require verified identity enforce it in their own middleware and inject it as req.auth, which both the modern and legacy paths forward as the request's authInfo; connections are scoped per request via the connectionScope policy, which keys on the request's verified identity). See Use Case 2.
Still may extends StreamableHttpRunner to customize start()/close() or bundle the wiring in a constructor — just don't override createServerForRequest there.
Stdio, for completeness: new StdioRunner({ userConfig: config }) → subclass StdioRunner (or use CliStdioRunner) and override createServer() (import @mongodb-js/mcp-core; the constructor takes only { logger }). The runner serves through the SDK's serveStdio entry (protocol revision 2026-07-28 and 2025-era): createServer() returns a registered CliServer (await server.register() before returning server.mcpServer), built fresh per stdio connection.
3c. Config
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mongodb-mcp-v3-migration/SKILL.md
Popularity
- Repository stars
- 1,138
- Repository forks
- 295
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mongodb-js/mongodb-mcp-server/mongodb-mcp-v3-migration)