MongoDB Connector
Supported MongoDB Atlas Administration connector for projects, clusters, and database-user metadata. Atlas retired its hosted Data API, so this connector does not pretend to query collection data over that discontinued service.
Credential setup
bearerUse a short-lived access token from a least-privilege Atlas service account. Atlas retired the App Services Data API; direct collection queries require a MongoDB driver or a private bridge.
Setup docs: https://www.mongodb.com/docs/atlas/api/service-accounts/generate-oauth2-token/
After adding this connector, attach the credential on the server page, then run astrail tools list.
Hosted MCP endpoint
/api/mcp/preset-mongodbPrivate servers require an Astrail API key in the Authorization header.
MCP client snippets
ConnectClaude Desktop config
{
"mcpServers": {
"mongodb-connector": {
"url": "/api/mcp/preset-mongodb"
}
}
}cURL initialize
curl -sS -X POST "/api/mcp/preset-mongodb" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'cURL tools/list
curl -sS -X POST "/api/mcp/preset-mongodb" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'cURL tools/call
curl -sS -X POST "/api/mcp/preset-mongodb" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"mongodb_list_projects","arguments":{"pageNum":"example","itemsPerPage":"example"}}}'Runtime behavior
healthynot_checkedsafe_rest_executionnot recordednot recordednot recordednonestructured fallbackstandardauth_required / oauth_requiredmapping_requiredAstrail does not evaluate generated TypeScript inside Next.js. Hosted calls are routed through stored tool metadata and endpoint maps.
Tools
4mongodb_list_projectsList MongoDB Atlas projects visible to the service account.
mongodb_list_clustersList MongoDB Atlas clusters in a project.
mongodb_get_clusterRetrieve configuration and state for a MongoDB Atlas cluster.
mongodb_list_database_usersList database-user metadata for a MongoDB Atlas project without exposing passwords.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "MongoDB Connector", version: "1.0.0" });
// Curated Astrail connector for: mongodb_list_projects, mongodb_list_clusters, mongodb_get_cluster, mongodb_list_database_users.
// The hosted endpoint executes its verified deterministic endpoint map. Attach a least-privilege provider credential before calling private tools.
server.tool("connector_status", "Confirm this curated connector template is installed.", z.object({}), async () => ({
content: [{ type: "text", text: "Connector installed. Attach provider credentials to enable hosted API calls." }],
}));
const transport = new StdioServerTransport();
await server.connect(transport);