Skip to content

Enhance SQLite MCP Server Flexibility (Dynamic Paths & BLOBs) #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
antoan opened this issue Apr 12, 2025 · 0 comments
Open

Enhance SQLite MCP Server Flexibility (Dynamic Paths & BLOBs) #1386

antoan opened this issue Apr 12, 2025 · 0 comments

Comments

@antoan
Copy link

antoan commented Apr 12, 2025

Description:

While using the SQLite MCP server (src/sqlite) during development, several limitations were encountered that hinder its flexibility and usability for common database tasks:

  1. Fixed Database Path: The server currently connects to a single database specified by the --db-path argument at startup. The tools (read_query, write_query, etc.) cannot target other database files dynamically via tool arguments. This necessitates workarounds like frequent server restarts with modified configurations or bypassing the MCP tools entirely with scripts when working with multiple databases.

  2. BLOB Insertion Difficulty: The write_query tool, accepting only a string query, does not provide a clear mechanism for inserting binary data (BLOBs) using parameterized queries, which is the standard and safe method. This prevented us from using the tool to populate a table column requiring image BLOBs.

  3. Complex Operations: Multi-step operations involving schema changes, data generation, and conditional updates across multiple rows are difficult to manage reliably through sequential write_query calls compared to a script with transactional control.

Suggested Enhancements:

  1. Dynamic Path Parameter: Modify the server's tool handlers (read_query, write_query, create_table, etc.) to optionally accept a db_path argument within the tool's JSON input. If provided, the server should dynamically connect to the specified database (within allowed directories) for that specific operation.
  2. Parameterized Queries / BLOB Support: Enhance write_query (or add a new tool) to support parameterized queries, allowing safe and effective insertion/updating of various data types, including BLOBs, by passing parameters separately from the SQL query string.

These enhancements would significantly improve the server's versatility and make it more practical for real-world development workflows involving SQLite databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant