mcpField
S
SQLite MCP Server

SQLite MCP Server

Local
github.com/madhavarora1988Databases0Updated 78w ago

About SQLite MCP Server

SQLite MCP Server lets AI models work with SQLite databases through MCP tools. It is intended for database access and demonstrations, with query safety checks and an optional read-only mode.

Key features

  1. 01Execute validated SQL queries
  2. 02List tables and inspect schemas
  3. 03Count table rows
  4. 04Insert sample data when writable
  5. 05Collect feedback in the database
  6. 06Restrict operations with read-only mode

Use cases

  1. 01Inspect a database's tables and schemas
  2. 02Run SQL queries with safety checks
  3. 03Demonstrate database operations on sample data
  4. 04Expose database access without writes

MCP support

It exposes SQLite query, schema, row-count, sample-data, and feedback operations as tools for MCP clients. Read-only mode blocks data modifications.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

SQLite MCP Server

A Model Context Protocol (MCP) server implementation for SQLite databases, allowing AI models to interact with SQLite databases through standardized tools.

Features

  • Query Execution: Execute SQL queries with built-in validation and safety checks
  • Schema Discovery: List tables and describe table schemas
  • Row Counting: Count rows in specified tables
  • Sample Data: Insert sample data for demonstration purposes (when not in read-only mode)
  • Automatic Initialization: Creates a sample database with products, customers, orders, and feedback if none exists
  • Read-Only Mode: Option to restrict to read-only operations for safety
  • Feedback Collection: Tool to collect user feedback and store it in the database

Requirements

  • Python 3.8+
  • Dependencies listed in requirements.txt

Installation

  1. Clone this repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables (optional):
    • Copy .env.example to .env (or use the existing .env file)
    • Modify settings as needed

Usage

Starting the Server
python server.py

The server will start on port 8080 (or the port specified in your .env file).

Configuration Options

Configure the server by editing the .env file:

DB_PATH=sample.db         # Path to your SQLite database file
MCP_PORT=8080             # Port to run the MCP server on
READ_ONLY=true            # Set to false to allow write operations
Using with Claude Desktop

Add this server to your Claude Desktop configuration:

{
"mcpServers": {
		"sqlite": {
			"command": "<Path to UV>",
			"args": [
				"--directory",
				"<Absolute Path to Project Workspace>",
				"run",
				"server.py"
			]
		}
	}
}
Available Tools

The MCP server provides the following tools:

  1. execute_query - Execute SQL queries on the database
  2. list_tables - List all tables in the database
  3. describe_table - Get the schema for a specific table
  4. count_rows - Count rows in a specific table
  5. insert_sample_data - Insert sample data (disabled in read-only mode)
  6. add_feedback - Add user feedback to the feedback table (disabled in read-only mode)

Sample Database Schema

The sample database includes:

Products Table
  • id (INTEGER, PRIMARY KEY)
  • name (TEXT, NOT NULL)
  • description (TEXT)
  • price (REAL, NOT NULL)
  • category (TEXT)
  • in_stock (BOOLEAN)
Customers Table
  • id (INTEGER, PRIMARY KEY)
  • name (TEXT, NOT NULL)
  • email (TEXT, UNIQUE)
  • signup_date (TEXT)
Orders Table
  • id (INTEGER, PRIMARY KEY)
  • customer_id (INTEGER, FOREIGN KEY)
  • order_date (TEXT)
  • total_amount (REAL)
Feedback Table
  • id (INTEGER, PRIMARY KEY)
  • user (TEXT, NOT NULL)
  • email (TEXT, NOT NULL)
  • feedback (TEXT, NOT NULL)
  • submission_date (TEXT, DEFAULT CURRENT_TIMESTAMP)

Security Considerations

  • SQL queries are validated to prevent dangerous operations
  • In read-only mode, all data modification operations are blocked
  • Consider running in read-only mode for production use

License

MIT License

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.