SQLite MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add sqlite-mcp-f93f -- python "<FULL_PATH_TO_SQLITE_MCP_SERVER>/dist/index.js" --db absolute/path/to/your/database.sqlite

Replace <FULL_PATH_TO_SQLITE_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Enables AI assistants to interact with SQLite databases

SQLite MCP Server

This is a Model Context Protocol (MCP) server that provides access to a SQLite database. It allows AI assistants (like Trae) to query and modify SQLite databases directly.

Features

  • Read Queries: Execute SELECT queries to retrieve data.
  • Write Queries: Execute INSERT, UPDATE, DELETE queries to modify data.
  • Schema Inspection: List tables and describe table schemas.
  • Secure: Runs locally on your machine.

Prerequisites

  • Python 3.10 or higher
  • pip (Python package installer)

Installation

  1. Clone or download this repository.
  2. Install the required dependencies:
pip install -r requirements.txt

Usage

You can run the server directly from the command line:

python main.py --db path/to/your/database.sqlite

If the database file does not exist, it will be created automatically when you perform a write operation.

Configuration in Trae

To use this MCP server in Trae, you need to add it to your MCP configuration file.

  1. Open Trae.
  2. Go to Settings -> MCP Servers (or edit the configuration file directly if you know the location, typically ~/.config/trae/config.json or similar depending on OS).
  3. Add the following configuration:
{
  "mcpServers": {
    "sqlite": {
      "command": "python",
      "args": [
        "absolute/path/to/sqlite_mcp/main.py",
        "--db",
        "absolute/path/to/your/database.sqlite"
      ]
    }
  }
}

Note:

  • Replace absolute/path/to/sqlite_mcp/main.py with the full path to the main.py file in this project.
  • Replace absolute/path/to/your/database.sqlite with the full path to your SQLite database file.
  • On Windows, use double backslashes \\ or forward slashes / in paths (e.g., "C:\\Users\\Name\\sqlite_mcp\\main.py").

API Documentation

Tools

`read_query`

Executes a SELECT query on the SQLite database.

  • Input: query (string) - The SQL SELECT query.
  • Output: List of dictionaries representing the rows.
`write_query`

Executes an INSERT, UPDATE, or DELETE query.

  • Input: query (string) - The SQL modification query.
  • Output: Success message with row count.
`list_tables`

Lists all tables in the database.

  • Input: None.
  • Output: List of table names.
`describe_table`

Gets the schema for a specific table.

  • Input: table_name (string).
  • Output: List of column definitions.

Tools (4)

read_queryExecutes a SELECT query on the SQLite database.
write_queryExecutes an INSERT, UPDATE, or DELETE query.
list_tablesLists all tables in the database.
describe_tableGets the schema for a specific table.

Configuration

claude_desktop_config.json
{"mcpServers": {"sqlite": {"command": "python", "args": ["absolute/path/to/sqlite_mcp/main.py", "--db", "absolute/path/to/your/database.sqlite"]}}}

Try it

List all the tables currently available in my database.
Show me the schema for the 'users' table.
Select all records from the 'orders' table where the status is 'pending'.
Update the 'email' field for the user with ID 101 in the 'users' table.

Frequently Asked Questions

What are the key features of SQLite MCP Server?

Execute SELECT queries to retrieve data. Execute INSERT, UPDATE, and DELETE queries to modify data. List all tables in the database. Inspect table schemas. Secure local execution.

What can I use SQLite MCP Server for?

Querying local application databases for debugging or data analysis. Automating data entry or updates in a SQLite-backed project. Exploring database structures to understand data relationships. Performing bulk data modifications via natural language commands.

How do I install SQLite MCP Server?

Install SQLite MCP Server by running: pip install -r requirements.txt

What MCP clients work with SQLite MCP Server?

SQLite MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep SQLite MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare