Back to Home
ineersa icon

mcp-sql-server

by ineersa

Overview

An MCP server for executing SQL queries against various configured databases.

Installation

Run Command
php bin/database-mcp

Environment Variables

  • LOG_LEVEL
  • APP_LOG_DIR
  • DATABASE_CONFIG_FILE
  • APP_SECRET
  • DB_HOST
  • DB_NAME
  • DB_USER
  • DB_PASSWORD

Security Notes

CRITICAL SQL INJECTION VULNERABILITY: The `QueryTool` directly executes user-provided SQL queries via `Doctrine\DBAL\Connection::executeQuery($query)`. If the `$query` argument is sourced from untrusted input without rigorous sanitization or parameter binding, this exposes the system to severe SQL injection attacks. Attackers could read, modify, or delete arbitrary data, and potentially execute database-level commands. Hardcoded Secrets: `databases.yaml` contains a hardcoded password. While `DATABASE_CONFIG_FILE` uses environment variables, the referenced configuration files should avoid embedding secrets directly in the repository. The `databases.test.yaml` also includes hardcoded credentials for test databases, which, while for testing, sets a risky pattern.

Similar Servers

Stats

Interest Score0
Security Score2
Cost ClassLow
Avg Tokens300
Stars0
Forks0
Last Update2026-01-17

Tags

MCPSQLDatabasePHPSymfonyQuery Tool