0.0.2 • Published 6 months ago

@mcp-collection/mssql-mcp v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

mssql-mcp

This is a Model Context Protocol (MCP) server for Microsoft SQL Server. It allows you to generate SQL table creation scripts using the MCP protocol.

Configuration

The server requires the following environment variables for database connection:

  • HOST - SQL Server hostname
  • PORT - SQL Server port
  • USER - SQL Server username
  • PASSWORD - SQL Server password
  • DATABASE - Database name

Usage

Configure the MCP server in your MCP client configuration:

{
  "mcpServers": {
    "mssqlMcp": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@mcp-collection/mssql-mcp@latest"],
      "env": {
        "HOST": "your-sql-server",
        "PORT": "your-port-number",
        "USER": "your-username",
        "PASSWORD": "your-password",
        "DATABASE": "your-database"
      }
    }
  }
}

On Windows, you may need to set up in a different way.

Install the package globally:

npm i -g @mcp-collection/mssql-mcp@latest

Then, configure the MCP server in your MCP client configuration:

{
  "mcpServers": {
    "mssqlMcp": {
      "transport": "stdio",
      "command": "node",
      "args": ["C:\\Users\\YourUserName\\AppData\\Roaming\\npm\\node_modules\\@mcp-collection\\mssql-mcp\\build\\index.js"],
      "env": {
        "HOST": "your-sql-server",
        "PORT": "your-port-number",
        "USER": "your-username",
        "PASSWORD": "your-password",
        "DATABASE": "your-database"
      }
    }
  }
}

Available Tools

get-create-table-sql-script

Generates a SQL script for creating a table based on an existing table in your database.

Parameters:

  • dbSchemaName - The name of the database schema
  • dbTableName - The name of the database table

Development

Copy the config-example.json file to config.json and fill in the required values.