- fix(pagination): SQL injection em cursor pagination - validação de nomes de campos - fix(transaction): substituir Math.random() por crypto.randomBytes() para jitter - fix(monitoring): memory leak - adicionar .unref() ao setInterval - docs: adicionar relatório completo de bugs (BUG-REPORT-2026-01-31.md) - chore: actualizar versão para 1.2.4
134 lines
4.1 KiB
Markdown
134 lines
4.1 KiB
Markdown
# Prompt de Continuação - MCP Outline PostgreSQL
|
|
|
|
## Estado Actual
|
|
|
|
**MCP Outline PostgreSQL v1.2.3** - DESENVOLVIMENTO COMPLETO + SECURITY HARDENED
|
|
|
|
- 164 tools implementadas em 33 módulos
|
|
- Build passa sem erros
|
|
- Repositório: https://git.descomplicar.pt/ealmeida/mcp-outline-postgresql
|
|
- Configurado em `~/.claude.json` como `outline-postgresql`
|
|
- **Security Score: 8.5/10** (após auditorias v1.2.2 e v1.2.3)
|
|
|
|
## Security Fixes (v1.2.3)
|
|
|
|
- Cryptographic random generation (`crypto.randomBytes()`) para OAuth secrets, API keys, share URLs
|
|
- API keys armazenam apenas hash (SHA-256), nunca texto plain
|
|
- Validação URL HTTP(S) para prevenir javascript:, data:, file: XSS
|
|
- Validação de inteiros para IDs externos (Desk CRM)
|
|
- Memory leak fix no rate limiter (lifecycle com start/stop)
|
|
- Graceful shutdown handler no index.ts
|
|
|
|
## Módulos Implementados (33 total, 164 tools)
|
|
|
|
### Core (50 tools)
|
|
- documents (19) - CRUD, search, archive, move, templates, memberships
|
|
- collections (14) - CRUD, memberships, groups, export
|
|
- users (9) - CRUD, suspend, activate, promote, demote
|
|
- groups (8) - CRUD, memberships
|
|
|
|
### Collaboration (14 tools)
|
|
- comments (6) - CRUD, resolve
|
|
- shares (5) - CRUD, revoke
|
|
- revisions (3) - list, info, compare
|
|
|
|
### System (12 tools)
|
|
- events (3) - audit log, statistics
|
|
- attachments (5) - CRUD, stats
|
|
- file-operations (4) - import/export jobs
|
|
|
|
### Authentication (10 tools)
|
|
- oauth (8) - OAuth clients, authentications
|
|
- auth (2) - auth info, config
|
|
|
|
### User Engagement (14 tools)
|
|
- stars (3) - bookmarks
|
|
- pins (3) - pinned documents
|
|
- views (2) - view tracking
|
|
- reactions (3) - emoji reactions
|
|
- emojis (3) - custom emojis
|
|
|
|
### API & Integration (14 tools)
|
|
- api-keys (4) - programmatic access
|
|
- webhooks (4) - event subscriptions
|
|
- integrations (6) - external integrations (Slack, embeds)
|
|
|
|
### Notifications (8 tools)
|
|
- notifications (4) - user notifications
|
|
- subscriptions (4) - document subscriptions
|
|
|
|
### Templates & Imports (9 tools)
|
|
- templates (5) - document templates
|
|
- imports (4) - import job management
|
|
|
|
### Permissions (3 tools)
|
|
- user-permissions (3) - grant/revoke permissions
|
|
|
|
### Bulk Operations (6 tools)
|
|
- bulk-operations (6) - batch archive, delete, move, restore, user management
|
|
|
|
### Analytics & Search (15 tools)
|
|
- backlinks (1) - document link references
|
|
- search-queries (2) - search analytics
|
|
- advanced-search (6) - faceted search, recent, orphaned, duplicates
|
|
- analytics (6) - overview, user activity, content insights, growth metrics
|
|
|
|
### Teams (5 tools)
|
|
- teams (5) - team/workspace management
|
|
|
|
### Export/Import & External Sync (4 tools)
|
|
- export-import (2) - Markdown export/import with hierarchy
|
|
- desk-sync (2) - Desk CRM integration
|
|
|
|
## Configuração Actual
|
|
|
|
```json
|
|
"outline-postgresql": {
|
|
"command": "node",
|
|
"args": ["/home/ealmeida/mcp-servers/mcp-outline-postgresql/dist/index.js"],
|
|
"env": {
|
|
"DATABASE_URL": "postgres://outline:outline_dev_2026@localhost:5432/outline",
|
|
"LOG_LEVEL": "error"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Prompt Para Continuar
|
|
|
|
```
|
|
Continuo o trabalho no MCP Outline PostgreSQL.
|
|
|
|
Path: /home/ealmeida/mcp-servers/mcp-outline-postgresql
|
|
|
|
Estado: v1.2.3 completo com 164 tools em 33 módulos.
|
|
Security hardened após auditorias (SQL injection, crypto, URL validation, transactions).
|
|
|
|
O MCP está configurado em ~/.claude.json como "outline-postgresql".
|
|
```
|
|
|
|
## Ficheiros Chave
|
|
|
|
- `src/index.ts` - Entry point MCP
|
|
- `src/tools/*.ts` - 31 módulos de tools
|
|
- `src/pg-client.ts` - Cliente PostgreSQL
|
|
- `.env` - Configuração BD local
|
|
- `SPEC-MCP-OUTLINE.md` - Especificação completa
|
|
- `CHANGELOG.md` - Histórico de alterações
|
|
|
|
## Utils Disponíveis (v1.2.3)
|
|
|
|
```
|
|
src/utils/
|
|
├── security.ts # Validações, rate limiting, URL validation
|
|
├── transaction.ts # Transacções com retry logic
|
|
├── query-builder.ts # Query builder parametrizado
|
|
├── validation.ts # Validação Zod-based
|
|
├── audit.ts # Audit logging
|
|
├── monitoring.ts # Pool health monitoring
|
|
├── pagination.ts # Cursor-based pagination
|
|
└── logger.ts # Logging
|
|
```
|
|
|
|
---
|
|
*Última actualização: 2026-01-31 (v1.2.3)*
|