mcpField
S
SQL-Server-MCP

SQL-Server-MCP

Local
github.com/ranjithr99Databases1Updated 57w ago

About SQL-Server-MCP

SQL-Server-MCP is a stdio MCP server for connecting to Microsoft SQL Server and inspecting or querying databases. It is suited to MCP clients that need schema discovery and direct SQL execution, with credentials supplied at connection time.

Key features

  1. 01Connect to SQL Server
  2. 02Execute arbitrary SQL queries
  3. 03Return SQL Server version
  4. 04List databases and schemas
  5. 05List tables by optional schema

Use cases

  1. 01Inspect database structure from an MCP client
  2. 02Run SQL queries through MCP tools

MCP support

It exposes connection, query, version, and database-discovery tools to MCP clients over stdio. Credentials are passed when connecting and are not stored.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

SQL Server MCP (Model Context Protocol) Server

A lightweight MCP stdio server that connects to Microsoft SQL Server using provided credentials and exposes tools to query and discover schema.

Features
  • connect: Connect by server, port, user, password, optional database, encrypt.
  • disconnect: Close the pool.
  • info: Return @@VERSION.
  • query: Execute arbitrary SQL and return recordset.
  • list_databases: List databases.
  • list_schemas: List schemas.
  • list_tables: List tables, with optional schema filter.
Quickstart
  • Node.js >= 18
  • Install deps and build:
    npm install
    npm run build
    
  • Run as an MCP stdio server (for MCP-compatible clients):
    npm start
    

The server starts over stdio and waits to be driven by an MCP client (e.g., Claude Desktop or other MCP-aware tooling). Use the tools in this order:

  1. connect with your SQL Server credentials
  2. info, list_*, or query
MCP Tools and Schemas
  • connect args:
    {
      "server": "host or host\\\u005Cinstance",
      "port": 1433,
      "user": "sa",
      "password": "<secret>",
      "database": "master",
      "encrypt": true
    }
    
  • query args:
    { "sql": "SELECT TOP 1 * FROM sys.databases" }
    { "sql": "SELECT * FROM INFORMATION_SCHEMA.TABLES" }
    
  • Other tools take no args or optional schema.
Security
  • Credentials are provided at call-time and are not stored. Prefer secure MCP clients and environments. TLS encrypt defaults to true.
Development
  • Scripts:
    • npm run dev to run with ts-node
    • npm run build to emit JS to dist/
    • npm start to run built server (dist/server.js)
Commits
  • chore: init project scaffolding with TypeScript, tsconfig, and deps
  • feat: implement MCP stdio server with SQL Server tools (connect, query, info, list_*)
  • docs: add execution plan outline and usage notes
License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.