Skip to content

Commit dd00251

Browse files
authored
feat: add PostgreSQL MCP server definition (#61)
* feat: add PostgreSQL MCP server definition Add PostgreSQL local stdio server via npx @modelcontextprotocol/server-postgres. Read-only access to PostgreSQL databases with schema inspection and SQL queries. https://claude.ai/code/session_013AxurW8hPAfnUNvik354Xx * fix: update server definition (input type 'password' -> 'text' for POSTGRES_URL; icon updated; doc URL fixed) * fix: update PostgreSQL documentation URL (servers repo archived) * feat(postgresql): switch to crystaldba/postgres-mcp Replace @modelcontextprotocol/server-postgres (archived, read-only only) with postgres-mcp from Crystal DBA which adds index tuning, workload analysis, EXPLAIN plans, slow query detection, and health checks. - Transport: uvx (Python package) instead of npx - Env var: DATABASE_URI (matches upstream convention) - Supports both restricted (read-only) and unrestricted access modes Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com> * fix: rename server files with transport suffix - community.postgresql.json -> community.postgresql-uvx.json (id: community.postgresql-uvx) Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com> * fix: use GitHub org as ID domain for community definitions - community.postgresql-uvx -> crystaldba.postgres-mcp-uvx Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com> * feat(postgresql): add Docker variant using crystaldba/postgres-mcp image Add Docker transport variant using the official crystaldba/postgres-mcp Docker Hub image with unrestricted access mode. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com> --------- Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 7e7bb4a commit dd00251

2 files changed

Lines changed: 149 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "../schemas/server-definition.schema.json",
3+
"id": "crystaldba.postgres-mcp-docker",
4+
"name": "PostgreSQL (Docker)",
5+
"alias": "postgres-docker",
6+
"description": "Query PostgreSQL databases, analyze performance, and optimize indexes via Docker. Execute SQL, inspect schemas, get EXPLAIN plans, identify slow queries, and run health checks.",
7+
"icon": "https://www.postgresql.org/media/img/about/press/elephant.png",
8+
"schema_version": "2.1",
9+
"categories": [
10+
"database"
11+
],
12+
"tags": [
13+
"postgres",
14+
"postgresql",
15+
"database",
16+
"sql",
17+
"docker",
18+
"index-tuning",
19+
"performance"
20+
],
21+
"transport": {
22+
"type": "stdio",
23+
"command": "docker",
24+
"args": [
25+
"run", "-i", "--rm",
26+
"-e", "DATABASE_URI",
27+
"crystaldba/postgres-mcp",
28+
"--access-mode=unrestricted"
29+
],
30+
"env": {
31+
"DATABASE_URI": "${input:DATABASE_URI}"
32+
},
33+
"metadata": {
34+
"inputs": [
35+
{
36+
"id": "DATABASE_URI",
37+
"label": "PostgreSQL Connection URI",
38+
"description": "PostgreSQL connection string. Use host.docker.internal instead of localhost for local instances.",
39+
"type": "text",
40+
"required": true,
41+
"secret": true,
42+
"placeholder": "postgresql://username:password@host.docker.internal:5432/mydb",
43+
"obtain": {
44+
"url": "https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS",
45+
"instructions": "1. Format: postgresql://username:password@host:port/database\n2. For local PostgreSQL via Docker: use host.docker.internal instead of localhost\n3. For cloud providers: check your dashboard for the connection string",
46+
"button_label": "Connection Docs"
47+
}
48+
}
49+
]
50+
}
51+
},
52+
"auth": {
53+
"type": "none"
54+
},
55+
"contributor": {
56+
"name": "Crystal DBA",
57+
"github": "crystaldba",
58+
"url": "https://github.com/crystaldba"
59+
},
60+
"links": {
61+
"repository": "https://github.com/crystaldba/postgres-mcp",
62+
"homepage": "https://www.postgresql.org",
63+
"documentation": "https://github.com/crystaldba/postgres-mcp#readme"
64+
},
65+
"platforms": [
66+
"all"
67+
],
68+
"capabilities": {
69+
"tools": true,
70+
"resources": false,
71+
"prompts": false,
72+
"read_only_mode": true
73+
},
74+
"changelog_url": "https://github.com/crystaldba/postgres-mcp/releases"
75+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"$schema": "../schemas/server-definition.schema.json",
3+
"id": "crystaldba.postgres-mcp-uvx",
4+
"name": "PostgreSQL (uvx)",
5+
"alias": "postgres",
6+
"description": "Query PostgreSQL databases, analyze performance, and optimize indexes. Execute SQL, inspect schemas, get EXPLAIN plans, identify slow queries, and run health checks via Postgres MCP Pro.",
7+
"icon": "https://www.postgresql.org/media/img/about/press/elephant.png",
8+
"schema_version": "2.1",
9+
"categories": [
10+
"database"
11+
],
12+
"tags": [
13+
"postgres",
14+
"postgresql",
15+
"database",
16+
"sql",
17+
"query",
18+
"relational",
19+
"index-tuning",
20+
"performance"
21+
],
22+
"transport": {
23+
"type": "stdio",
24+
"command": "uvx",
25+
"args": [
26+
"postgres-mcp",
27+
"--access-mode=unrestricted"
28+
],
29+
"env": {
30+
"DATABASE_URI": "${input:DATABASE_URI}"
31+
},
32+
"metadata": {
33+
"inputs": [
34+
{
35+
"id": "DATABASE_URI",
36+
"label": "PostgreSQL Connection URI",
37+
"description": "PostgreSQL connection string including host, port, database name, and credentials.",
38+
"type": "text",
39+
"required": true,
40+
"secret": true,
41+
"placeholder": "postgresql://username:password@localhost:5432/mydb",
42+
"obtain": {
43+
"url": "https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS",
44+
"instructions": "1. Format: postgresql://username:password@host:port/database\n2. For local PostgreSQL: postgresql://postgres:password@localhost:5432/mydb\n3. For cloud providers: check your dashboard for the connection string",
45+
"button_label": "Connection Docs"
46+
}
47+
}
48+
]
49+
}
50+
},
51+
"auth": {
52+
"type": "none"
53+
},
54+
"contributor": {
55+
"name": "Crystal DBA",
56+
"github": "crystaldba",
57+
"url": "https://github.com/crystaldba"
58+
},
59+
"links": {
60+
"repository": "https://github.com/crystaldba/postgres-mcp",
61+
"homepage": "https://www.postgresql.org",
62+
"documentation": "https://github.com/crystaldba/postgres-mcp#readme"
63+
},
64+
"platforms": [
65+
"all"
66+
],
67+
"capabilities": {
68+
"tools": true,
69+
"resources": false,
70+
"prompts": false,
71+
"read_only_mode": true
72+
},
73+
"changelog_url": "https://github.com/crystaldba/postgres-mcp/releases"
74+
}

0 commit comments

Comments
 (0)