mcp-database-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-database-serverShow me the top 5 customers by revenue."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Database Server
Give any AI agent (Claude Desktop, Cursor, OpenClaw, etc.) direct, natural language access to your PostgreSQL or MySQL database.
Instead of writing SQL, your agent asks questions like "show me the top 10 customers by revenue" — and gets the answer instantly.
What it does
Tool | Description |
| Run raw SQL (parameterized, injection-safe). Supports SELECT, INSERT, UPDATE, DELETE. |
| Discover all tables, columns, data types, primary/foreign keys. Agent uses this to understand your data. |
| Pre-built aggregations (count, sum, avg, top-N, group-by) without writing SQL. |
Related MCP server: Universal Database MCP Server
Quick start
Option A: Docker Compose (recommended)
# 1. Clone
git clone https://github.com/Lucasyao1985/mcp-database-server.git
cd mcp-database-server
# 2. Start Postgres + MCP server
docker compose up
# Done — the MCP server is running.Option B: Standalone
git clone https://github.com/Lucasyao1985/mcp-database-server.git
cd mcp-database-server
npm install
cp .env.example .env
# Edit .env → add your DATABASE_URL
npm run build && npm startConnect to Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"database": {
"command": "docker",
"args": [
"exec", "-i",
"mcp-database-server-mcp-database-1",
"node", "dist/index.js"
]
}
}
}For non-Docker setups, use
"command": "node"and"args": ["/absolute/path/to/dist/index.js"].
Example conversation
You: What tables are in my database?
Agent: [calls
schema] — Found 4 tables:customers,orders,products,order_items.You: Show me the top 5 customers by total spend.
Agent: [calls
analyze] — 1. Acme Corp: $48,200, 2. Globex: $31,500, ...
Security
SQL injection protection: All queries use parameterized
$1, $2, ...placeholders. Never interpolate user input directly.Read-only mode: Set
READ_ONLY=truein.envto block INSERT/UPDATE/DELETE.No data leaves your infrastructure: Everything runs locally. No telemetry.
Tech stack
MCP SDK — Model Context Protocol
Node.js / TypeScript
PostgreSQL (primary) / MySQL (supported)
Docker Compose for one-command deployment
Demo (video coming soon)
See the server in action: connect to Claude Desktop → ask a question → get live database results.
Built on the Model Context Protocol.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying and managing PostgreSQL and MySQL databases through natural language, supporting connection management, query execution, schema inspection, and parameterized queries with connection pooling.Last updated5374MIT
- Alicense-qualityAmaintenanceConnect AI agents to SQL databases (SQLite, PostgreSQL, MySQL) with a unified interface for querying data, exploring schemas, inserting rows, and exporting results to CSV. Includes safety features like dangerous query blocking and write guards.Last updated16MIT
- Flicense-qualityDmaintenanceEnables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.Last updated1
- Flicense-qualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases through natural language queries, schema inspection, and safe SQL execution.Last updated171
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lucasyao1985/mcp-database-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server