1. Habit
  2. Skills
  3. MongoDB Connection skill
mongodb · 5K installs

MongoDB Connection skill
Runs by itself, connection code or errors.

Size MongoDB connection pools from evidence.

Install the MongoDB Connection skill and make it a habit: follow https://gethabit.dev/skills/mongodb/mongodb-connection.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

5K installs190 starsApache-2.0 licenceSource on GitHub ↗

MongoDB Connection

by mongodb · 5K installs

The skill

The mongodb connection skill optimizes MongoDB client connection settings for any driver: pool sizes, timeouts and reuse patterns for serverless, OLTP, OLAP and bursty workloads, plus troubleshooting pool exhaustion and timeouts.

Only when you ask.

The habit

Size MongoDB connection pools from evidence.

↻ Runs by itselfconnection code or errors

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one client config and one revision.

  1. 01

    Gather context

    Your agent asks one question at a time about deployment, workload and concurrency.

  2. 02

    Classify the issue

    It separates client configuration issues from infrastructure issues and redirects the latter.

  3. 03

    Pick a scenario

    It matches serverless, OLTP, OLAP or bursty workloads.

  4. 04

    Size the pool

    It estimates pool size from ops per second and duration, or starts conservative.

  5. 05

    Check limits

    It counts total server connections including the 2 monitoring connections per member.

  6. 06

    Set up monitoring

    It points to references/monitoring-guide.md to track connections.current and wait queues.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the MongoDB Connection skill helps.

Use it when

  • ✓ You configure a MongoClient
  • ✓ You see pool exhaustion or timeouts
  • ✓ You build serverless functions on MongoDB

Skip it when

  • – The issue is DNS, VPC or TLS
  • – You do not use MongoDB

Questions

MongoDB Connection skill, answered.

Should I always raise maxPoolSize on timeouts?

No. Only when the wait queue fills while the server is lightly used.

What if I do not know my numbers?

It makes a reasonable assumption, says so and comments the setting.

How do I install the MongoDB Connection skill?

Copy the prompt at the top into your agent. It installs the skill from mongodb/agent-skills and sets up the habit. Or run npx skills add mongodb/agent-skills --skill mongodb-connection.

Is the MongoDB Connection skill free?

Yes. It is published under Apache-2.0. Habit is free too.

MongoDB Connection. Now as a habit.

Install the MongoDB Connection skill and make it a habit: follow https://gethabit.dev/skills/mongodb/mongodb-connection.md

  • Free
  • No account
  • Undo in one line

All mongodb skills →More ops skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by mongodb, published under Apache-2.0. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.