by executeautomation
Provides Claude with direct access to SQLite, SQL Server, PostgreSQL, and MySQL databases through an MCP server.
Mcp Database Server enables Claude to interact with various relational databases (SQLite, SQL Server, PostgreSQL, MySQL) by exposing a set of query and schema‑management tools via the Model Context Protocol.
npm install
, and build with npm run build
.npm install -g @executeautomation/database-server
or use npx
to run it without a global install.index.js
with the appropriate flags for the target database (e.g., node dist/src/index.js /path/to/db.sqlite
for SQLite, or use --sqlserver
, --postgresql
, --mysql
flags for other databases).claude_desktop_config.json
that point to the command and arguments for each database type.read_query
, write_query
, create_table
, alter_table
, drop_table
, list_tables
, describe_table
, export_query
, append_insight
, list_insights
.npx
.Q: Do I need to build the project before using it?
A: Not if you use the npm package with npx
; the pre‑built binary will be fetched automatically. Building is only required for local development.
Q: Which Node.js version is required? A: Node.js 18 or newer.
Q: How do I connect to a SQL Server using Windows Authentication?
A: Omit the --user
and --password
flags; the server will fall back to Windows Authentication.
Q: Can I run multiple database servers simultaneously? A: Yes. Configure separate entries in Claude Desktop for each database type or instance.
Q: Where are the configuration files for Claude Desktop located?
A: macOS – ~/Library/Application Support/Claude/claude_desktop_config.json
; Windows – %APPDATA%\Claude\claude_desktop_config.json
; Linux – ~/.config/Claude/claude_desktop_config.json
.
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 mcp-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)For Amazon RDS MySQL instances with IAM database authentication:
Prerequisites:
aws configure
(uses default profile)AWS_PROFILE=myprofile
environment variableAWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variablesnode dist/src/index.js --mysql --aws-iam-auth --host <rds-endpoint> --database <database-name> --user <aws-username> --aws-region <region>
Required parameters:
--host
: RDS endpoint hostname--database
: Name of the database--aws-iam-auth
: Enable AWS IAM authentication--user
: AWS IAM username (also the database user)--aws-region
: AWS region where RDS instance is locatedNote: SSL is automatically enabled for AWS IAM authentication
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"
]
},
"mysql-aws": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"--mysql",
"--aws-iam-auth",
"--host", "your-rds-endpoint.region.rds.amazonaws.com",
"--database", "your-database-name",
"--user", "your-aws-username",
"--aws-region", "us-east-1"
]
}
}
}
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"
]
},
"mysql-aws": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"--mysql",
"--aws-iam-auth",
"--host", "your-rds-endpoint.region.rds.amazonaws.com",
"--database", "your-database-name",
"--user", "your-aws-username",
"--aws-region", "us-east-1"
]
}
}
}
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.
{ "mcpServers": { "sqlite": { "command": "npx", "args": [ "-y", "@executeautomation/database-server", "/path/to/your/database.db" ], "env": {} }, "sqlserver": { "command": "npx", "args": [ "-y", "@executeautomation/database-server", "--sqlserver", "--server", "<your-server-name>", "--database", "<your-database-name>", "--user", "<username>", "--password", "<password>" ], "env": {} }, "postgresql": { "command": "npx", "args": [ "-y", "@executeautomation/database-server", "--postgresql", "--host", "<your-host-name>", "--database", "<your-database-name>", "--user", "<username>", "--password", "<password>" ], "env": {} }, "mysql": { "command": "npx", "args": [ "-y", "@executeautomation/database-server", "--mysql", "--host", "<your-host-name>", "--database", "<your-database-name>", "--port", "3306", "--user", "<username>", "--password", "<password>" ], "env": {} }, "mysql-aws": { "command": "npx", "args": [ "-y", "@executeautomation/database-server", "--mysql", "--aws-iam-auth", "--host", "<your-rds-endpoint.region.rds.amazonaws.com>", "--database", "<your-database-name>", "--user", "<aws-username>", "--aws-region", "<region>" ], "env": {} } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by chroma-core
Offers an MCP server exposing Chroma's vector database capabilities for LLM applications, supporting collection and document management, multiple embedding functions, and flexible client types such as in‑memory, persistent, HTTP, and cloud.
by kiliczsh
Enables LLMs to interact with MongoDB databases via a standardized interface, offering schema inspection, query execution, aggregation, and write capabilities, with optional read‑only mode and smart ObjectId handling.
by domdomegg
Provides read and write access to Airtable bases for AI systems, enabling inspection of schemas and manipulation of records.
by XGenerationLab
A Model Context Protocol (MCP) server that enables natural language queries to databases