This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting both SQLite and SQL Server databases.
- Clone the repository:
git clone https://github.com/executeautomation/database-server.git
cd database-server
- Install dependencies:
npm install
- Build the project:
npm run build
To use with an SQLite database:
node dist/src/index.js /path/to/your/database.db
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)
Update your Claude configuration file to add the MCP Database Server:
{
"mcpServers": {
"sqlite": {
"command": "node",
"args": [
"/path/to/mcp-database-server/dist/src/index.js",
"/path/to/your/database.db"
]
},
"sqlserver": {
"command": "node",
"args": [
"/path/to/mcp-database-server/dist/src/index.js",
"--sqlserver",
"--server", "your-server-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
}
}
}The MCP Database Server provides the following tools:
read_query: Execute SELECT queries to read data from the databasewrite_query: Execute INSERT, UPDATE, or DELETE queriescreate_table: Create new tables in the databasealter_table: Modify existing table schema (add columns, rename tables, etc.)drop_table: Remove a table from the database with safety confirmationexport_query: Export query results to various formats (CSV, JSON)list_tables: Get a list of all tables in the databasedescribe_table: View schema information for a specific tableappend_insight: Add a business insight to the memolist_insights: List all business insights in the memo
To run the server in development mode:
npm run dev
To watch for changes during development:
npm run watch
- Node.js 18+
- For SQL Server connectivity: SQL Server 2012 or later
MIT