Skip to content
Back to skills

964 Setup 5c67b444

ASecurity

Configure MongoDB MCP connection

  • 11 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 11, 2026
toolsgogitdatabase

Works with

  • claude code
  • cli
  • mcp

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 964-setup_5c67b444 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 964 Setup 5c67b444?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 964 Setup 5c67b444
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-964-setup-5c67b444/badge)](https://www.skillsdirectory.com/skills/tools-only-964-setup-5c67b444)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
description: Configure MongoDB MCP connection
---

# MongoDB Tools Setup

**Source:** [mongodb-js/mongodb-mcp-server](https://github.com/mongodb-js/mongodb-mcp-server)

Configure the MongoDB MCP server with your connection string.

## Step 1: Check Current Status

Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`.

Check if MongoDB is configured:

- If `mongodb.env.MDB_MCP_CONNECTION_STRING` contains `REPLACE_WITH_CONNECTION_STRING`, it needs configuration
- If it contains a value starting with `mongodb://` or `mongodb+srv://`, already configured

Report status:

- "MongoDB MCP is not configured - needs a connection string"
- OR "MongoDB MCP is already configured"

## Step 2: Show Setup Guide

Tell the user:

```
To configure MongoDB MCP, you need a connection string.

Formats:
- Atlas: mongodb+srv://username:password@cluster.mongodb.net/database
- Local: mongodb://localhost:27017/database

Get Atlas connection string:
1. Go to cloud.mongodb.com
2. Navigate to your cluster
3. Click "Connect" → "Drivers"
4. Copy connection string

Note: MCP runs in READ-ONLY mode.

Don't need MongoDB MCP? Disable it via /mcp command.
```

## Step 3: Ask for Connection String

Use AskUserQuestion:

- question: "Do you have your MongoDB connection string ready?"
- header: "MongoDB"
- options:
  - label: "Yes, I have it"
    description: "I have my MongoDB connection string ready to paste"
  - label: "No, skip for now"
    description: "I'll configure it later"

If user selects "No, skip for now":

- Tell them they can run `/mongodb-tools:setup` again when ready
- Remind them they can disable MongoDB MCP via `/mcp` if not needed
- Exit

If user selects "Yes" or provides connection string via "Other":

- If they provided connection string in "Other" response, use that
- Otherwise, ask them to paste the connection string

## Step 4: Validate Connection String

Validate the provided connection string:

- Must start with `mongodb://` or `mongodb+srv://`

If invalid:

- Show error: "Invalid connection string format. Must start with 'mongodb://' or 'mongodb+srv://'"
- Ask if they want to try again or skip

## Step 5: Update Configuration

1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json`
2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup`
3. Update `mongodb.env.MDB_MCP_CONNECTION_STRING` value to the actual connection string
4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json`

## Step 6: Confirm Success

Tell the user:

```
MongoDB MCP configured successfully!

IMPORTANT: Restart Claude Code for changes to take effect.
- Exit Claude Code
- Run `claude` again

To verify after restart, run /mcp and check that 'mongodb' server is connected.
```

## Troubleshooting

If MongoDB MCP fails after configuration:

```
Common fixes:
1. Authentication failed - Add ?authSource=admin to connection string
2. Network timeout - Whitelist IP in Atlas Network Access settings
3. Wrong credentials - Verify username/password, special chars need URL encoding
4. SSL/TLS errors - For Atlas, ensure mongodb+srv:// is used
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.