Back to Home
ShootaOT icon

db-mcp

by ShootaOT

Overview

Run an SQLite Model Context Protocol (MCP) server that provides secure access via OAuth 2.0, tool filtering, and options for WASM or native SQLite versions to manage databases effectively.

Installation

Run Command
db-mcp --transport http --port 3000 --sqlite ./data.db

Environment Variables

  • DB_MCP_TOOL_FILTER
  • TOOL_FILTER
  • DATABASE_URI
  • SQLITE_DATABASE
  • SQLITE_PATH
  • POSTGRES_URI
  • POSTGRESQL_URI
  • MYSQL_URI
  • MONGODB_URI
  • MONGO_URI
  • REDIS_URI
  • LOG_LEVEL
  • KEYCLOAK_URL
  • KEYCLOAK_REALM
  • KEYCLOAK_CLIENT_ID
  • KEYCLOAK_CLIENT_SECRET

Security Notes

The server has critical SQL injection vulnerabilities. Numerous tools, such as `sqlite_vector_search`, `sqlite_text_split`, `sqlite_json_extract`, `sqlite_stats_basic`, and many others, accept user-provided SQL fragments like `whereClause` or `orderBy` as direct string inputs. These inputs are then concatenated directly into the SQL queries executed against the database without proper escaping or parameterization. This allows an attacker to inject arbitrary SQL, leading to data exfiltration, modification, deletion, or even full database compromise. While a `validateQuery` method exists, it performs only basic pattern matching and is insufficient to prevent sophisticated SQL injection attacks. The `no-console` ESLint rule is good for MCP's stdio transport, and OAuth implementation uses the `jose` library correctly, but these do not mitigate the core SQL injection risk.

Similar Servers

Stats

Interest Score0
Security Score1
Cost ClassMedium
Avg Tokens500
Stars0
Forks0
Last Update2026-01-19

Tags

mcpsqliteoauth2.0database-managementtool-filtering