Skip to main content

A simple SQLite MCP server

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

SQLite MCP Server

Overview

A Model Context Protocol (MCP) server implementation that provides database interaction and business intelligence capabilities through SQLite. This server enables running SQL queries, analyzing business data, and automatically generating business insight memos.

Components

Resources

The server exposes a single dynamic resource:

  • memo://insights: A continuously updated business insights memo that aggregates discovered insights during analysis
    • Auto-updates as new insights are discovered via the append-insight tool

Prompts

The server provides a demonstration prompt:

  • mcp-demo: Interactive prompt that guides users through database operations
    • Required argument: topic - The business domain to analyze
    • Generates appropriate database schemas and sample data
    • Guides users through analysis and insight generation
    • Integrates with the business insights memo

Tools

The server offers six core tools:

Query Tools

  • read_query

    • Execute SELECT queries to read data from the database
    • Input:
      • query (string): The SELECT SQL query to execute
    • Returns: Query results as array of objects
  • write_query

    • Execute INSERT, UPDATE, or DELETE queries
    • Input:
      • query (string): The SQL modification query
    • Returns: { affected_rows: number }
  • create_table

    • Create new tables in the database
    • Input:
      • query (string): CREATE TABLE SQL statement
    • Returns: Confirmation of table creation

Schema Tools

  • list_tables

    • Get a list of all tables in the database
    • No input required
    • Returns: Array of table names
  • describe-table

    • View schema information for a specific table
    • Input:
      • table_name (string): Name of table to describe
    • Returns: Array of column definitions with names and types

Analysis Tools

  • append_insight
    • Add new business insights to the memo resource
    • Input:
      • insight (string): Business insight discovered from data analysis
    • Returns: Confirmation of insight addition
    • Triggers update of memo://insights resource

Usage with Claude Desktop

uv

# Add the server to your claude_desktop_config.json
"mcpServers": {
  "sqlite": {
    "command": "uv",
    "args": [
      "--directory",
      "parent_of_servers_repo/servers/src/sqlite",
      "run",
      "mcp-server-sqlite",
      "--db-path",
      "~/test.db"
    ]
  }
}

Docker

# Add the server to your claude_desktop_config.json
"mcpServers": {
  "sqlite": {
    "command": "docker",
    "args": [
      "run",
      "--rm",
      "-i",
      "-v",
      "mcp-test:/mcp",
      "mcp/sqlite",
      "--db-path",
      "/mcp/test.db"
    ]
  }
}

Usage with VS Code

For quick installation, click the installation buttons below:

Install with UV in VS Code Install with UV in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is needed when using the mcp.json file.

uv

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "db_path",
        "description": "SQLite Database Path",
        "default": "${workspaceFolder}/db.sqlite"
      }
    ],
    "servers": {
      "sqlite": {
        "command": "uvx",
        "args": [
          "mcp-server-sqlite",
          "--db-path",
          "${input:db_path}"
        ]
      }
    }
  }
}

Docker

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "db_path",
        "description": "SQLite Database Path (within container)",
        "default": "/mcp/db.sqlite"
      }
    ],
    "servers": {
      "sqlite": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-v",
          "mcp-sqlite:/mcp",
          "mcp/sqlite",
          "--db-path",
          "${input:db_path}"
        ]
      }
    }
  }
}

Building

Docker:

docker build -t mcp/sqlite .

Test with MCP inspector

uv add "mcp[cli]"
mcp dev src/mcp_server_sqlite/server.py:wrapper  

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_sqlite-2025.4.25.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_sqlite-2025.4.25-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_sqlite-2025.4.25.tar.gz.

File metadata

  • Download URL: mcp_server_sqlite-2025.4.25.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_server_sqlite-2025.4.25.tar.gz
Algorithm Hash digest
SHA256 5c396211adb90595d06a505ac836657fc76ee4439e132acdf65caf21b4a8de42
MD5 78b50224c6ca24357f5942eec6c777e1
BLAKE2b-256 e4598b9ceea660cf973429c3fc3b8f1ea91c77790b934b098c2b78b152c598a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_sqlite-2025.4.25.tar.gz:

Publisher: release.yml on modelcontextprotocol/servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_server_sqlite-2025.4.25-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_sqlite-2025.4.25-py3-none-any.whl
Algorithm Hash digest
SHA256 5ba5706aa29d249a3cde8226577e021c07792d3198e9db40fd005578d2a0801d
MD5 0ed9456369ce72f67896423bae04fe05
BLAKE2b-256 fcf3dbffd53873eafd8773e289fdd0cb96dc4f793071973df07e79a4e9bae425

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_sqlite-2025.4.25-py3-none-any.whl:

Publisher: release.yml on modelcontextprotocol/servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page