home / mcp / sqlite mcp tool mcp server
Provides a Python-based MCP server to delete rows from SQLite tables with simple filters.
Configuration
View docs{
"mcpServers": {
"cnzhangxy51-sqlite-tool": {
"url": "https://mcp.example.com/mcp",
"headers": {
"PYTHONPATH": "/Users/you/your-tool/agent-cli"
}
}
}
}You can run a Python-based MCP tool that deletes rows from a SQLite database table. It exposes a single operation, delete_rows, which lets you specify the database path, table name, and optional simple equality filters to remove matching records. This is useful for maintenance tasks such as cleaning test data or pruning old entries without modifying the rest of your application.
To use the delete_rows MCP tool from an MCP client, you will point your client at the local or remote MCP server and invoke the delete_rows method with the required parameters and any optional filters.
What you can delete: - Required: db_path (path to your SQLite database) and table (the target table name). - Optional: filters (a simple key/value dictionary for exact matches) and allow_full_table (a boolean to permit deleting all rows in the table if no filters are provided). What you can expect: - A DELETE operation that removes rows from the specified table where the condition is satisfied. - If you enable allow_full_table, you can delete all rows in the table when no filters are given.
Prerequisites: - Python 3.8 or newer - A working SQLite database you want to modify - Optional: a virtual environment tool (venv is built into Python) to isolate dependencies
Install and run the MCP tool server locally:
``
cd agent-cli
python -m sqlite_mcp.server
``
This starts the MCP server that hosts the delete_rows operation.
Register the MCP server in your client or agent that supports MCP. Use the following example configuration to register a local stdio-based server (replace user-specific paths as needed):
```
{
"mcpServers": {
"user-sqlite-delete-tool": {
"command": "/Users/XXX/.mcp/sqlite-tool/.venv/bin/python",
"args": [
"-m",
"sqlite_mcp.server"
],
"env": {
"PYTHONPATH": "/Users/XXX/.mcp/sqlite-tool/agent-cli"
}
}
}
}
```
This config runs the MCP server as a local process and exposes the delete_rows capability to your MCP client.Notes and tips:
- The required parameters are db_path and table. Provide the full path to your database file and the exact table name.
- You may supply filters like {"id": 123} to delete rows where the id column equals 123. If you want to delete all rows in the table, set allow_full_table to true and omit filters.
- Ensure the MCP client has access permissions to the database file and that SQLite is not locked by another process during deletion.Deletes records from a specified SQLite table using a required db_path and table, with optional simple filters and a flag to allow full-table deletion.