RS

rvarun11/sqlite-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

10 stars 2 forks 품질 73 트렌드 32

MCP server for SQLite

개요

A Model Context Protocol (MCP) server for SQLite database operations. This server provides a standardized interface for SQLite database interactions including schema inspection, read and write operations. The MCP server exposes three main tools: - Description: List all tables in the SQLite database with their schema information - Parameters: None - Usage: Provides complete schema introspection including columns, types, constraints, and indexes - Description: Execute read-only queries against the SQLite database. - Parameters: - sql (required): Read-only SQL query to execute -Usage: Only SELECT, WITH, and EXPLAIN queries are allowed - Example: SELECT * FROM users WHERE age > 25 - Description: Execute write operations against the SQLite database - Parameters: - sql (required): SQL statement that modifies the database - Usage: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP operations - Example: INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.

README

원문 README의 일부입니다. 원문 보기.

SQLite MCP Server

A Model Context Protocol (MCP) server for SQLite database operations. This server provides a standardized interface for SQLite database interactions including schema inspection, read and write operations.

Available Tools

The MCP server exposes three main tools:

get_schema

  • Description: List all tables in the SQLite database with their schema information
  • Parameters: None
  • Usage: Provides complete schema introspection including columns, types, constraints, and indexes

query

  • Description: Execute read-only queries against the SQLite database.
  • Parameters:
    • sql (required): Read-only SQL query to execute -Usage: Only SELECT, WITH, and EXPLAIN queries are allowed
  • Example: SELECT * FROM users WHERE age > 25

execute

  • Description: Execute write operations against the SQLite database
  • Parameters:
    • sql (required): SQL statement that modifies the database
  • Usage: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP operations
  • Example: INSERT INTO users (name, email) VALUES ('John Doe', '[email protected]')

Get Started

Prerequisites

  • Go: SQLite MCP Server requires Go 1.26 or later. Download from go.dev/doc/install
  • Task: Install go-task to run automated development tasks. Install using Homebrew with brew install go-task
  • SQLite3: For creating and managing SQLite databases locally
  • golangci-lint: Go linter. Install using Homebrew with brew install golangci-lint or follow instructions at golangci-lint.run (optional)
  • Docker: To run the server with Docker (optional)

Installation

  1. Clone the repository:
git clone https://github.com/rvarun11/sqlite-mcp.git
cd sqlite-mcp
  1. Build:
# Builds the binary and the example database
task build

# Or if you prefer Docker:
task docker-build

MCP Client Configuration

After installation, add the following configuration to your MCP client:

Using built binary:

{
  "mcpServers": {
    "sqlite": {
      "command": "/path/to/your/sqlite-mcp/build/sqlite-mcp",
      "args": [
        "--database",
        "/path/to/your/database.db"
      ]
    }
  }
}

Args:

  • --database, -d: Path to SQLite database file (required)
  • --debug: Enable debug mode for verbose logging (optional)

Using Docker:

{
  "mcpServers": {
    "sqlite": {
      "command": "/path/to/your/.docker/bin/docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "sqlite-mcp-server"
      ]
    }
  }
}

The above uses example.sql to build the example database. To use a custom schema sql, see the Docker commands below.

Important Note for GUI Applications: When configuring MCP clients in GUI applications (like Claude Desktop), you must use absolute paths for both the command and database file paths. Do not use:

GitHub에서 전체 README 보기

설치

docker run -i --rm sqlite-mcp-server
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "sqlite": { "command": "/path/to/your/sqlite-mcp/build/sqlite-mcp", "args": [ "--database", "/path/to/your/database.db" ] } } }