home / mcp / mcp database server

MCP Database Server

Provides database access via MCP to SQLite, SQL Server, PostgreSQL, and MySQL databases.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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 build

Configuration and usage notes

Configure 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"
      ]
    }
  }
}

Development and run options

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

Requirements and notes

- Node.js 18+ is required. - For SQL Server connectivity, use SQL Server 2012 or later. - For PostgreSQL connectivity, use PostgreSQL 9.5 or later.

Development commands

# Run in development mode
npm run dev

# Watch for changes during development
npm run watch

Available tools

read_query

Execute SELECT queries to read data

write_query

Execute INSERT, UPDATE, or DELETE queries

create_table

Create new tables in the database

alter_table

Modify existing table schema

drop_table

Remove a table from the database

list_tables

Get a list of all tables

describe_table

View schema information for a table

export_query

Export query results as CSV/JSON

append_insight

Add a business insight to memo

list_insights

List all business insights