sql-mcp-server

sql-mcp-server

0

The sql-mcp-server is an MCP server designed for interacting with SQL Server databases, featuring tools for database queries and schema management. It is built using the mcp-framework to provide SQL-focused functionality. The project supports integration with VS Code and debugging with the `mcp-debug` tool.

sql-mcp-server

A Model Context Protocol (MCP) server built with mcp-framework for SQL Server database interactions.

Quick Start

  • Install dependencies
  • Build the project
  • Start the server

Project Structure

  • Contains services, tools, and server entry point.

Available Tools

  • get-databases-tool: Lists available databases on the SQL Server
  • get-database-schema-tool: Retrieves schema information for specified databases
  • execute-select-query-tool: Runs parameterized SELECT queries against the database

SQL Service

  • Core functionality for creating connection strings and executing queries

Environment Configuration

  • Configure database connection in the .env file

AdventureWorks Sample Database

  • Instructions to download and install from Microsoft Docs

Creating a Read-Only User

  • Steps to create a read-only user for the SQL Server

Using with VS Code

  • Configure the server to run within VS Code with a .vscode/mcp.json file

Building and Testing

  • Make changes and compile tools, server loads tools on startup

Debugging

  • Use mcp-debug tool to list available tools, execute them, and view responses