Back to Home
coston icon

mssql-read-only-mcp

Verified Safe

by coston

Overview

This server provides a lightweight, read-only interface for interacting with an MSSQL database, allowing users to list tables, describe their structure, and execute SELECT queries.

Installation

Run Command
npx -y mssql-read-only-mcp

Environment Variables

  • SERVER_NAME
  • DATABASE_NAME
  • SQL_USER
  • SQL_PASSWORD
  • SQL_PORT
  • TRUST_SERVER_CERTIFICATE
  • CONNECTION_TIMEOUT

Security Notes

The server explicitly enforces read-only operations for all tools by validating that queries start with 'SELECT' and checking for dangerous keywords ('INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE', 'ALTER', 'TRUNCATE', 'EXEC', 'EXECUTE'). It also prevents multiple statements. Parameterized queries are used for 'list_table' and 'describe_table' to prevent SQL injection for structured inputs. While the 'read_data' tool accepts raw SQL, its sanitization efforts, including a 10,000 row limit, significantly mitigate common injection and denial-of-service risks. Credentials are handled via environment variables, not hardcoded.

Similar Servers

Stats

Interest Score32
Security Score8
Cost ClassHigh
Avg Tokens75000
Stars1
Forks0
Last Update2025-11-24

Tags

MSSQLSQL ServerDatabaseRead-OnlyData Exploration