mongodb
/mongodb
MongoDB MCP - query dirette a Payload CMS collections, debug dati, analisi tenant, aggregazioni. Use when querying MongoDB directly, debugging Payload CMS data, running aggregations, or analyzing tenant collections.
- Author
- PIXARTSeu ↗
- Repository
- Synapse ↗
- Licence
- AGPL-3.0
- Last repository change
- 15.09.2026
Assessment and security
- Files in this package
- 6
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 15.09.2026, without references to retired models or APIs.
AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.
What it does and when to use it
MongoDB MCP - query dirette a Payload CMS collections, debug dati, analisi tenant, aggregazioni. Use when querying MongoDB directly, debugging Payload CMS data, running aggregations, or analyzing tenant collections.
Original author description
MongoDB MCP - query dirette a Payload CMS collections, debug dati, analisi tenant, aggregazioni. Use when querying MongoDB directly, debugging Payload CMS data, running aggregations, or analyzing tenant collections.
How it works
- MCP Server
- Configurazione
- Collections Standard Payload CMS
- Tool MCP Disponibili
- Query Patterns Comuni
- Debug Scenari Comuni
- Struttura Documento Payload
- Best Practices
- Integrazione con Agenti
SKILL.md preview
---
name: mongodb
description: MongoDB MCP - query dirette a Payload CMS collections, debug dati, analisi tenant, aggregazioni. Use when querying MongoDB directly, debugging Payload CMS data, running aggregations, or analyzing tenant collections.
version: 1.0.0
---
# MongoDB MCP Skill
## MCP Server
`mongodb-mcp-server` (ufficiale MongoDB) — Accesso diretto al database MongoDB di Payload CMS via MCP.
## Configurazione
```
ENV: MDB_MCP_CONNECTION_STRING = mongodb+srv://user:pass@cluster.mongodb.net/dbname
```
Il connection string è lo stesso usato in `MONGODB_URI` di Payload CMS.
## Collections Standard Payload CMS
| Collection Payload | MongoDB Collection | Tenant-scoped |
|-------------------|-------------------|---------------|
| Tenants | `tenants` | No (admin only) |
| Users | `users` | Sì |
| Pages | `pages` | Sì |
| Posts | `posts` | Sì |
| Media | `media` | Sì |
| Categories | `categories` | Sì |
| Preferences | `payload-preferences` | No |
| Migrations | `payload-migrations` | No |
| Versions (drafts) | `_pages_versions`, `_posts_versions` | Sì |
## Tool MCP Disponibili
### list-databases
Lista tutti i database nel cluster.
### list-collections
```
list-collections(database: "pixarts-cms")
```
### find — Query documenti
```
find(
collection: "pages",
database: "pixarts-cms",
filter: { "tenant": { "$oid": "6507..." }, "status": "published" },
limit: 10,
projection: { "title": 1, "slug": 1, "status": 1, "updatedAt": 1 }
)
```
> **Nota**: Gli ObjectId in Payload si scrivono come `{ "$oid": "..." }` nelle query MCP.
### aggregate — Pipeline avanzate
```
aggregate(
collection: "pages",
database: "pixarts-cms",
pipeline: [
{ "$match": { "status": "published" } },
{ "$group": { "_id": "$tenant", "count": { "$sum": 1 } } },
{ "$sort": { "count": -1 } }
]
)
```
### count — Conta documenti
```
count(
collection: "pages",
database: "pixarts-cms",
filter: { "status": "draft" }
)
```
### create-index — Crea indice (solo dev/staging)
```
create-index(
collection: "pages",
database: "pixarts-cms",
keys: { "tenant": 1, "slug": 1 },
options: { "unique": true }
)
```
## Query Patterns Comuni
### Trovare tenant per slug
```json
{
"collection": "tenants",
"filter": { "slug": "nome-cliente" }
}
```
### Tutte le pagine pubblicate di un tenant
```json
{
"collection": "pages",
"filter": {
"tenant": { "$oid": "ID_TENANT" },
"status": "published"
},
"projection": { "title": 1, "slug": 1, "updatedAt": 1 }
}
```
### Utenti di un tenant con ruoli
```json
{
"collection": "users",
"filter": { "tenant": { "$oid": "ID_TENANT" } },
"projection": { "email": 1, "roles": 1, "loginAttempts": 1, "lockUntil": 1 }
}
```
### Media non utilizzati (orfani)
```json
{
"collection": "media",
"pipeline": [
{ "$lookup": {
"from": "pages",
"localField": "_id",
"foreignField": "featuredImage",
"as": "usedInPages"
}},
{ "$match": { "usedInPages": { "$size": 0 } } },
{ "$project": { "filename": 1, "filesize": 1, "createdAt": 1 } }
]
}
```
### Stats per tenant (pagine pubblicate vs bozze)
```json
{
"collection": "pages",
"pipeline": [
{ "$group": {
"_id": { "tenant": "$tenant", "status": "$status" },
"count": { "$sum": 1 }
}},
{ "$sort": { "_id.tenant": 1 } }
]
}
```
### Trovare draft non pubblicati da più di X giorni
```json
{
"collection": "pages",
"filter": {
"status": "draft",
"updatedAt": { "$lt": { "$date": "2026-01-01T00:00:00Z" } }
},
"projection": { "title": 1, "tenant": 1, "updatedAt": 1 }
}
```
## Debug Scenari Comuni
### "La pagina non appare sul frontend"
```
1. find(collection: "pages", filter: { "slug": "nome-pagina" })
→ Controlla: status = "published"? tenant corretto? slug esiste?
2. Se draft: verifica che Payload non stia servendo la versione draft
→ Guarda _pages_versions per il documento corrispondente
3. Se slug duplicato: cerca slug con filter multi-tenant
→ Verifica unicità per tenant
```
### "Utente non riesce ad accedere / account bloccato"
```
1. find(collection: "users", filter: { "email": "user@example.com" })
→ Controlla: loginAttempts, lockUntil, _verified, roles, tenant
2. Se lockUntil è nel futuro → account bloccato da troppi tentativi
→ update-one per resettare loginAttempts e lockUntil (solo se autorizzato)
```
### "Media non si carica"
```
1. find(collection: "media", filter: { "filename": "nome-file.jpg" })
→ Controlla: url, filesize, mimeType, tenant
2. Verifica che il file esista fisicamente sul server (via devops)
```
### "CMS lento su una collection"
```
1. Usa aggregate con $indexStats per verificare indici usati
2. Controlla con list-indexes gli indici esistenti
3. Se mancano indici su campi filtrati frequentemente → crea con create-index
```
## Struttura Documento Payload
Ogni documento Payload ha questi campi standard:
```json
{
"_id": { "$oid": "..." },
"tenant": { "$oid": "..." }, // solo se tenant-scoped
"status": "published|draft",
"createdAt": { "$date": "..." },
"updatedAt": { "$date": "..." },
"_status": "published|draft", // campo interno Payload per versioning
"__v": 0 // MongoDB versioning
}
```
## Best Practices
1. **Read-first sempre** — Usa `find`/`aggregate` per analisi; `insert-one`/`update-one` solo se esplicitamente richiesto
2. **Mai modificare prod senza backup** — Ambiente prod: solo lettura salvo emergenze
3. **ObjectId syntax** — In query MCP usa `{ "$oid": "..." }` non stringhe plain
4. **Tenant isolation** — Filtra SEMPRE per `tenant` in collection tenant-scoped
5. **Versioning** — Non modificare `_pages_versions` direttamente — Payload gestisce i draft
6. **Projection** — Usa sempre `projection` per limitare i campi e ridurre il payload
7. **Limit** — Su collection grandi usa sempre `limit` (default suggerito: 20-50)
## Integrazione con Agenti
| Agente | Quando usa MongoDB MCP |
|--------|------------------------|
| @mongodb-analyst | Analisi dati, debug, query su richiesta |
| @payload-cms | Debug specifico Payload (access control, hooks) |
| @site-qa | Verifica dati inseriti durante QA |
| @devops-engineer | Monitor dimensioni collection, indici mancanti |
Files in this package (6)
- SKILL.md 6 KB
- learnings.md 1 KB
- evals/evals.json 1 KB
- evals/trigger_evals.json 1 KB
- mongodb/SKILL.md 6 KB
- mongodb/learnings.md 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · PIXARTSeu/Synapse | 100 | AGPL-3.0 |
| ericrisco/rsc-harness | 100 | MIT |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| sickn33/agentic-awesome-skills | 100 | MIT |
| claude-dev-suite/claude-dev-suite | 100 | MIT |
| lynricsy/hyperskills | 100 | MIT |
| G1Joshi/Agent-Skills | 100 | MIT |
| MARUCIE/openclaw-foundry | 100 | MIT |
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 3ffa2198965b (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100payloadcms-ops
Payload CMS 3 (Next.js-native) architecture - collections, globals, fields, access control, hooks, Local API, storage adapters, and database (Postgres/MongoDB/SQLite). Use for: payload, payloadcms, payload cms, payload 3, collection config, access control, payload hooks, local… - 100payload
Payload CMS 3.0 knowledge base - collections, multi-tenancy, frontend integration. Use when setting up Payload CMS, configuring collections, implementing multi-tenancy, or integrating CMS with Next.js frontend. - 100mcp-server-mongodb
Use this skill when installing, configuring, and executing tools with the MongoDB collection schema discovery and document aggregation MCP server. - 90pixarts/multitenancy
Payload CMS multi-tenancy guide for Pixarts - tenant structure, access control, collections, hooks. Use when setting up multi-tenant CMS, configuring tenant access control, or implementing tenant-scoped data. - 95mongodb-natural-language-querying
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB,… - 100mongodb-natural-language-querying
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB,…