by executeautomation
MCP Database Server is a new MCP Server which helps connect with Sqlite, SqlServer and Posgresql Databases
MCP Database Server is a Model Context Protocol (MCP) server designed to provide database access capabilities to AI models like Claude. It supports connections to various relational databases, including SQLite, SQL Server, PostgreSQL, and MySQL.
There are two primary ways to use the MCP Database Server:
npm install -g @executeautomation/database-server
. This allows direct use without local building.npm install
), and build the project (npm run build
). Then, run the server using node dist/src/index.js
with specific arguments for your chosen database type (SQLite, SQL Server, PostgreSQL, MySQL).To integrate with Claude Desktop, you need to configure the mcpServers
section in your Claude Desktop configuration file (e.g., ~/Library/Application Support/Claude/claude_desktop_config.json
on macOS) with the appropriate command and arguments for direct usage or local development.
read_query
: Execute SELECT queries.write_query
: Execute INSERT, UPDATE, or DELETE queries.create_table
: Create new tables.alter_table
: Modify existing table schemas.drop_table
: Remove tables.list_tables
: List all tables.describe_table
: View table schema information.export_query
: Export query results as CSV/JSON.append_insight
: Add business insights.list_insights
: List all business insights.Q: What databases does MCP Database Server support? A: It supports SQLite, SQL Server, PostgreSQL, and MySQL.
Q: How do I install MCP Database Server?
A: You can install it globally via npm (npm install -g @executeautomation/database-server
) or clone the repository and build it locally.
Q: How do I configure Claude Desktop to use MCP Database Server?
A: You need to modify the mcpServers
section in your Claude Desktop configuration file with the appropriate command and arguments for your chosen database and usage method.
Q: What kind of database operations can Claude perform using this server? A: Claude can perform read (SELECT), write (INSERT, UPDATE, DELETE), table creation, alteration, dropping, listing, describing, and exporting queries, as well as managing business insights.
Q: What are the requirements for running MCP Database Server? A: Node.js 18+ is required. Specific database versions are also needed for SQL Server (2012+) and PostgreSQL (9.5+).
This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.
git clone https://github.com/executeautomation/mcp-database-server.git
cd database-server
npm install
npm run build
There are two ways to use this MCP server with Claude:
The easiest way to use this MCP server is by installing it globally:
npm install -g @executeautomation/database-server
This allows you to use the server directly without building it locally.
If you want to modify the code or run from your local environment:
To use with an SQLite database:
node dist/src/index.js /path/to/your/database.db
To use with a SQL Server database:
node dist/src/index.js --sqlserver --server <server-name> --database <database-name> [--user <username> --password <password>]
Required parameters:
--server
: SQL Server host name or IP address--database
: Name of the databaseOptional parameters:
--user
: Username for SQL Server authentication (if not provided, Windows Authentication will be used)--password
: Password for SQL Server authentication--port
: Port number (default: 1433)To use with a PostgreSQL database:
node dist/src/index.js --postgresql --host <host-name> --database <database-name> [--user <username> --password <password>]
Required parameters:
--host
: PostgreSQL host name or IP address--database
: Name of the databaseOptional parameters:
--user
: Username for PostgreSQL authentication--password
: Password for PostgreSQL authentication--port
: Port number (default: 5432)--ssl
: Enable SSL connection (true/false)--connection-timeout
: Connection timeout in milliseconds (default: 30000)To use with a MySQL database:
node dist/src/index.js --mysql --host <host-name> --database <database-name> --port <port> [--user <username> --password <password>]
Required parameters:
--host
: MySQL host name or IP address--database
: Name of the database--port
: Port number (default: 3306)Optional parameters:
--user
: Username for MySQL authentication--password
: Password for MySQL authentication--ssl
: Enable SSL connection (true/false or object)--connection-timeout
: Connection timeout in milliseconds (default: 30000)If you installed the package globally, configure Claude Desktop with:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"/path/to/your/database.db"
]
},
"sqlserver": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"--sqlserver",
"--server", "your-server-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
},
"postgresql": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"--postgresql",
"--host", "your-host-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
},
"mysql": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"--mysql",
"--host", "your-host-name",
"--database", "your-database-name",
"--port", "3306",
"--user", "your-username",
"--password", "your-password"
]
}
}
}
For local development, configure Claude Desktop to use your locally built version:
{
"mcpServers": {
"sqlite": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"/path/to/your/database.db"
]
},
"sqlserver": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"--sqlserver",
"--server", "your-server-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
},
"postgresql": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"--postgresql",
"--host", "your-host-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
},
"mysql": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"--mysql",
"--host", "your-host-name",
"--database", "your-database-name",
"--port", "3306",
"--user", "your-username",
"--password", "your-password"
]
}
}
}
The Claude Desktop configuration file is typically located at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
The MCP Database Server provides the following tools that Claude can use:
Tool | Description | Required Parameters |
---|---|---|
read_query |
Execute SELECT queries to read data | query : SQL SELECT statement |
write_query |
Execute INSERT, UPDATE, or DELETE queries | query : SQL modification statement |
create_table |
Create new tables in the database | query : CREATE TABLE statement |
alter_table |
Modify existing table schema | query : ALTER TABLE statement |
drop_table |
Remove a table from the database | table_name : Name of tableconfirm : Safety flag (must be true) |
list_tables |
Get a list of all tables | None |
describe_table |
View schema information for a table | table_name : Name of table |
export_query |
Export query results as CSV/JSON | query : SQL SELECT statementformat : "csv" or "json" |
append_insight |
Add a business insight to memo | insight : Text of insight |
list_insights |
List all business insights | None |
For practical examples of how to use these tools with Claude, see Usage Examples.
To run the server in development mode:
npm run dev
To watch for changes during development:
npm run watch
MIT
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by googleapis
Provides a configurable MCP server that abstracts connection pooling, authentication, observability, and tool management to accelerate development of database‑backed AI tools.
by bytebase
DBHub is a universal database gateway that implements the Model Context Protocol (MCP) server interface, enabling MCP-compatible clients to interact with various databases.
by neo4j-contrib
Provides Model Context Protocol servers for interacting with Neo4j databases, managing Aura instances, and handling personal knowledge graph memory through natural‑language interfaces.
by mongodb-js
Provides a Model Context Protocol server that connects to MongoDB databases and Atlas clusters, exposing a rich set of tools for querying, managing, and administering data and infrastructure.
by benborla
A Model Context Protocol (MCP) server that provides read-only access to MySQL databases, enabling Large Language Models (LLMs) to inspect database schemas and execute read-only queries.
by ClickHouse
Provides tools that let AI assistants run read‑only SQL queries against ClickHouse clusters or the embedded chDB engine, plus a health‑check endpoint for service monitoring.
by elastic
Provides direct, natural‑language access to Elasticsearch indices via the Model Context Protocol, allowing AI agents to query and explore data without writing DSL.
by motherduckdb
Provides an MCP server that enables SQL analytics on DuckDB and MotherDuck databases, allowing AI assistants and IDEs to execute queries via a unified interface.
by redis
Provides a natural language interface for agentic applications to manage and search data in Redis efficiently.