mcp-database
Allows querying, schema inspection, and management of MySQL databases through the MCP server.
Allows querying, schema inspection, and management of PostgreSQL databases through the MCP server.
Allows querying, schema inspection, and management of SQLite databases through the MCP 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-databaseshow me the schema for the users table"
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
MCP server for multi-database access — query, inspect schema, and manage SQLite, PostgreSQL, and MySQL databases through Claude.
Why mcp-database?
Problem | Solution |
Need to query a database from Claude Code / Claude Desktop | One MCP server, multiple database support |
Existing database MCP servers are JS/Go only | Pure Python, uses official |
Worried about accidental writes | Read-only by default, writes opt-in |
Don't know the schema | Built-in schema inspection, table info, search |
Related MCP server: mcp-database-server
Quick Start
# Install
pip install mcp-database
# Run with a SQLite database
MCP_DATABASE_URL=sqlite:///path/to/your.db mcp-databaseClaude Code Integration
# Add to Claude Code
claude mcp add mcp-database -- mcp-database
# Or with a specific database
claude mcp add mcp-database -e MCP_DATABASE_URL=sqlite:///path/to/db.sqlite -- mcp-databaseClaude Desktop Integration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"database": {
"command": "mcp-database",
"env": {
"MCP_DATABASE_URL": "sqlite:///path/to/your.db"
}
}
}
}Supported Databases
Database | Status | Install |
SQLite | Built-in |
|
PostgreSQL | Optional |
|
MySQL | Optional |
|
All | Optional |
|
Configuration
Environment Variables
Variable | Default | Description |
|
| Database connection URL |
|
| Database type: |
|
| Enable read-only mode |
|
| Maximum rows returned per query |
Connection URLs
# SQLite
MCP_DATABASE_URL=sqlite:///path/to/db.sqlite
MCP_DATABASE_URL=sqlite:///:memory:
# PostgreSQL
MCP_DATABASE_URL=postgres://user:password@localhost:5432/mydb
MCP_DATABASE_TYPE=postgresql
# MySQL
MCP_DATABASE_URL=mysql://user:password@localhost:3306/mydb
MCP_DATABASE_TYPE=mysqlAvailable Tools
Once connected, Claude can use these tools:
Tool | Description |
| List all configured database connections |
| List all tables in a database |
| Get detailed table info (columns, types, row count) |
| Get full database schema (CREATE TABLE statements) |
| Execute a read-only SQL query (SELECT, SHOW, DESCRIBE) |
| Execute a write statement (INSERT, UPDATE, DELETE) — opt-in only |
| Get sample rows from a table |
| Search for tables or columns by keyword |
Examples
Ask Claude things like:
"What tables are in my database?"
"Show me the schema for the users table"
"Query the top 10 orders by amount"
"Find all columns related to 'email'"
"Sample some rows from the products table"
Security
Read-only by default — queries are safe, no data modification
Write opt-in — set
allow_writes=TrueandMCP_DATABASE_READ_ONLY=falseto enableRead-only detection — write tool rejects SELECT statements (use
queryinstead)Row limits — configurable max rows to prevent accidental large result sets
Development
# Clone and install for development
git clone https://github.com/Jansen003/mcp-database.git
cd mcp-database
pip install -e ".[dev]"
# Run tests
pytest
# Run with Inspector UI
mcp dev src/mcp_database/server.pyLicense
MIT — see LICENSE.
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.
Latest Blog Posts
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/jovian-zhibai/mcp-database'
If you have feedback or need assistance with the MCP directory API, please join our Discord server