MCP Connector

Query and interact with SQL Server, SQLite, PostgreSQL

MCP server giving Claude read/write database access to SQLite, SQL Server, PostgreSQL, and MySQL, including AWS RDS IAM auth.

Works with sqlserversqlitepostgresql

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated 11 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Enable rapid database interaction and querying across multiple database systems including SQL Server, SQLite, and PostgreSQL without complex configuration or setup.

Outcomes

What it gets done

01

Connect to SQL Server databases for querying and data retrieval

02

Execute queries against SQLite database files

03

Interact with PostgreSQL databases for data operations

04

Perform cross-database operations across different SQL platforms

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-mcp-database-server | bash

Overview

MCP-Database-Server MCP server

MCP server giving Claude read and write access to SQLite, SQL Server, PostgreSQL, and MySQL databases: running queries, managing schema, exporting results as CSV or JSON, and recording business insights. Use when Claude needs to query or modify a real SQL database directly, including AWS RDS MySQL via IAM authentication, rather than working from a schema description alone.

What it does

MCP Database Server gives Claude direct database access across SQLite, SQL Server, PostgreSQL, and MySQL, exposing tools to run read and write queries, manage table schema, export query results, and accumulate a running memo of business insights during a session.

When to use - and when NOT to

Use it when Claude needs direct read/write access to a SQLite, SQL Server, PostgreSQL, or MySQL database - running queries, inspecting or modifying schema, exporting results, or building up a business-insight memo over a session. It requires Node.js 18+, and SQL Server 2012 or later / PostgreSQL 9.5 or later specifically when connecting to those engines.

Inputs and outputs

Inputs are the target database connection details (a local .db file path for SQLite, or --host/--server, --database, and optional --user/--password/--port/--ssl/--connection-timeout for the server-based engines) plus the SQL or parameters for each tool call. Available tools: read_query (execute a SELECT statement), write_query (INSERT/UPDATE/DELETE), create_table, alter_table, drop_table (requires a confirm: true safety flag), list_tables, describe_table, export_query (results as CSV or JSON), append_insight (add a business insight to the memo), and list_insights (list all recorded insights).

Integrations

Supports standard username/password authentication for SQL Server, PostgreSQL, and MySQL, Windows Authentication for SQL Server when no user is supplied, SSL connections for PostgreSQL and MySQL, and AWS IAM database authentication for Amazon RDS MySQL instances via --aws-iam-auth, drawing AWS credentials from aws configure, the AWS_PROFILE environment variable, AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY environment variables, or EC2 IAM roles - SSL is enabled automatically in this mode.

How to install

Install globally for direct usage:

npm install -g @executeautomation/database-server

Or clone and build for local development:

git clone https://github.com/executeautomation/mcp-database-server.git
cd mcp-database-server

Then run it against SQLite with node dist/src/index.js /path/to/your/database.db, or pass --sqlserver, --postgresql, or --mysql with --host/--server and --database for the other engines. Configure Claude Desktop's mcpServers entry to run the package via npx (direct usage) or node dist/src/index.js (local development) with the same flags. During development, npm run dev runs the server directly and npm run watch rebuilds on file changes; separate setup guides cover SQL Server and PostgreSQL connection details, with a usage-examples doc showing example queries and commands to run through Claude. Licensed under the MIT license.

Who it's for

Developers who want Claude to query, modify, export, and document a SQLite, SQL Server, PostgreSQL, or MySQL database directly - including Amazon RDS MySQL via IAM authentication - without leaving the conversation.

Source README

MseeP.ai Security Assessment Badge

MCP Database Server

This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.

Installation

  1. Clone the repository:
git clone https://github.com/executeautomation/mcp-database-server.git
cd mcp-database-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage Options

There are two ways to use this MCP server with Claude:

  1. Direct usage: Install the package globally and use it directly
  2. Local development: Run from your local development environment

Direct Usage with NPM Package

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.

Local Development Setup

If you want to modify the code or run from your local environment:

  1. Clone and build the repository as shown in the Installation section
  2. Run the server using the commands in the Usage section below

Usage

SQLite Database

To use with an SQLite database:

node dist/src/index.js /path/to/your/database.db

SQL Server Database

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 database

Optional 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)

PostgreSQL Database

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 database

Optional 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)

MySQL Database

Standard Authentication

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)
AWS IAM Authentication

For Amazon RDS MySQL instances with IAM database authentication:

Prerequisites:

  • AWS credentials must be configured (the RDS Signer uses the default credential provider chain)
  • Configure using one of these methods:
    • aws configure (uses default profile)
    • AWS_PROFILE=myprofile environment variable
    • AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
    • IAM roles (if running on EC2)
node 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 located

Note: SSL is automatically enabled for AWS IAM authentication

Configuring Claude Desktop

Direct Usage Configuration

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

Local Development Configuration

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:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Available Database Tools

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 table
confirm: 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 statement
format: "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.

Additional Documentation

Development

To run the server in development mode:

npm run dev

To watch for changes during development:

npm run watch

Requirements

  • Node.js 18+
  • For SQL Server connectivity: SQL Server 2012 or later
  • For PostgreSQL connectivity: PostgreSQL 9.5 or later

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.