QwenClaw v2.0 - Complete Rebuild with ALL 81+ Skills
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "mongodb-tools",
|
||||
"version": "2.0.3",
|
||||
"description": "MongoDB MCP integration (read-only) for database exploration with best practices skill.",
|
||||
"author": {
|
||||
"name": "Fatih Akyon"
|
||||
},
|
||||
"homepage": "https://github.com/fcakyon/claude-codex-settings#plugins",
|
||||
"repository": "https://github.com/fcakyon/claude-codex-settings",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
10
skills/claude-codex-settings/plugins/mongodb-tools/.mcp.json
Normal file
10
skills/claude-codex-settings/plugins/mongodb-tools/.mcp.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"mongodb": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "mongodb-mcp-server"],
|
||||
"env": {
|
||||
"MDB_MCP_CONNECTION_STRING": "REPLACE_WITH_CONNECTION_STRING",
|
||||
"MDB_MCP_READ_ONLY": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
---
|
||||
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
|
||||
```
|
||||
@@ -0,0 +1,112 @@
|
||||
---
|
||||
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 Best Practices
|
||||
|
||||
## MCP Limitation
|
||||
|
||||
**This MCP operates in READ-ONLY mode.** No write, update, or delete operations are possible.
|
||||
|
||||
## Schema Design Patterns
|
||||
|
||||
### Embedding vs Referencing
|
||||
|
||||
**Embed when:**
|
||||
|
||||
- Data is accessed together frequently
|
||||
- Child documents are bounded (won't grow unbounded)
|
||||
- One-to-few relationships
|
||||
- Data doesn't change frequently
|
||||
|
||||
**Reference when:**
|
||||
|
||||
- Data is accessed independently
|
||||
- Many-to-many relationships
|
||||
- Documents would exceed 16MB limit
|
||||
- Frequent updates to referenced data
|
||||
|
||||
### Common Patterns
|
||||
|
||||
**Subset pattern:** Store frequently accessed subset in parent, full data in separate collection.
|
||||
|
||||
**Bucket pattern:** Group time-series data into buckets (e.g., hourly readings in one document).
|
||||
|
||||
**Computed pattern:** Store pre-computed values for expensive calculations.
|
||||
|
||||
## Index Strategies
|
||||
|
||||
### Index Guidelines
|
||||
|
||||
- Index fields used in queries, sorts, and aggregation $match stages
|
||||
- Compound indexes support queries on prefix fields
|
||||
- Covered queries (all fields in index) are fastest
|
||||
- Too many indexes slow writes
|
||||
|
||||
### Index Types
|
||||
|
||||
- **Single field:** Basic index on one field
|
||||
- **Compound:** Multiple fields, order matters for queries
|
||||
- **Multikey:** Automatically created for array fields
|
||||
- **Text:** Full-text search on string content
|
||||
- **TTL:** Auto-expire documents after time period
|
||||
|
||||
### ESR Rule
|
||||
|
||||
For compound indexes, order fields by:
|
||||
|
||||
1. **E**quality (exact match fields)
|
||||
2. **S**ort (sort order fields)
|
||||
3. **R**ange (range query fields like $gt, $lt)
|
||||
|
||||
## Aggregation Pipeline
|
||||
|
||||
### Performance Tips
|
||||
|
||||
- Put `$match` and `$project` early to reduce documents
|
||||
- Use `$limit` early when possible
|
||||
- Avoid `$lookup` on large collections without indexes
|
||||
- Use `$facet` for multiple aggregations in one query
|
||||
|
||||
### Common Stages
|
||||
|
||||
```javascript
|
||||
// Filter documents
|
||||
{ $match: { status: "active" } }
|
||||
|
||||
// Reshape documents
|
||||
{ $project: { name: 1, total: { $sum: "$items.price" } } }
|
||||
|
||||
// Group and aggregate
|
||||
{ $group: { _id: "$category", count: { $sum: 1 } } }
|
||||
|
||||
// Sort results
|
||||
{ $sort: { count: -1 } }
|
||||
|
||||
// Join collections
|
||||
{ $lookup: { from: "orders", localField: "_id", foreignField: "userId", as: "orders" } }
|
||||
```
|
||||
|
||||
## Connection Best Practices
|
||||
|
||||
### Connection String Formats
|
||||
|
||||
- **Atlas:** `mongodb+srv://user:pass@cluster.mongodb.net/database`
|
||||
- **Local:** `mongodb://localhost:27017/database`
|
||||
- **Replica set:** `mongodb://host1,host2,host3/database?replicaSet=rs0`
|
||||
|
||||
### Connection Pooling
|
||||
|
||||
- Use connection pooling in applications (default in drivers)
|
||||
- Set appropriate pool size for your workload
|
||||
- Don't create new connections per request
|
||||
|
||||
## Anti-Patterns to Avoid
|
||||
|
||||
- **Unbounded arrays:** Arrays that grow without limit
|
||||
- **Massive documents:** Documents approaching 16MB
|
||||
- **Too many collections:** Use embedding instead
|
||||
- **Missing indexes:** Queries doing collection scans
|
||||
- **$where operator:** Use aggregation instead for security
|
||||
- **Storing files in documents:** Use GridFS for large files
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: setup
|
||||
description: This skill should be used when user encounters "MongoDB connection failed", "authentication failed", "MongoDB MCP error", "connection string invalid", "authSource error", or needs help configuring MongoDB integration.
|
||||
---
|
||||
|
||||
# MongoDB Tools Setup
|
||||
|
||||
Run `/mongodb-tools:setup` to configure MongoDB MCP.
|
||||
|
||||
## Quick Fixes
|
||||
|
||||
- **Authentication failed** - Add `?authSource=admin` to connection string
|
||||
- **Invalid connection string** - Use `mongodb://` or `mongodb+srv://` prefix
|
||||
- **Network timeout** - Whitelist IP in Atlas Network Access
|
||||
|
||||
## Don't Need MongoDB?
|
||||
|
||||
Disable via `/mcp` command to prevent errors.
|
||||
Reference in New Issue
Block a user