Skip to main content
Glama
jonfreeland

MongoDB MCP Server

by jonfreeland

list_databases

Retrieve a list of all databases available in the MongoDB server to identify data sources for querying and analysis.

Instructions

List all databases in the MongoDB server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for list_databases tool: connects to admin database and calls listDatabases() to retrieve all databases.
    case 'list_databases': { const adminDb = client.db('admin'); const result = await adminDb.admin().listDatabases(); return { content: [ { type: 'text', text: JSON.stringify(result.databases, null, 2), }, ], }; }
  • src/index.ts:312-319 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema.
    { name: 'list_databases', description: 'List all databases in the MongoDB server.', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for list_databases: empty object (no input parameters required).
    inputSchema: { type: 'object', properties: {}, },

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/jonfreeland/mongodb-mcp'

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