Connector guide2-minute read5 MCP toolsEN · DE · IT

Cómo conectar MongoDB a Gemini — via MCP

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

HCBy HelpCode teamActualizado 2 min read Código abierto en GitHub

Sin tarjeta de crédito · 7 días de prueba · Alternativa self-host disponible

MongoDB

MongoDB

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

herramientas

5

Región

INTL

Categoría

Databases

Autenticación

Connection string

Env vars requeridas

MONGODB_HOSTMONGODB_PORTMONGODB_DATABASEMONGODB_USERMONGODB_PASSWORDMONGODB_AUTH_SOURCE
Instalar con un clic en Cloud

7 días de prueba gratis · Sin tarjeta de crédito

  • Prueba gratis de 7 días
    Sin tarjeta de crédito
  • GDPR & SOC 2 ready
    Datos en la UE, registros de auditoría
  • Código abierto en GitHub
    Open source · AGPL-3.0
  • Funciona con ChatGPT, Claude, Gemini
    Cualquier cliente compatible con MCP

Sáltate la instalación. Funcionando en menos de 2 minutos.

Inicia una prueba gratuita en cloud.anythingmcp.com, añade MongoDB con un clic y apunta tu cliente de IA (Claude, ChatGPT, Copilot o Cursor) al endpoint MCP generado. Sin Docker, sin git clone, sin experiencia de desarrollo.

Empezar prueba gratis

Summary

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

Prueba a pedir

Prompts de ejemplo para MongoDB

Haz clic en un prompt para copiarlo. Pégalo en Claude, ChatGPT, Cursor, Gemini, Copilot u OpenClaw para ejecutarlo contra este conector.

MongoDB · live vía MCP
Compartir
Opus 4.7

Claude es IA y puede equivocarse. Verifica siempre las respuestas.

💡 ¿Sin instalación? Usa cloud.anythingmcp.com directamente. Inicia sesión, pulsa Connectors → MongoDB, pega tus credenciales, genera una MCP API key — listo. Sin Docker, sin git clone, sin servidor local.

MongoDB + Gemini

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

Requisitos previos

Las instrucciones de configuración completas están incluidas en el conector (visibles en el store al seleccionarlo). Las variables de entorno requeridas:

MONGODB_HOST, MONGODB_PORT, MONGODB_DATABASE, MONGODB_USER, MONGODB_PASSWORD, MONGODB_AUTH_SOURCE

Paso 1 — Obtener credenciales

Setup

  1. Create a user with only read on the database the agent should see:
    use admin
    db.createUser({
      user: "amcp_reader",
      pwd: "change-me",
      roles: [{ role: "read", db: "shop" }]
    })
    
  2. Set MONGODB_HOST, MONGODB_PORT (27017), MONGODB_DATABASE, MONGODB_USER and MONGODB_PASSWORD.

MONGODB_AUTH_SOURCE is the field that decides whether this works at all. MongoDB authenticates a user against the database the user was created in, not the one you want to read. A root or admin account created the usual way lives in admin, so MONGODB_AUTH_SOURCE must be admin even though MONGODB_DATABASE is shop.

Paso 2 — Instalar el adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Paso 3 — Añadir el conector en Gemini

Gemini CLI lee servidores MCP desde ~/.gemini/settings.json (o %APPDATA%\gemini\settings.json en Windows). Añade:

{
  "mcpServers": {
    "anythingmcp": {
      "httpUrl": "https://cloud.anythingmcp.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_MCP_API_KEY" }
    }
  }
}
  1. Obtén tu MCP API key desde AnythingMCP → Perfil → MCP API Keys → Nueva Key.
  2. Guarda el archivo y reinicia gemini.
  3. Ejecuta /mcp en la Gemini CLI — MongoDB debería aparecer como disponible.
  4. Vertex AI Studio: pasa https://cloud.anythingmcp.com/mcp al array tools de tu petición con el mismo header Bearer.

Herramientas disponibles

ToolWhat it does
mongodb_schemaIntrospect the database: every collection, its estimated document count and the field names and types inferred from a sampled document
mongodb_findRun a read-only find
mongodb_find_recentRead the most recent documents of one collection, newest first by a timestamp field
mongodb_matchingReturn the documents of one collection matching a filter, projecting only their ids, so a population can be sized without transferring it
mongodb_query_examplesShow worked MongoDB query specs for this connector: filters, operators, projection, sort and the limits that apply

FAQ

¿Gemini 1.5 Pro o 2.x soportan MCP? Sí — Gemini CLI ≥ 0.4 y la API de tools de Vertex AI aceptan conectores MCP httpUrl con header Bearer.

Siguientes pasos

¿Te ha sido útil esta guía?

Your MongoDB agent is one click away.

Install the connector, paste the key, prompt Gemini. Free for 7 days, no credit card.

Guías relacionadas

connectors

Cómo conectar MongoDB a ChatGPT — via MCP

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

connectors

Cómo conectar MongoDB a Claude — via MCP

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

connectors

Cómo conectar MongoDB a Cursor — via MCP

Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.

databases

Cómo Conectar MongoDB a MCP para Agentes de IA

Conecta bases de datos MongoDB directamente a agentes de IA a través de MCP. Consulta colecciones mediante lenguaje natural con el conector de base de datos de AnythingMCP.

connectors

Cómo conectar AFAS Profit a Gemini — via MCP

AFAS Profit — Dutch ERP and HR: read any published GetConnector, list what is available, and inspect a connector's metadata. Token auth with AFAS's base64-wrapped XML token.

connectors

Cómo conectar Aruba Fatturazione Elettronica a Gemini — via MCP

Aruba Fatturazione Elettronica: send and track Italian e-invoices through the Sistema di Interscambio, read received invoices and their SDI notifications. Token auth against Aruba's B2B gateway.