CuratedMCP
✨
OpenAI Agents SDK
Free

How to Install MongoDB MCP in OpenAI Agents SDK

MongoDB's official MCP server for databases and Atlas.

What MongoDB MCP does

MongoDB's official MCP server. Runs locally with npx and a connection string (or Atlas API credentials), and lets an agent query and manage databases and collections and, with Atlas credentials, clusters and users. A read-only mode is available.

mongodb
database
atlas
nosql
documents

Installation steps

  1. 1Install: pip install openai-agents
  2. 2Copy the snippet below into your agent code
  3. 3Replace placeholder env values with your real keys
  4. 4Pass mcp_servers=[mcp_server] to your Agent()

Python snippet

Python snippetpython
from agents import Agent
from agents.mcp import MCPServerStdio

mcp_server = MCPServerStdio(
    command="npx",
    args=["-y", "mongodb-mcp-server"],
    env={
        "MDB_MCP_CONNECTION_STRING": "mongodb+srv://<user>:<password>@<cluster>/",
    },
)

agent = Agent(
    name="My Agent",
    model="gpt-4o",
    mcp_servers=[mcp_server],
)
Full server details GitHub Open Config Editor

Install in other clients

For maintainers

If you maintain MongoDB MCP, add this badge to your README to show it's verified on CuratedMCP:

CuratedMCP Verified
[![CuratedMCP Verified](https://www.curatedmcp.com/api/badge/mongodb-mcp)](https://www.curatedmcp.com/marketplace/mongodb-mcp)

Related servers