home / mcp / mcp database server
Provides database access via MCP to SQLite, SQL Server, PostgreSQL, and MySQL databases.
Configuration
View docs{
"mcpServers": {
"anit05-mcp": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"/path/to/your/database.db"
]
}
}
}The MCP Database Server lets Claude access and manipulate your databases from within Claude Studio. It supports SQLite, SQL Server, PostgreSQL, and MySQL, enabling you to run queries, create and modify tables, export results, and manage business insights directly through Claude.
You connect to a supported database through a dedicated MCP server entry in Claude Desktop. The server provides a set of tools to read, write, and manage data, such as reading queries, writing queries, creating and altering tables, and exporting results. Use these tools to run ad-hoc queries, build data-driven insights, and keep your data in sync with Claude’s conversational capabilities.
Prerequisites: Node.js 18 or later and npm. You will install, build, and run the MCP Database Server to expose the database connections to Claude.
# Install dependencies for the MCP Database Server
npm install
# Build the project
npm run buildConfigure Claude Desktop to connect to your databases using the provided MCP startup commands. You can run the server via npm using npx to spawn the MCP package, or run a local build with Node.js from the dist output. The following examples illustrate how to set up each database type.
{
"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"
]
}
}
}If you prefer to run the server locally from a built distribution, start it with Node.js from the dist output.
# Start from the built distribution
node dist/src/index.js /path/to/your/database.db
# Or with explicit database server options for others
node dist/src/index.js --sqlserver --server your-server-name --database your-database-name --user your-username --password your-password- Node.js 18+ is required. - For SQL Server connectivity, use SQL Server 2012 or later. - For PostgreSQL connectivity, use PostgreSQL 9.5 or later.
# Run in development mode
npm run dev
# Watch for changes during development
npm run watchExecute SELECT queries to read data
Execute INSERT, UPDATE, or DELETE queries
Create new tables in the database
Modify existing table schema
Remove a table from the database
Get a list of all tables
View schema information for a table
Export query results as CSV/JSON
Add a business insight to memo
List all business insights