A Model Context Protocol server for interacting with MongoDB Atlas.
Developed using the official MCP SDK https://github.com/modelcontextprotocol/typescript-sdk
- Node.js installed
- MongoDB Atlas account
npm installnpm run build- Run
npm run buildto re-build the server if you made changes to the code - Press
Cmd + Shift + Pand type List MCP Servers - Select the MCP server you want to restart
- Select the option to restart the server
To see MCP logs, check https://code.visualstudio.com/docs/copilot/chat/mcp-servers.
- Press
Cmd + Shift + Pand type List MCP Servers - Select the MCP server you want to see logs for
- Select the option to view logs in the output panel
We can use @modelcontextprotocol/inspector to debug the server - https://github.com/modelcontextprotocol/inspector
From the root of this repository, run:
npx @modelcontextprotocol/inspector -- node dist/index.jsOr use the npm script:
npm run inspectauth- Authenticate to MongoDB Atlaslist-clusters- Lists MongoDB Atlas clusterslist-projects- Lists MongoDB Atlas projects
Prerequisites:
- Use VSCode Insiders (https://code.visualstudio.com/insiders/)
- Setup copilot in VSCode Insiders
Step 1: Add the mcp server to VSCode configuration
- Press
Cmd + Shift + Pand typeMCP: Add MCP Serverand select it. - Select the first option for a local MCP server.
- Add the path to dist/index.js in the prompt
Step 2: Verify the created mcp file
It should look like this
{ "servers": { "demo-atlas-server": { "type": "stdio", "command": "/Users/<user>/workplace/atlas-mcp-server/dist/index.js", "args": [] } } }Step 3: Open the copilot chat and check that the toolbox icon is visible and has the mcp server listed.
Step 4: Try running a command
- Can you list my clusters?
Step 1: Install claude and login
brew install claudeStep 2: Create a configuration file for your MCP server
Open the file
code ~/Library/Application\ Support/Claude/claude_desktop_config.json Paste the mcp server configuration into the file
{ "mcpServers": { "Demo": { "command": "path/to/this/repo/atlas-mc-server/dist/index.js" } } } Step 3: Launch Claude Desktop and click on the hammer icon, the Demo MCP server should be detected. Type in the chat "show me a demo of MCP" and allow the tool to get access.
- Detailed instructions with screenshots can be found in this document.
Note: If you make changes to your MCP server code, rebuild the project with npm run build and restart the server and Claude Desktop.