home / skills / microck / ordinary-claude-skills / mongodb-usage

mongodb-usage skill

/skills_all/mongodb-usage

This skill helps you query MongoDB in read-only mode, list databases and collections, view schemas, and analyze indexes efficiently.

npx playbooks add skill microck/ordinary-claude-skills --skill mongodb-usage

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.3 KB
---
name: mongodb-usage
description: This skill should be used when user asks to "query MongoDB", "show database collections", "get collection schema", "list MongoDB databases", "search records in MongoDB", or "check database indexes".
---

# MongoDB MCP Usage

Use the MongoDB MCP server to integrate database queries into workflows.

## Read-Only Access

MongoDB MCP is configured in read-only mode. Only queries and data retrieval are supported. No write, update, or delete operations.

## Database Queries

Use `mcp__mongodb__*` tools for:

- Listing databases
- Viewing collection schemas
- Querying collection data
- Analyzing indexes

## Integration Pattern

1. List available databases with `mcp__mongodb__list_databases`
2. Explore collections with `mcp__mongodb__list_collections`
3. Get schema information with `mcp__mongodb__get_collection_schema`
4. Query data as needed for analysis
5. Format results for user consumption

## Environment Variables

MongoDB MCP requires:

- `MONGODB_URI` - Connection string (mongodb://...)

Configure in shell before using the plugin.

## Cost Considerations

- Minimize database calls when possible
- Use schema queries before running analysis queries
- Cache results locally if multiple calls needed
- Prefer aggregation pipelines for complex operations

Overview

This skill integrates read-only MongoDB access into workflows for discovering databases, inspecting collections, and running queries. It exposes mcp__mongodb__* tools to list databases, enumerate collections, retrieve collection schemas, analyze indexes, and fetch records for analysis. Use it when you need safe, read-only inspection of a MongoDB instance.

How this skill works

The skill talks to a MongoDB MCP server using a connection string supplied via MONGODB_URI. It provides specialized tools prefixed with mcp__mongodb__ to list databases, list collections, get collection schema details, query collection data, and examine indexes. All operations are read-only; the skill runs queries and returns formatted results for downstream use.

When to use it

  • When you need to list available MongoDB databases and collections before analysis
  • When you want to inspect or document a collection's schema and field types
  • When you need to search or filter records without modifying data
  • When checking which indexes exist and how they might affect queries
  • When preparing aggregation queries or summarizing dataset samples

Best practices

  • Provide a valid MONGODB_URI environment variable before running the skill
  • Prefer schema discovery tools before running heavy queries to reduce calls
  • Limit result sizes and use projections to minimize data transfer
  • Use aggregation pipelines on the server for complex summarization
  • Cache query results locally if multiple analyses reuse the same data

Example use cases

  • List all databases and collections to create a data catalog for an audit
  • Extract a sample of documents and inferred schema for onboarding a new analyst
  • Search for records matching criteria for a one-off investigation or report
  • Inspect indexes on a collection to recommend query optimizations
  • Run an aggregation pipeline to produce summary statistics for a dashboard

FAQ

Can this skill modify MongoDB data?

No. The skill is configured for read-only access and does not support write, update, or delete operations.

What environment variable is required?

Set MONGODB_URI with a valid MongoDB connection string (mongodb://...) before using the skill.