Back to Home
jvm icon

usql-mcp

Verified Safe

by jvm

Overview

Enables AI assistants and other Model Context Protocol (MCP) clients to query a wide range of databases via the usql universal SQL CLI.

Installation

Run Command
npx usql-mcp

Environment Variables

  • USQL_CONFIG_PATH
  • USQL_QUERY_TIMEOUT_MS
  • USQL_DEFAULT_CONNECTION
  • USQL_BINARY_PATH
  • USQL_BACKGROUND_THRESHOLD_MS
  • USQL_JOB_RESULT_TTL_MS
  • USQL_<CONNECTION_NAME>
  • DEBUG

Security Notes

The server implements robust security features including credential sanitization in logs and error messages, and a comprehensive query safety analyzer (`query-safety-analyzer.ts`). This analyzer detects and can block dangerous operations like `DROP`, `TRUNCATE`, and `DELETE`/`UPDATE` without a `WHERE` clause, configurable via settings (`allowDestructiveOperations`, `blockHighRiskQueries`, `blockCriticalRiskQueries`, `requireWhereClauseForDelete`). SQL queries are executed via `child_process.spawn`, which is safer than direct shell execution as it avoids shell injection risks with properly separated arguments. No 'eval' or obvious obfuscation is present in the provided source. Rate limiting is also available to prevent abuse. Overall, strong security practices are in place.

Similar Servers

Stats

Interest Score27
Security Score9
Cost ClassMedium
Avg Tokens1000
Stars1
Forks0
Last Update2026-01-07

Tags

Database AccessSQL ClientAI Assistant ToolsBackground JobsQuery Safety