Skip to main content
Glama
mongodb-developer

MongoDB Atlas MCP Server

Official

setup_atlas_network_access

Configure network access for a MongoDB Atlas project by specifying IP addresses or CIDR blocks to enable secure connections.

Instructions

Sets up network access for an existing Atlas project. Accepts list of IP addresses or CIDR blocks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipAddressesYesAn array of IP addresses or CIDR blocks for network access.
projectIdYesThe ID of the Atlas project.

Implementation Reference

  • The main handler function that sets up network access for the Atlas project by posting the provided IP addresses to the Atlas API access list endpoint.
    private async setupAtlasNetworkAccess(input: NetworkAccessInput) { try { const url = `https://cloud.mongodb.com/api/atlas/v1.0/groups/${input.projectId}/accessList`; const body = input.ipAddresses.map(ip => ({ ipAddress: ip, comment: "Added via Atlas Project Manager MCP" })); const result = await this.makeAtlasRequest(url, 'POST', body); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { return { content: [{ type: 'text', text: error.message }], isError: true }; } }
  • TypeScript interface defining the input structure for the setupAtlasNetworkAccess tool.
    interface NetworkAccessInput { projectId: string; ipAddresses: string[]; }
  • JSON schema defining the input validation for the tool in the MCP ListTools response.
    inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'The ID of the Atlas project.', }, ipAddresses: { type: 'array', items: { type: 'string', }, description: 'An array of IP addresses or CIDR blocks for network access.', }, }, required: ['projectId', 'ipAddresses'], },
  • src/index.ts:410-430 (registration)
    Tool registration in the ListTools handler, including name, description, and input schema.
    { name: 'setup_atlas_network_access', description: 'Sets up network access for an existing Atlas project. Accepts list of IP addresses or CIDR blocks.', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'The ID of the Atlas project.', }, ipAddresses: { type: 'array', items: { type: 'string', }, description: 'An array of IP addresses or CIDR blocks for network access.', }, }, required: ['projectId', 'ipAddresses'], }, },
  • Dispatch case in the main CallToolRequest handler that invokes the specific tool handler.
    case 'setup_atlas_network_access': result = await this.setupAtlasNetworkAccess(input as unknown as NetworkAccessInput); break;

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mongodb-developer/mcp-mongodb-atlas'

If you have feedback or need assistance with the MCP directory API, please join our Discord server