Get the FREE Ultimate OpenClaw Setup Guide →

mcp-sql

MCP server from VlaadislavKr/mcp-sql-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio vlaadislavkr-mcp-sql-server node build/index.js

How to use

This MCP server provides SQL-capable tools to interact with MySQL, PostgreSQL, and SQLite databases directly through the MCP protocol. The server exposes two main tools: execute_sql_query and insert_data. You can use execute_sql_query to run arbitrary SQL against a specified database, choosing the database type with dbType (mysql, postgresql, or sqlite), providing a connection string (or file path for SQLite), and supplying the SQL query you want executed. The insert_data tool lets you insert a JSON object into a specified table, again specifying dbType and the connection string, along with the target tableName and the data payload. These tools enable you to perform read and write operations from within your MCP-enabled editor or environment, enabling seamless database interactions without leaving your workflow.

How to install

Prerequisites:

  • Node.js (version specified by the project, typically LTS) and npm installed on your system.

Installation steps:

  1. Clone or download the MCP SQL server repository.
  2. Navigate to the project directory.
  3. Install dependencies: npm install
  4. Build the server: npm run build
  5. (Optional) Start development with auto-rebuild: npm run watch

Notes:

  • The server is designed to be run via the built entrypoint at build/index.js. The configuration examples in the README show how editors like Claude Desktop expect the command to launch this server.

Additional notes

Tips and common considerations:

  • The MCP server communicates over stdio, so debugging can be facilitated using the MCP Inspector tool (npm run inspector).
  • When configuring editors to use this server, point them to the built entrypoint (build/index.js) as shown in the configuration examples.
  • Ensure you supply the correct dbType and a valid connectionString for your target database. For SQLite, the connectionString should be a file path.
  • If you plan to run against multiple database types, ensure the appropriate database drivers are available in your environment.
  • No specific environment variables are required by default, but you can extend the env field in mcp_config to pass credentials or paths as needed by your setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers