home / mcp / sqlite mcp server

SQLite MCP Server

An MCP server enabling LLM agents to read, create, update, delete, and query SQLite databases via FastMCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "irpus1603-mcp_sqlite": {
      "command": "python",
      "args": [
        "-m",
        "sqlite_mcp.server"
      ]
    }
  }
}

This SQLite MCP Server provides an MCP interface to read, create, update, delete, and query SQLite databases. Built with FastMCP, it lets you manage SQLite data programmatically from large language models and automated agents, with clear type hints and robust error handling.

How to use

You interact with the server through MCP tools to manage databases and data. Open a database, create tables, insert and modify records, run SELECT queries, inspect schemas, and list tables. Each operation is exposed as a tool you can call from your MCP client. When you perform a query, you can provide parameters to keep input safe and predictable.

How to install

Prerequisites: Python 3.8 or higher and pip.

# Step 1: Navigate to the project directory
cd sqlite-mcp

# Step 2: Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Step 3: Install dependencies
pip install -r requirements.txt

Configuration and startup

You can start the server in multiple ways depending on your preferred toolchain. Choose one of the following start commands.

# Using Python module invocation
python -m sqlite_mcp.server

# Or using Uvicorn for HTTP transport
uvicorn sqlite_mcp.server:mcp --reload

Available tools

open_database

Opens or creates a SQLite database file. You provide the path to the database file; the server establishes or creates the file if it does not exist.

close_database

Closes the current database connection.

execute_query

Executes a SELECT query and returns results. You supply the SQL query and optional parameters for prepared statements.

create_table

Creates a new table in the database with the given table name and schema string.

insert

Inserts a row into a specified table using a data object that maps column names to values.

update

Updates rows in a table based on a WHERE clause and optional where parameters.

delete

Deletes rows from a table using a WHERE clause and optional where parameters.

list_tables

Lists all tables present in the currently opened database.

get_table_schema

Returns the schema for a specified table, including column names, types, and constraints.