Cover image
Try Now
2025-04-14

3 years

Works with Finder

1

Github Watches

7

Github Forks

7

Github Stars

MSSQL MCP Server

A Model Context Protocol (MCP) server for connecting to Microsoft SQL Server databases. This server provides tools for executing SQL queries and managing database connections.

Installation

npm install mssql-mcp-server

Usage

Add the server to your MCP settings configuration file:

{
  "mcpServers": {
    "mssql": {
      "command": "mssql-mcp-server",
      "env": {
        "MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;",
        // Or individual connection parameters:
        "MSSQL_HOST": "localhost",
        "MSSQL_PORT": "1433",
        "MSSQL_DATABASE": "master",
        "MSSQL_USER": "sa",
        "MSSQL_PASSWORD": "yourpassword",
        "MSSQL_ENCRYPT": "false",
        "MSSQL_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

Tools

query

Execute a SQL query on a MSSQL database.

Parameters

  • connectionString (string, optional): Full connection string (alternative to individual parameters)
  • host (string, optional): Database server hostname
  • port (number, optional): Database server port (default: 1433)
  • database (string, optional): Database name (default: master)
  • username (string, optional): Database username
  • password (string, optional): Database password
  • query (string, required): SQL query to execute
  • encrypt (boolean, optional): Enable encryption (default: false)
  • trustServerCertificate (boolean, optional): Trust server certificate (default: true)

Either connectionString OR (host + username + password) must be provided.

Example

const result = await use_mcp_tool({
  server_name: 'mssql',
  tool_name: 'query',
  arguments: {
    host: 'localhost',
    username: 'sa',
    password: 'yourpassword',
    query: 'SELECT * FROM Users',
  },
});

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

# Run tests
npm test

# Run linter
npm run lint

# Format code
npm run format

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • momi
  • Provides initial medical assessments and advice.

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • zhaoyunxing92
  • 本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • justmywyw
  • Short and sweet example MCP server / client implementation for Tools, Resources and Prompts.

    Reviews

    1 (1)
    Avatar
    user_s8Iofqng
    2025-04-17

    As a dedicated user of mssql-mcp-server, I must say this application has greatly simplified database management for me. The functionality is robust, and the interface is user-friendly. Kudos to c0h1b4 for developing such an indispensable tool. Highly recommend checking it out at https://github.com/c0h1b4/mssql-mcp-server!