PG_MCP_SERVER
@cbc3929
PG_MCP_SERVER について
概要はまだありません
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"pg_mcp_server": {
"command": "docker",
"args": [
"build",
"-t",
"pg-mcp-server:latest",
"."
]
}
}
}ツール
ツールは検出されませんでした
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
概要
What is PG_MCP_SERVER?
PG_MCP_SERVER is a general-purpose PostgreSQL MCP (Model Context Protocol) server that provides efficient schema context to large language models by pre-processing table structures. It supports PostGIS and PgVector extensions and communicates via Stdio or SSE transports.
How to use PG_MCP_SERVER?
Configure the database connection string either in main.go via RegisterConnection or by setting the SCHEMA_LOAD_DB_URL environment variable. Run with Docker (docker run -d -p 8181:8181 pg-mcp-server:latest) or directly with go run ./cmd/server/main.go after cloning and installing dependencies.
Key features of PG_MCP_SERVER
- Pre-fetches database schema to reduce token usage.
- Uses MCP Tool descriptions and Resources for implicit schema context.
- Supports PostGIS geometry types, indexes, and EPSG codes.
- Native PgVector extension support.
- Implements Stdio and SSE transports.
- Docker deployment available.
Use cases of PG_MCP_SERVER
- Provide LLMs with optimized database context without repeated schema queries.
- Query spatial data in PostGIS-enabled databases through natural language.
- Manage vector embeddings stored with PgVector via LLM agents.
- Enable secure, role-based read-only database access for MCP applications.
FAQ from PG_MCP_SERVER
Why does PG_MCP_SERVER pre-process the database schema instead of reading it on every call?
Reading the schema on each call consumes significant time and token context. Pre-processing caches table structures, columns, constraints, foreign keys, indexes, geometry types, and EPSG codes during initialization.
What database permissions does PG_MCP_SERVER require?
It recommends creating a dedicated role with SELECT on the public schema and all privileges on a temp schema. Configuring a role limits SQL injection risk and protects sensitive data.
Which PostgreSQL extensions are supported?
PostGIS and PgVector are fully supported. PgRouting support is marked as partial (⭕).
What transport protocols are available?
PG_MCP_SERVER supports Stdio and SSE transports via the go-mcp library.
How do I configure the database connection?
Set the connection string in main.go with schemaLoadConnID, err := dbService.RegisterConnection(tempCtx, "postgres://user:pass@host:port/db") or use the SCHEMA_LOAD_DB_URL environment variable in a .env file.
「その他」の他のコンテンツ
Blender
ahujasidOpen-source MCP to use Blender with any LLM
🪟 Windows-MCP
CursorTouchMCP Server for Computer Use in Windows

EverArt
modelcontextprotocolModel Context Protocol Servers
Awesome Mcp Servers
punkpeyeA collection of MCP servers.
Servers
modelcontextprotocolModel Context Protocol Servers
コメント