IP

isdaniel/pgtuner_mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

30 stars 5 forks 품질 78 트렌드 15Apache-2.0

aI-powered PostgreSQL 성능 조정 기능을 제공합니다.

개요

AI-powered PostgreSQL 성능 조정 기능을 제공하는 모델 Context Protocol (MCP) 서버. 이 서버는 느린 쿼리를 식별하고 최적의 인덱스를 검토하고 실행 계획을 분석하고, hypothetical 색인 테스트를 위해 HypoPG를 활용합니다. - 상세한 통계를 가진 pg stat statements에서 느린 쿼리를 검색 - EXPLAIN 및 EXPLAIN ANALYZE와 함께 쿼리 실행 계획 - 자동화 된 계획 분석으로 성능 병목을 식별 - 활성 쿼리를 모니터링하고 긴 실행 트랜잭션을 감지 - 쿼리 워크로드 분석 기반의 AI-powered Index 권고 - 확장 (디스크 사용 없음)을 가진 Hypothetical 색인 테스트 - Cleanup에 대한 사용 및 중복 색인 찾기 - 생성하기 전에 예상 인덱스 크기 - 구현하기 전에 제안 된 인덱스와 테스트 쿼리 계획 - 여러 검사와 포괄적인 건강 득점 - 연결 활용 모니터링 - 캐시 히트 비율 분석 (buffer and index) - 잠금 콘텐츠 감지 - 진공 건강 및 거래 ID ...

개요(AI 번역)

AI-powered PostgreSQL 성능 조정 기능을 제공하는 모델 Context Protocol (MCP) 서버. 이 서버는 느린 쿼리를 식별하고 최적의 인덱스를 검토하고 실행 계획을 분석하고, hypothetical 색인 테스트를 위해 HypoPG를 활용합니다.

특징

Query 분석

  • pg_stat_statements]의 느린 쿼리를 상세 통계로 검색
  • EXPLAIN 및 EXPLAIN ANALYZE와 함께 쿼리 실행 계획 분석
  • 자동화된 계획 분석으로 성능 병목을 식별
  • 모니터 활성 쿼리 및 긴 실행 트랜잭션을 감지

인덱스

  • 쿼리 워크로드 분석 기반의 AI-powered Index 권고
  • Hypothetical index testing with **HypoPG ** 확장 (디스크 사용 없음)
  • Cleanup에 대한 사용 및 중복 색인 찾기
  • 생성하기 전에 예상 색인 크기
  • 구현하기 전에 제안 된 인덱스와 테스트 쿼리 계획

데이터베이스 건강

  • 여러 검사를 통한 종합적인 건강
  • 연결 이용 감시
  • 캐시 히트 비율 분석 (buffer 및 색인)
  • 잠금 콘텐츠 감지
  • 진공 건강 및 거래 ID 추적 모니터링
  • 복제 지연 모니터링
  • 배경 작가 및 체크포인트 분석

진공 모니터링

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

PostgreSQL Performance Tuning MCP

A Model Context Protocol (MCP) server that provides AI-powered PostgreSQL performance tuning capabilities. This server helps identify slow queries, recommend optimal indexes, analyze execution plans, and leverage HypoPG for hypothetical index testing.

Features

Query Analysis

  • Retrieve slow queries from pg_stat_statements with detailed statistics
  • Analyze query execution plans with EXPLAIN and EXPLAIN ANALYZE
  • Identify performance bottlenecks with automated plan analysis
  • Monitor active queries and detect long-running transactions

Index Tuning

  • AI-powered index recommendations based on query workload analysis
  • Hypothetical index testing with HypoPG extension (no disk usage)
  • Find unused and duplicate indexes for cleanup
  • Estimate index sizes before creation
  • Test query plans with proposed indexes before implementing

Database Health

  • Comprehensive health scoring with multiple checks
  • Connection utilization monitoring
  • Cache hit ratio analysis (buffer and index)
  • Lock contention detection
  • Vacuum health and transaction ID wraparound monitoring
  • Replication lag monitoring
  • Background writer and checkpoint analysis

Vacuum Monitoring

  • Track long-running VACUUM and VACUUM FULL operations in real-time
  • Monitor autovacuum progress and performance
  • Identify tables that need vacuuming
  • View recent vacuum activity history
  • Analyze autovacuum configuration effectiveness

I/O Performance Analysis

  • Analyze disk read/write patterns across tables and indexes
  • Identify I/O bottlenecks and hot tables
  • Monitor buffer cache hit ratios
  • Track temporary file usage indicating work_mem issues
  • Analyze checkpoint and background writer I/O
  • PostgreSQL 16+ enhanced pg_stat_io metrics support

Configuration Analysis

  • Review PostgreSQL settings by category
  • Get recommendations for memory, checkpoint, WAL, autovacuum, and connection settings
  • Identify suboptimal configurations

MCP Prompts & Resources

  • Pre-defined prompt templates for common tuning workflows
  • Dynamic resources for table stats, index info, and health checks
  • Comprehensive documentation resources

Installation

Standard Installation (for MCP clients like Claude Desktop)

GitHub에서 전체 README 보기

설치

docker run -p 8080:8080 \
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "pgtuner_mcp": { "command": "python", "args": ["-m", "pgtuner_mcp"], "env": { "DATABASE_URI": "postgresql://user:password@localhost:5432/mydb" }, "disabled": false, "autoApprove": [] } } }