PostgreSQL
Overview
The mcp_server_template is a Model Context Protocol server that provides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only queries.
To use this server, configure it in the "mcpServers" section of your claude_desktop_config.json file, or run it using Docker or NPX with the appropriate PostgreSQL connection string.
- Execute read-only SQL queries against connected PostgreSQL databases. - Automatically discover and provide JSON schema information for each table in the database. - Supports configuration via Docker and NPX for easy deployment.
- Inspecting database schemas for data analysis.
- Executing read-only queries for reporting purposes.
- Integrating with LLMs for enhanced data interaction.
Add to your AI client
Use these steps to connect PostgreSQL in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-server-template-pyljain": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-server-template-pyljain": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-server-template-pyljain": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-server-template-pyljain": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-server-template-pyljain": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-server-template-pyljain": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-server-template-pyljain"
]
}
}
}FAQ
Can I modify the database using this server?
No, this server only allows read-only access to the database.
How do I connect to my PostgreSQL database?
You can connect by providing the PostgreSQL URL in the configuration file or command line.
Is there a license for this project?
Yes, the project is licensed under the MIT License, allowing free use, modification, and distribution.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2125,"uuid":"b9fc18f4-8a6b-4044-9f74-dfce0e454ca0","name":"mcp_server_template","title":"PostgreSQL","description":"","avatar_url":"https://avatars.githubusercontent.com/u/17947548?v=4","created_at":"2025-03-09T03:40:41.291Z","updated_at":"2025-03-12T10:19:30.007Z","status":"created","author_name":"pyljain","author_avatar_url":"https://avatars.githubusercontent.com/u/17947548?v=4","tags":"[]","category":"research-and-data","is_featured":false,"sort":1,"url":"https://github.com/pyljain/mcp_server_template","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"JavaScript\",\"is_official\":false,\"latest_commit_time\":\"2025-03-08 16:55:44\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]