Back to Home
StacklokLabs icon

sqlite-mcp

by StacklokLabs

Overview

A Model Context Protocol (MCP) server that enables LLMs to interact with SQLite databases by providing tools and resources for querying and managing data.

Installation

Run Command
go build -o sqlite-mcp ./cmd/server && ./sqlite-mcp -db ./testdata/example.db

Environment Variables

  • MCP_PORT
  • MCP_TRANSPORT

Security Notes

CRITICAL: The `handleDescribeTable` function in `internal/tools/query.go` is vulnerable to SQL injection. The `table_name` parameter, taken directly from user input, is unsafely formatted into a `PRAGMA table_info()` query using `fmt.Sprintf` without sanitization or parameterization. This allows an attacker to inject arbitrary SQL commands (e.g., `users'); DROP TABLE products; --`) which can lead to data loss, modification, or information leakage, especially when the server is run in read-write mode. While `execute_query` and `execute_statement` use parameterized queries, this specific vulnerability is severe.

Similar Servers

Stats

Interest Score38
Security Score3
Cost ClassLow
Avg Tokens750
Stars12
Forks0
Last Update2026-01-19

Tags

SQLiteMCPLLMDatabaseGo