This is the first tutorial for a Model Context Protocol (MCP) server for operating SQLite databases. Can be used with Cursor editor and other MCP-compatible clients.
- SQLite database read/write operations
- SQL query execution
- Table creation, deletion, and modification
- Data insertion, updating, and deletion
- Schema inspection
- Zero configuration: Start using immediately without additional setup
- Complete SQL operation support: Full CRUD (Create, Read, Update, Delete) operations
- Cross-platform: Windows, macOS, Linux support
If you need initial data, run init.sql using SQLite commands or a DB browser:
# For bash, command prompt, zsh
sqlite3 database.db < init.sql
# For PowerShell
Get-Content .\init.sql | sqlite3.exe .\database.dbThis repository uses uvx, so uv installation is required in advance.
# macOS
brew install uv
# Windows 11
winget install --id=astral-sh.uvFor Cursor: .cursor/mcp.json
For VS Code: .vscode/mcp.json
For Windsurf: .windsurf/mcp.json
This project places ./.cursor/mcp.json, ./.vscode/mcp.json, and ./.windsurf/mcp.json,
so they will be automatically recognized when the project is opened.
- Clone or download this repository
- Open this repository directory in Cursor
- Press
Shift + Ctrl + P(Windows/Linux)Cmd + Shift + P(MacBook) to open the command palette - Type
openmcpand open the "Tools & Integrations" tab - Turn on the "sqlite" MCP server switch (green) from the "MCP Tools" section
- Clone or download this repository
- Open this repository directory in VS Code
- Press
Shift + Ctrl + P(Windows/Linux)Cmd + Shift + P(MacBook) to open the command palette - Type
mcpliand select "MCP: List Servers" - Select "sqlite stopped" from the command palette and start it
- Clone or download this repository
- Open this repository directory in Windsurf
- Press
Shift + Ctrl + P(Windows/Linux)Cmd + Shift + P(MacBook) to open the command palette - Type
mcpliand select "MCP: List Servers" - Select "sqlite stopped" from the command palette and start it
To use MCP servers with Claude Desktop, build and install a DXT (Desktop Extensions) package.
The steps to build a DXT package for Claude Desktop are as follows:
# Common for bash, command prompt, PowerShell, zsh
# Navigate to dxt directory and build
cd dxt-src
npm run package
# Only PowerShell Commands Are Different
npm run package-psWhen the build succeeds, the dist/sqlite-mcp-server.dxt file will be generated.
Building the DXT package requires:
- Node.js 18 or higher
- Official DXT CLI (automatically installed when running npm run build)
- Build the DXT package using the above steps
- Drag and drop the generated
.dxtfile to Claude Desktop's Settings > Extensions screen - Give the database file path to "SQLite MCP Server" and turn on the "Enabled" switch (blue)
- If the database file exists at the specified location, the SQLite MCP server will become available
- Confirm
uvis installed - Check internet connection (required for
uvxto download packages) - Verify the database file exists as
database.dbin the project root
- Check write permissions for project directory
- Run
init.sqlwithsqlite3to create the database - Verify the database file path is correctly set in
mcp.jsonor "SQLite MCP Server" DXT
mcp-tutorial-1/
├── init_ja.sql # Initial database schema and sample data (Japanese version)
├── init.sql # Initial database schema and sample data (English version)
├── README_ja.md # This file (Japanese version)
├── README.md # This file
├── database.db # SQLite database file (created during initialization)
├── .gitignore # Git exclusion settings
├── .cursor/mcp.json # MCP configuration file (for Cursor)
├── .vscode/mcp.json # MCP configuration file (for VS Code)
├── .windsurf/mcp.json # MCP configuration file (for Windsurf)
├── docs/ # Design documentation files
│ ├── DESIGN_ja.md # Design document (Japanese)
│ └── DESIGN.md # Design document (English)
├── dxt-src/ # DXT files for Claude Desktop
│ ├── .gitignore # DXT exclusion settings
│ ├── manifest.json # DXT manifest file
│ ├── icon.png # DXT icon image
│ ├── package.json # Package configuration for DXT
│ ├── README_ja.md # DXT-specific documentation (Japanese)
│ └── README.md # DXT-specific documentation (English)
└── dist/ # Build artifacts (.dxt files)
└── sqlite.dxt # Desktop extension for Claude Desktop
This project is released under the MIT License. See the LICENSE file for details.