home / mcp / sqlite mcp server
An MCP server enabling LLM agents to read, create, update, delete, and query SQLite databases via FastMCP.
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.
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.
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.txtYou 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 --reloadOpens 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.
Closes the current database connection.
Executes a SELECT query and returns results. You supply the SQL query and optional parameters for prepared statements.
Creates a new table in the database with the given table name and schema string.
Inserts a row into a specified table using a data object that maps column names to values.
Updates rows in a table based on a WHERE clause and optional where parameters.
Deletes rows from a table using a WHERE clause and optional where parameters.
Lists all tables present in the currently opened database.
Returns the schema for a specified table, including column names, types, and constraints.