SQLite MCP Server

SQLite MCP servers enable AI models to interact with SQLite databases, providing capabilities for structured data operations, SQL queries, and local data management.

October 19, 2026
MCP ServerDatabases & StorageSQLite MCP Server
GitHub starsnpm versionnpm downloads

Overview

The MCP SQLite Server provides a lightweight and efficient way for AI models to interact with SQLite databases. Based on the official Python reference, this Node.js implementation offers an npx-based solution for environments where Python's UVX runner might not be available. It enables AI to perform structured data operations, execute SQL queries, and manage local data, making it ideal for embedded applications and local data storage needs.

Created by:

Developed by johnnyoshika

Key Features

πŸ—„οΈ

Local Data Management

Efficiently manage and query data stored in local SQLite files.

πŸ’¬

SQL Query Execution

Execute standard SQL queries for data retrieval and manipulation.

πŸš€

Lightweight & Embedded

Ideal for embedded applications and scenarios requiring a serverless database.

πŸ”

Schema Inspection

Inspect database schemas, tables, and column details.

Available Tools

Quick Reference

ToolPurposeCategory
read_queryExecute SELECT queriesRead
write_queryExecute INSERT/UPDATE/DELETEWrite
create_tableCreate a tableSchema
list_tablesList tables in the databaseSchema
describe_tableGet table structure detailsSchema

Detailed Usage

read_queryβ–Ά

Execute a SELECT query.

use_mcp_tool({
  server_name: "sqlite",
  tool_name: "read_query",
  arguments: {
    query: "SELECT * FROM users WHERE id = 1"
  }
});

Returns matching rows from the database.

write_queryβ–Ά

Execute an INSERT, UPDATE, or DELETE query.

use_mcp_tool({
  server_name: "sqlite",
  tool_name: "write_query",
  arguments: {
    query: "INSERT INTO users (name, email) VALUES ('Jane Doe', '[email protected]')"
  }
});

Returns information about the executed statement (e.g., last insert ID, rows affected).

list_tablesβ–Ά

List all tables in the connected SQLite database.

use_mcp_tool({
  server_name: "sqlite",
  tool_name: "list_tables",
  arguments: {}
});

Returns a list of table names.

describe_tableβ–Ά

Get the structure (columns, types) of a specific table.

use_mcp_tool({
  server_name: "sqlite",
  tool_name: "describe_table",
  arguments: {
    table_name: "users"
  }
});

Provides column names, data types, and other table details.

Installation

{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-sqlite-npx",
        "/absolute/path/to/database.db"
      ],
      "env": {}
    }
  }
}

Database Path:

Replace /absolute/path/to/database.db with the actual path to your SQLite database file.

Common Use Cases

1. Local Data Storage

Store and retrieve application configuration or user preferences locally:

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "create_table",
  arguments: {
     query: "CREATE TABLE IF NOT EXISTS settings (key TEXT PRIMARY KEY, value TEXT)"
  }
});

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "write_query",
  arguments: {
     query: "INSERT OR REPLACE INTO settings (key, value) VALUES ('theme', 'dark')"
  }
});

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "read_query",
  arguments: {
     query: "SELECT value FROM settings WHERE key = 'theme'"
  }
});

2. Embedded Analytics

Perform simple analytics on local datasets without external dependencies:

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "read_query",
  arguments: {
     query: "SELECT category, COUNT(*) as count FROM products GROUP BY category ORDER BY count DESC"
  }
});

3. Caching for Offline Access

Cache data from remote APIs for offline access or reduced network calls:

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "create_table",
  arguments: {
     query: "CREATE TABLE IF NOT EXISTS api_cache (url TEXT PRIMARY KEY, data TEXT, timestamp INTEGER)"
  }
});

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "write_query",
  arguments: {
     query: "INSERT OR REPLACE INTO api_cache (url, data, timestamp) VALUES ('/api/data', 'cached data', 0)"
  }
});

use_mcp_tool({
  server_name: "sqlite",
   tool_name: "read_query",
  arguments: {
     query: "SELECT data FROM api_cache WHERE url = '/api/data'"
  }
});

Connection String Format

The SQLite MCP server connects directly to a specified .db file. The path to this file is provided as an argument during server initialization.

  • Database Path: The absolute path to the SQLite database file (e.g., /absolute/path/to/database.db).

Sources