Kế hoạch phát triển các tính năng tương lai, sắp xếp theo mức ưu tiên.
Trạng thái hiện tại: 45 tools, 5 resources, 5 prompts, 189 unit tests, stdio transport.
Ưu tiên: Cao · Cho phép triển khai remote, nhiều client kết nối cùng lúc.
- Implement SSE transport trong
index.ts(thay thế placeholder hiện tại) - Hỗ trợ Streamable HTTP transport (MCP spec mới)
- Thêm middleware CORS cho remote access
- Authentication cho remote transport (API key / Bearer token)
- TLS termination hướng dẫn (reverse proxy / trực tiếp)
- Health endpoint HTTP (
GET /health) cho load balancer - Config:
MCP_TRANSPORT=sse|streamable-http,MCP_PORT,MCP_AUTH_TOKEN
Ưu tiên: Cao · Đóng gói sẵn sàng cho production.
-
Dockerfile(multi-stage build, distroless/alpine image) -
docker-compose.yml(MCP server + PostgreSQL dev) -
.dockerignoretối ưu image size - GitHub Actions CI/CD pipeline:
- Lint + typecheck + test trên mỗi PR
- Build & push Docker image khi merge vào
main - Tự động publish npm khi tag release
- npm
prepublishOnlykiểm tra version bump - Hướng dẫn deploy lên fly.io / Railway / VPS
Ưu tiên: Cao · Đảm bảo chất lượng end-to-end.
- Setup PostgreSQL container cho CI (GitHub Actions service)
- Integration tests với real database:
- Tạo bảng → insert → query → update → delete → drop
- Schema inspection accuracy
- Permission enforcement end-to-end
- Rate limiting behavior
- Transaction rollback on failure
- Test SSE transport end-to-end (client ↔ server ↔ DB)
- Performance benchmarks (response time, throughput)
- Load testing với nhiều concurrent requests
Ưu tiên: Trung bình–Cao · Theo dõi mọi thao tác write/admin cho compliance.
- Audit log cho mọi write operations (INSERT/UPDATE/DELETE)
- Audit log cho DDL operations (CREATE/ALTER/DROP)
- Audit log cho admin operations (terminate, cancel, vacuum)
- Log format: timestamp, tool name, user context, SQL summary, affected rows
- Output targets: stderr (default), file (rotated), PostgreSQL table (optional)
- Config:
AUDIT_LOG_ENABLED,AUDIT_LOG_TARGET,AUDIT_LOG_FILE - Không log sensitive data (password, connection string)
Ưu tiên: Trung bình · Giảm tải cho DB khi LLM liên tục inspect schema.
- Cache schema introspection results (TTL-based, default 5 phút)
- Auto-invalidate cache khi DDL tool được gọi (create_table, alter_table, ...)
- Tool
refresh_schema_cache: manual invalidate - Sampling: resource
postgres://sample/{table}trả 5 dòng đầu tiên - Config:
SCHEMA_CACHE_TTL_MS(0 = disabled)
Ưu tiên: Trung bình · Cho phép LLM làm việc với nhiều database cùng lúc.
- Config nhận nhiều connection strings qua
POSTGRES_DATABASES(JSON array) - Mỗi tool call nhận optional
databaseparameter - Connection pool per database (lazy init)
- Resource
postgres://databases: liệt kê tất cả databases đã configure - Tool
switch_database: chuyển database mặc định - Tự động prefix database name trong output để tránh nhầm lẫn
Ưu tiên: Trung bình · LLM có thể reference lại queries trước đó.
- Lưu N queries gần nhất (in-memory ring buffer, default 50)
- Resource
postgres://history: danh sách queries đã chạy + kết quả tóm tắt - Tool
get_query_history: lấy lịch sử theo filter - Tool
rerun_query: chạy lại query từ lịch sử (by index) - Tự động attach execution time, row count vào mỗi entry
- Config:
QUERY_HISTORY_SIZE(0 = disabled)
Ưu tiên: Trung bình · Hỗ trợ LLM tạo và chạy migration files.
- Tool
generate_migration: tạo migration file (SQL up/down) từ schema diff - Tool
list_migrations: liệt kê migrations đã chạy (đọc từ migration table) - Tool
run_migration: chạy migration (yêu cầuadminpermission) - Tool
rollback_migration: rollback migration gần nhất - Tương thích format với các migration tools phổ biến (Knex, Prisma, Flyway)
- Directory:
migrations/hoặc configurable path
Ưu tiên: Thấp–Trung bình · Hỗ trợ các extension phổ biến.
- PostGIS: tools cho spatial queries (
ST_Distance,ST_Contains, ...) - pg_trgm: fuzzy search tool (
similarity(),%operator) - hstore/jsonb: tools chuyên biệt cho JSON operations
- pgvector: vector similarity search cho AI embeddings
- Auto-detect extensions đã cài trong database
- Resource
postgres://extensions: liệt kê extensions + version
Ưu tiên: Thấp–Trung bình · Xử lý large result sets qua MCP streaming.
- Stream rows qua MCP progress notifications thay vì load toàn bộ vào memory
- Tool
query_stream: query trả kết quả theo batch (chunk_size configurable) - Hỗ trợ cursor-based pagination cho datasets lớn
- Memory limit per query (default 50MB), abort nếu vượt
- Config:
STREAM_CHUNK_SIZE,MAX_RESULT_MEMORY_MB
Ưu tiên: Thấp (nice-to-have) · Bảo mật nâng cao.
- IP whitelist cho remote transport
- Per-tool permission overrides (VD: cho phép
querynhưng blockexecute) - Schema-level permission (chỉ cho phép truy cập schema
public) - Table-level permission (whitelist/blacklist bảng cụ thể)
- Query cost estimation — reject query nếu EXPLAIN cost quá cao
- Secrets masking trong log output (connection strings, passwords)
- Config:
ALLOWED_SCHEMAS,ALLOWED_TABLES,MAX_QUERY_COST
Ưu tiên: Thấp · Monitoring cho production deployments.
- Prometheus metrics endpoint (
/metrics):mcp_tool_calls_total(counter, label: tool_name, status)mcp_tool_duration_seconds(histogram)mcp_db_pool_connections(gauge: active, idle, waiting)mcp_rate_limit_rejected_total(counter)
- OpenTelemetry tracing (optional dependency)
- Structured JSON logging (machine-parseable)
- Config:
METRICS_ENABLED,METRICS_PORT
Ưu tiên: Thấp · Cải thiện trải nghiệm phát triển.
- ESLint + Prettier config
- Husky pre-commit hooks (lint + test)
-
CONTRIBUTING.mdhướng dẫn contribute - CLI mode:
npx postgres-mcp --interactivecho testing nhanh - MCP Inspector integration guide
- Changelog tự động từ conventional commits
| Ưu tiên | Phase | Chủ đề |
|---|---|---|
| 🔴 Cao | 8 | SSE / Streamable HTTP Transport |
| 🔴 Cao | 9 | Docker & CI/CD |
| 🔴 Cao | 10 | Integration Testing |
| 🟡 TB–Cao | 11 | Audit Logging |
| 🟡 TB | 12 | Schema Caching & Sampling |
| 🟡 TB | 13 | Multi-Database Support |
| 🟡 TB | 14 | Query History & Context |
| 🟡 TB | 15 | Migration Management |
| 🟢 Thấp–TB | 16 | PostgreSQL Extension Support |
| 🟢 Thấp–TB | 17 | Streaming Results |
| 🟢 Thấp | 18 | Security Hardening |
| 🟢 Thấp | 19 | Observability (Metrics/Tracing) |
| 🟢 Thấp | 20 | Developer Experience |
Cập nhật lần cuối: 2026-03-01