0.0.2 • Published 6 months ago
@mcp-collection/mssql-mcp v0.0.2
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 hostnamePORT- SQL Server portUSER- SQL Server usernamePASSWORD- SQL Server passwordDATABASE- 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@latestThen, 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 schemadbTableName- The name of the database table
Development
Copy the config-example.json file to config.json and fill in the required values.