Back to Home
edgarlopezcalomarde icon

mcp-for-sql-server

by edgarlopezcalomarde

Overview

This server provides tools for an AI agent to interact with and manage a SQL Server database, enabling schema querying, table creation, data insertion, and execution of raw SQL queries.

Installation

Run Command
npx mcp-for-sql-server

Environment Variables

  • DB_USER
  • DB_PASSWORD
  • DB_HOST
  • DB_NAME
  • DB_PORT

Security Notes

The `compose.yml` uses a hardcoded default SA password ('PassSegura777') for the SQL Server database, which is insecure for production environments. More critically, the `create-table` and `insert-data` tools are vulnerable to SQL injection: they construct SQL queries by directly interpolating user-provided `tableName` and column names (e.g., `campos.nombre`) into the SQL string via `prisma.$queryRawUnsafe` without proper sanitization or escaping. This allows an attacker to execute arbitrary SQL commands by manipulating these input parameters. The `execute-raw-queries` tool explicitly allows raw queries, making its security dependent on the trustworthiness of its caller.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassLow
Avg Tokens300
Stars0
Forks0
Last Update2025-11-24

Tags

SQL ServerDatabase ManagementPrismaModel Context ProtocolTypeScript