Cover image
Try Now
2025-01-31

Mirror ofhttps://github.com/JexinSam/mssql_mcp_server

3 years

Works with Finder

0

Github Watches

1

Github Forks

0

Github Stars

Tests

MSSQL MCP Server

MSSQL MCP Server is a Model Context Protocol (MCP) server that enables secure and structured interaction with Microsoft SQL Server (MSSQL) databases. It allows AI assistants to:

  • List available tables
  • Read table contents
  • Execute SQL queries with controlled access

This ensures safer database exploration, strict permission enforcement, and logging of database interactions.

Features

  • Secure MSSQL Database Access through environment variables
  • Controlled Query Execution with error handling
  • Table Listing & Data Retrieval
  • Comprehensive Logging for monitoring queries and operations

Installation

pip install mssql-mcp-server

Configuration

Set the following environment variables to configure database access:

MSSQL_DRIVER=mssql_driver
MSSQL_HOST=localhost
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
MSSQL_DATABASE=your_database

Usage

With Claude Desktop

To integrate with Claude Desktop, add this configuration to claude_desktop_config.json:

{
  "mcpServers": {
    "mssql": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mssql_mcp_server",
        "run",
        "mssql_mcp_server"
      ],
      "env": {
        "MSSQL_DRIVER": "mssql_driver",
        "MSSQL_HOST": "localhost",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_DATABASE": "your_database"
      }
    }
  }
}

Running as a Standalone Server

# Install dependencies
pip install -r requirements.txt

# Run the server
python -m mssql_mcp_server

Development

# Clone the repository
git clone https://github.com/yourusername/mssql_mcp_server.git
cd mssql_mcp_server

# Set up a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

Security Considerations

  • Use a dedicated MSSQL user with minimal privileges.
  • Never use root credentials or full administrative accounts.
  • Restrict database access to only necessary operations.
  • Enable logging and auditing for security monitoring.
  • Regularly review permissions to ensure least privilege access.

Security Best Practices

For a secure setup:

  1. Create a dedicated MSSQL user with restricted permissions.
  2. Avoid hardcoding credentials—use environment variables instead.
  3. Restrict access to necessary tables and operations only.
  4. Enable SQL Server logging and monitoring for auditing.
  5. Review database access regularly to prevent unauthorized access.

For detailed instructions, refer to the MSSQL Security Configuration Guide.

⚠️ IMPORTANT: Always follow the Principle of Least Privilege when configuring database access.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request.

Need Help?

For any questions or issues, feel free to open a GitHub Issue or reach out to the maintainers.

相关推荐

  • 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.

  • momi
  • Provides initial medical assessments and advice.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

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

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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

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

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • 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语言开发,支持员工信息查询和消息发送等功能。

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

  • sligter
  • Lite-MCP-Client是一个基于命令行的轻量级MCP客户端工具

    Reviews

    4 (1)
    Avatar
    user_lsvotVPA
    2025-04-15

    I've been using Docbase-MCP-Server by shogo-ma and I'm genuinely impressed. It's user-friendly, robust, and enhances my productivity. The seamless integration and reliable performance make it an essential tool for anyone in need of a dependable server solution. Highly recommended!