Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
MCP server for database access
This repository provides an MCP server that connects an agent to database systems through a small set of tools. The server can read queries, write data, inspect tables, export results, and store or list insights, with separate connection modes for SQLite, SQL Server, PostgreSQL, and MySQL.
Builders who want Claude or another MCP-capable agent to work directly with databases.
You can inspect schemas, run queries, and change data from your agent instead of switching to a separate database client.
What it does
Database query tools
`read_query` runs SELECT statements and `write_query` handles INSERT, UPDATE, and DELETE statements.
Schema management tools
`create_table`, `alter_table`, `drop_table`, `list_tables`, and `describe_table` cover common database structure work.
Query export
`export_query` returns SELECT results as CSV or JSON.
Business insight memo
`append_insight` and `list_insights` let the server keep a simple insight list for the session.
Multiple database backends
The server supports SQLite, SQL Server, PostgreSQL, and MySQL, with separate CLI flags for each connection type.
Claude Desktop setup examples
The README shows JSON config blocks for using the server through Claude Desktop with either a global install or a local build.
How to get it
- 1Clone the repository
git clone https://github.com/executeautomation/mcp-database-server.git cd mcp-database-server
- 2Install dependencies
npm install
- 3Build the project
npm run build
- 4The easiest way to use this MCP server is by installing it globally
npm install -g @executeautomation/database-server
- 5To use with an SQLite database
node dist/src/index.js /path/to/your/database.db
- 6To use with a SQL Server database
node dist/src/index.js --sqlserver --server <server-name> --database <database-name> [--user <username> --password <password>]
README
MCP Database Server
This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.
Installation
- Clone the repository:
git clone https://github.com/executeautomation/mcp-database-server.git
cd mcp-database-server
- Install dependencies:
npm install
- Build the project:
npm run build
Usage Options
There are two ways to use this MCP server with Claude:
- Direct usage: Install the package globally and use it directly
- 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:
- Clone and build the repository as shown in the Installation section
- 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=myprofileenvironment variableAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment 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 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.
Additional Documentation
- SQL Server Setup Guide: Details on connecting to SQL Server databases
- PostgreSQL Setup Guide: Details on connecting to PostgreSQL databases
- Usage Examples: Example queries and commands to use with Claude
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
License
MIT
Files in the repo
- .github
- data
- docs
- examples
- src
- .DS_Store
- .gitignore
- build.sh
- Dockerfile
- global.d.ts
- index.ts
- LICENSE
- package-lock.json
- package.json
- readme.md
- SECURITY.md
- tsconfig.json
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More connectors
High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.
Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.
