Integrations
Enables connection to PostgreSQL databases with support for authentication, SSL connections, and execution of SQL queries against PostgreSQL 9.5 or later.
Provides direct access to SQLite database files, allowing for executing queries, schema modifications, and data operations against local SQLite databases.
MCP Database Server
This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, and PostgreSQL databases.
Installation
- Clone the repository:
- Install dependencies:
- Build the project:
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:
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:
SQL Server Database
To use with a SQL Server database:
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:
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)
Configuring Claude Desktop
Direct Usage Configuration
If you installed the package globally, configure Claude Desktop with:
Local Development Configuration
For local development, configure Claude Desktop to use your locally built version:
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:
To watch for changes during development:
Requirements
- Node.js 18+
- For SQL Server connectivity: SQL Server 2012 or later
- For PostgreSQL connectivity: PostgreSQL 9.5 or later
License
MIT
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.Last updated -1053PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.Last updated -69TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.Last updated -2752TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.Last updated -TypeScriptMIT License