Amazon Documentdb
aws/agent-toolkit-for-aws
Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS/VPC/driver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration…
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mongodb/agent-skills mongodb-connection --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mongodb-connection .claude/skills/mongodb-connection && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .claude/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connectionType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mongodb/agent-skills mongodb-connection --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/mongodb-connection .agents/skills/mongodb-connection && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .agents/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mongodb/agent-skills mongodb-connection --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/mongodb-connection .cursor/skills/mongodb-connection && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .cursor/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mongodb/agent-skills.git --path skills/mongodb-connection--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mongodb/agent-skills mongodb-connection --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/mongodb-connection .gemini/skills/mongodb-connection && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .gemini/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mongodb/agent-skills mongodb-connectionInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/mongodb-connection .github/skills/mongodb-connection && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .github/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mongodb/agent-skills --skill mongodb-connection -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mongodb/agent-skills mongodb-connection --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/mongodb-connection .opencode/skills/mongodb-connection && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mongodb-connection" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-connection into .opencode/skills/mongodb-connection/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-connection", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mongodb-connectionOptimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
Mongodb Connection is an agent skill from mongodb/agent-skills, published by the product's own GitHub organization. Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling connect()), configuring connection pools, troubleshooting connection errors (ECONNREFUSED, timeouts, pool exhaustion), optimizing performance issues related to connections. This includes scenarios like building serverless functions with MongoDB, creating API endpoints that use…
Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/monitoring-guide.md`).
It sits in Databases, covering NoSQL databases and Serverless. It works with MongoDB. The repository describes itself as: Use the official MongoDB Skills with your favorite coding agent to build faster. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 18b014e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Mongodb Connection loads about 3.5k tokens when it runs, and up to ~5.6k if it reads all its reference files. Until then it costs about 169 tokens; SKILL.md has 1,640 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mongodb/agent-skills at commit 18b014e, republished under its Apache-2.0 licence (© mongodb). 1,640 words, ~3,477 tokens.
.claude/skills/mongodb-connection/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.You are an expert in MongoDB connection management across all officially supported driver languages (Node.js, Python, Java, Go, C#, Ruby, PHP, etc.). Your role is to ensure connection configurations are optimized for the user's specific environment and requirements, avoiding the common pitfall of blindly applying arbitrary parameters.
NEVER add connection pool parameters or timeout settings without first understanding the application's context. Arbitrary values without justification lead to performance issues and harder-to-debug problems.
Connection Lifecycle: Borrow from pool → Execute operation → Return to pool → Prune idle connections exceeding maxIdleTimeMS.
Synchronous vs. Asynchronous Drivers:
Monitoring Connections: Each MongoClient establishes 2 monitoring connections per replica set member (automatic, separate from your pool). Formula: Total = (minPoolSize + 2) × replica members × app instances. Example: 10 instances, minPoolSize 5, 3-member set = 210 server connections. Always account for this when planning capacity.
Before suggesting any configuration changes, ensure you have the sufficient context about the user's application environment to inform pool configuration (see Environmental Context below). If you don't have enough information, ask targeted questions to gather it. Ask only one question at a time, starting with broad context (deployment type, workload, concurrency) before drilling down into specifics.
When you suggest configuration, briefly explain WHY each parameter has its specific value based on the context you gathered. Use the user's environment details (deployment type, workload, concurrency) to justify your recommendations.
Example: maxPoolSize: 50 — "Based on your observed peak of 40 concurrent operations with 25% headroom for traffic bursts"
If you provide code snippets, add inline comments explaining the rationale for each parameter choice.
If performance data available: Pool Size ≈ (Ops/sec) × (Avg duration) + 10-20% buffer
Example: (10,000 ops/sec) × (10ms) + 20% buffer = 120 connections
Use when: Clear requirements, known latency, predictable traffic. Don't use when: variable durations—start conservative (10-20), monitor, adjust.
Query optimization can dramatically reduce required pool size.
The total number of supported connections in a cluster could inform the upper limit of poolSize based on the number of MongoClient's instances employed. For example, if you have 10 instances of MongoClient using a size of 5 connecting to a 3 node replica set: 10 instances × 5 connections × 3 servers = 150 connections.
Each connection requires ~1 MB of physical RAM, so you may find that the optimal value for this parameter is also informed by the resource footprint of your application's workload.
Total potential connections = instances × (maxPoolSize + 2) × replica set members. The + 2 accounts for the two monitoring connections per replica set member, per MongoClient instance. Monitor connections.current to avoid hitting limits. See references/monitoring-guide.md for how to set up monitoring.
Self-managed Servers: Set net.maxIncomingConnections to a value slightly higher than the maximum number of connections that the client creates, or the maximum size of the connection pool. This setting prevents the mongos from causing connection spikes on the individual shards that disrupt the operation and memory allocation of the sharded cluster.
General best practices:
Critical pattern: Initialize client OUTSIDE handler/function scope to enable connection reuse across warm invocations.
Recommended configuration:
| Parameter | Value | Reasoning |
|---|---|---|
maxPoolSize | 3-5 | Each serverless function instance has its own pool |
minPoolSize | 0 | Prevent maintaining unused connections. Increase to mitigate cold starts if needed |
maxIdleTimeMS | 10-30s | Release unused connections more quickly |
connectTimeoutMS | >0 | Set to a value greater than the longest network latency you have to a member of the set |
socketTimeoutMS | >0 | Use socketTimeoutMS to ensure that sockets are always closed |
Recommended configuration:
| Parameter | Value | Reasoning |
|---|---|---|
maxPoolSize | 50+ | Based on peak concurrent requests (monitor and adjust) |
minPoolSize | 10-20 | Pre-warmed connections ready for traffic spikes |
maxIdleTimeMS | 5-10min | Stable servers benefit from persistent connections |
connectTimeoutMS | 5-10s | Fail fast on connection issues |
socketTimeoutMS | 30s | Prevent hanging queries; appropriate for short OLTP operations |
serverSelectionTimeoutMS | 5s | Quick failover for replica set topology changes |
MongoDB 8.0+ introduces defaultMaxTimeMS on Atlas clusters, which provides server-side protection against long-running operations.
Recommended configuration:
| Parameter | Value | Reasoning |
|---|---|---|
maxPoolSize | 10-20 | Fewer concurrent operations. Match your expected concurrent analytical operations |
minPoolSize | 0-5 | Queries are infrequent; minimal pre-warming needed |
socketTimeoutMS | >0 | Set socketTimeoutMS to two or three times the length of the slowest operation that the driver runs. |
maxIdleTimeMS | 10min | Minimize connection churn while not keeping truly idle connections too long. Consider the timeouts of intermediate network devices |
Recommended configuration:
| Parameter | Value | Reasoning |
|---|---|---|
maxPoolSize | 100+ | Higher ceiling to accommodate sudden traffic spikes |
minPoolSize | 20-30 | More pre-warmed connections ready for immediate bursts |
maxConnecting | 2 (default) | Prevent thundering herd during sudden demand |
waitQueueTimeoutMS | 2-5s | Fail fast when pool exhausted rather than queueing indefinitely |
maxIdleTimeMS | 5min | Balance between reuse during bursts and cleanup between spikes |
If the user requires help to troubleshoot connection issues, determine whether this is a client config issue or infrastructure problem.
Types of issues:
references/monitoring-guide.md for how to instrument and monitor the relevant parameters that can inform your troubleshooting and recommendations.When operations queue, pool is exhausted.
Symptoms: MongoWaitQueueTimeoutError, WaitQueueTimeoutError or MongoTimeoutException, increased latency, operations waiting.
Solutions:
maxPoolSize when: Wait queue has operations waiting (size > 0) + server shows low utilizationClient Solutions: Increase connectTimeoutMS/socketTimeoutMS if legitimately needed
Infrastructure Issues (redirect):
Symptoms: Rapidly increasing connections.totalCreated server metric, high connection handling CPU
Causes: Not using pooling, not caching in serverless, maxIdleTimeMS too low, restart loops
minPoolSize > 0 for traffic spikescompressors: ['snappy', 'zlib']ALWAYS verify you have the sufficient context about the user's application environment to inform pool configuration BEFORE suggesting any configuration changes.
Guidelines:
You must guide users to monitor the relevant parameters to their pool configuration.
For detailed monitoring setup, see references/monitoring-guide.md.
For every connection parameter you provide (in recommendations or code snippets), ensure you have enough context about the user's application environment to inform values. If not, ask targeted questions before suggesting specific values. If you get no answer, make a reasonable assumption, disclose it and comment the relevant parameters accordingly in the code.
© mongodb, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in skills/mongodb-connection of mongodb/agent-skills.
Open the folder on GitHubat commit 18b014e
We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in mongodb/agent-skills, which our catalogue first saw on October 7, 2026.
Mongodb Connection next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mongodb Connection this skillmongodb/agent-skills | 190 | 1 repos | ~3.5k | Automated safety check: Pass | Apache-2.0 | |
| Amazon Documentdbaws/agent-toolkit-for-aws | 2.8k | — | ~5.9k | Automated safety check: Pass | Apache-2.0 | |
| Monstermq Broker Configvogler75/monster-mq | 142 | — | ~2.2k | Automated safety check: Pass | GPL-3.0 | |
| Mongodb BackupsTheDecipherist/claude-code-mastery-project-starter-kit | 338 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Mongodb Replica SetsTheDecipherist/claude-code-mastery-project-starter-kit | 338 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Mongodbsickn33/agentic-awesome-skills | 47k | 2 repos | ~2.7k | Automated safety check: Notes | MIT |
aws/agent-toolkit-for-aws
Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS/VPC/driver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration…
vogler75/monster-mq
Guide for configuring, deploying, and operating the MonsterMQ broker.
TheDecipherist/claude-code-mastery-project-starter-kit
Production MongoDB backup and restore practices that the documentation gets wrong.
TheDecipherist/claude-code-mastery-project-starter-kit
Production MongoDB replica-set operation: topology, durability, host tuning, and the container-specific gotchas Claude gets wrong.
sickn33/agentic-awesome-skills
Administer MongoDB databases. An agent skill from sickn33/agentic-awesome-skills.
RightNow-AI/openfang
MongoDB operations expert for queries, aggregation pipelines, indexes, and schema design
mongodb/agent-skills
Help with MongoDB query optimization and indexing. An agent skill from mongodb/agent-skills.
mongodb/agent-skills
Review a proposed Agent Skill for structural validity and content quality before publishing.
mongodb/agent-skills
Guide users through configuring key MongoDB MCP server options.
mongodb/agent-skills
MongoDB schema design patterns and anti-patterns. An agent skill from mongodb/agent-skills.
mongodb/agent-skills
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents.
mongodb/agent-skills
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions.
Works with
Categories
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Mongodb Connection is an agent skill from mongodb/agent-skills, published by the product's own GitHub organization. Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
Mongodb Connection fits situations like: working/updating/reviewing on functions that instantiate; configure a MongoDB client (eg; calling connect()); configuring connection pools.
Run `npx skills add mongodb/agent-skills --skill mongodb-connection -a claude-code`. Or copy the skill folder (skills/mongodb-connection in mongodb/agent-skills) into .claude/skills/mongodb-connection in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mongodb/agent-skills --skill mongodb-connection -a codex`. Or copy the skill folder (skills/mongodb-connection in mongodb/agent-skills) into .agents/skills/mongodb-connection in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mongodb/agent-skills --skill mongodb-connection -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mongodb-connection, .gemini/skills/mongodb-connection, .github/skills/mongodb-connection and .opencode/skills/mongodb-connection in your project.
SKILL.md names no scripts, command-line tools or credentials: Mongodb Connection is instructions for the agent only. Our summary lists: Node.js.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Mongodb Connection is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Mongodb Connection: Amazon Documentdb (aws/agent-toolkit-for-aws, 2.8k stars), Monstermq Broker Config (vogler75/monster-mq, 142 stars), Mongodb Backups (TheDecipherist/claude-code-mastery-project-starter-kit, 338 stars) and Mongodb Replica Sets (TheDecipherist/claude-code-mastery-project-starter-kit, 338 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mongodb (a GitHub organization, an official publisher) maintains it in mongodb/agent-skills, which has 190 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 6, 2026.
Source: mongodb/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.