MongoDB Query Skill for Openclaw

A powerful utility for querying MongoDB databases with native support for direct IP connections and Kubernetes port-forwarding within Openclaw Skills.

peintune
v1.0.0
Apr 15, 2026
0
692
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install mongo-query

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install mongo-query using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is MongoDB Query Skill?

The MongoDB Query skill is a specialized tool designed for AI agents to interact with MongoDB instances for debugging, troubleshooting, and data retrieval. As a core component of the Openclaw Skills library, it simplifies database management by automating the connection lifecycle. Whether your database is hosted on a local server or tucked away inside a Kubernetes cluster, this skill provides a unified interface for data inspection.

By leveraging this skill, developers can empower their agents to verify data integrity, list schemas, and execute complex queries without leaving the terminal environment. It is an essential asset for any Openclaw Skills implementation that requires real-time database visibility and cloud-native connectivity.

MongoDB Query Skill Use Cases

  • Troubleshooting production data issues by querying specific collections for error states.
  • Inspecting database schemas and listing available collections during an active development cycle.
  • Connecting to MongoDB instances running inside Kubernetes clusters without needing to manually configure port-forwarding.
  • Automating routine data health checks and status reports within an Openclaw Skills agent workflow.

How MongoDB Query Skill Works

  1. The AI agent receives a MongoDB connection URI and optional Kubernetes namespace via the Openclaw Skills interface.
  2. The skill parses the URI to identify if the host is a standard IP address or a Kubernetes service name.
  3. For Kubernetes-based hosts, the skill automatically initiates a kubectl port-forwarding session to establish a secure tunnel.
  4. The script executes the requested MongoDB operation—such as listing databases or querying documents—using the pymongo driver.
  5. Results are formatted as JSON or plain text and returned to the Openclaw Skills agent for analysis and presentation.

MongoDB Query Skill Setup

To use this skill within your Openclaw Skills environment, ensure you have the necessary dependencies installed:

pip install pymongo
# Ensure kubectl is installed and configured if connecting via Kubernetes

Before running the skill, prepare your connection string. You can store this in your project configuration for easier access by the agent:

python scripts/query_mongo.py --uri "mongodb://root:[email protected]:27017/?authSource=admin" --list-dbs

MongoDB Query Skill Data Schema & Taxonomy

The MongoDB Query skill utilizes a structured parameter set to manage data retrieval within Openclaw Skills:

Parameter Description Required
--uri Full MongoDB connection string Yes
--db Target database name for queries Conditional
--collection Target collection name Conditional
--query JSON-formatted MongoDB query filter No
--namespace Kubernetes namespace for service discovery No
--limit Maximum number of documents to return No

MongoDB Query Skill Advanced Features

  • Intelligent connection detection that switches between direct IP and Kubernetes port-forwarding automatically.
  • Comprehensive JSON query support allowing for complex filters, including the use of ObjectIDs.
  • Automated session management that handles the lifecycle of background processes during Kubernetes interactions.
  • Output optimization for Openclaw Skills agents, including result limiting to prevent context window overflow.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*