MSSQL MCP Server

MSSQL MCP Server

By MCP-Mirror GitHub

Mirror of

mssql database
Overview

what is MSSQL MCP Server?

MSSQL MCP Server is a Model Context Protocol (MCP) server designed for connecting to Microsoft SQL Server databases, providing tools for executing SQL queries and managing database connections.

how to use MSSQL MCP Server?

To use MSSQL MCP Server, install it via npm and configure it in your MCP settings with the necessary connection parameters.

key features of MSSQL MCP Server?

  • Connects to Microsoft SQL Server databases.
  • Executes SQL queries with customizable parameters.
  • Supports both full connection strings and individual connection parameters.

use cases of MSSQL MCP Server?

  1. Executing SQL queries on Microsoft SQL Server databases.
  2. Managing database connections in a structured manner.
  3. Integrating with applications that require database interactions.

FAQ from MSSQL MCP Server?

  • What is the installation process?

You can install MSSQL MCP Server using npm with the command npm install mssql-mcp-server.

  • How do I configure the server?

You need to add the server to your MCP settings configuration file with the required connection parameters.

  • Can I use a connection string instead of individual parameters?

Yes, you can provide either a full connection string or individual parameters for connection.

Content

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

No tools information available.
Postgres
Postgres by guoling2008

-

postgres database
View Details
Sqlite
Sqlite by sqlite

Database interaction and business intelligence capabilities

sqlite database
View Details
mcp-db-server
mcp-db-server by iotassss

-

mcp-db-server database
View Details
mcp-lancedb-server
mcp-lancedb-server by richard-gyiko

-

mcp-lancedb-server database
View Details
db-mcp
db-mcp by goru00

Database Model Context Protocol (DB-MCP) Server

db-mcp database
View Details

mysql数据库连接,改 f4ww4z/mcp-mysql-server中的连接配置支持cherry studio

mcp-mysql-server database
View Details

Mirror of

mysql database
View Details