Database Mcp Server avatar
Database Mcp Server

Pricing

Pay per usage

Go to Apify Store
Database Mcp Server

Database Mcp Server

MCP Server for AI database access. Connect to PostgreSQL, MySQL, or SQLite. Query data, inspect schemas, list tables, describe columns, view indexes and foreign keys. 11 tools for complete database intelligence. Works with Claude Desktop and any MCP client.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Quadruped

Quadruped

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

SQL Intelligence for AI Agents

Connect to PostgreSQL, MySQL, or SQLite databases. Query data, inspect schemas, manage tables. Works with Claude Desktop, VS Code, and any MCP client.

Features

  • Multi-database support: PostgreSQL, MySQL, SQLite
  • Query execution: SELECT with automatic LIMIT protection
  • Schema inspection: List tables, describe columns, foreign keys, indexes
  • Safe operations: Separate query (read) and execute (write) tools
  • Cloud-ready: Secure connections via Apify infrastructure

Tools

ToolDescription
db.connectConnect to a database
db.disconnectClose connection
db.queryExecute SELECT queries (read-only)
db.executeExecute INSERT/UPDATE/DELETE/DDL
db.list_tablesList all tables
db.describe_tableGet column definitions
db.get_schemaFull schema (all tables)
db.list_databasesList databases on server
db.table_infoRow count, size statistics
db.foreign_keysForeign key relationships
db.indexesIndex information

Input Examples

Connect to PostgreSQL

{
"tool": "db.connect",
"dbType": "postgresql",
"connectionString": "postgresql://user:pass@host:5432/dbname"
}

Or with individual parameters:

{
"tool": "db.connect",
"dbType": "postgresql",
"host": "your-host.com",
"port": 5432,
"database": "mydb",
"user": "myuser",
"password": "mypassword",
"ssl": true
}

Connect to MySQL

{
"tool": "db.connect",
"dbType": "mysql",
"host": "your-mysql-host.com",
"port": 3306,
"database": "mydb",
"user": "myuser",
"password": "mypassword"
}

Connect to SQLite (from URL)

{
"tool": "db.connect",
"dbType": "sqlite",
"sqliteUrl": "https://example.com/database.db"
}

Query Data

{
"tool": "db.query",
"dbType": "postgresql",
"connectionString": "postgresql://...",
"query": "SELECT * FROM users WHERE active = true",
"limit": 100
}

Get Schema

{
"tool": "db.get_schema",
"dbType": "postgresql",
"connectionString": "postgresql://..."
}

Describe Table

{
"tool": "db.describe_table",
"dbType": "postgresql",
"connectionString": "postgresql://...",
"tableName": "users"
}

Execute Statement

{
"tool": "db.execute",
"dbType": "postgresql",
"connectionString": "postgresql://...",
"query": "INSERT INTO logs (message) VALUES ('Hello World')"
}

Output Format

{
"type": "tool_result",
"tool": "db.query",
"status": "success",
"data": {
"rows": [...],
"fields": ["column1", "column2"]
},
"rowCount": 10,
"executionTime": 45
}

Security

  • Passwords and connection strings are marked as secrets
  • SSL enabled by default for PostgreSQL and MySQL
  • Query results limited to prevent memory issues
  • Separate read (query) and write (execute) operations

Use Cases

  • Data exploration: Quickly understand database structure
  • Report generation: Query data for AI-generated reports
  • Schema documentation: Auto-generate database docs
  • Data migration: Inspect source and target schemas
  • Debugging: Query logs and metrics tables

MCP Client Configuration

For Claude Desktop (claude_desktop_config.json):

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-client", "https://api.apify.com/..."]
}
}
}

Database MCP Server v1.0.0