Skip to main content

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.

Release files for iflow-mcp_mcp-server-sqlite 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_mcp-server-sqlite 0.6.2
File Size Uploaded
iflow_mcp_mcp_server_sqlite-0.6.2.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_mcp-server-sqlite 0.6.2
File Interpreter ABI Platform
iflow_mcp_mcp_server_sqlite-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size:36.5 kB

Release files / iflow_mcp_mcp_server_sqlite-0.6.2.tar.gz

Download URL iflow_mcp_mcp_server_sqlite-0.6.2.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7e4e5e95afe76963244dfaa6de29f8d53b64e4c97ccc74307b081561a308e995
BLAKE2b-256 checksum
How to use checksums
2b3f10834872d7939be5a47ae48959effecccf15396e54073f90b089c9fdebea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Release files / iflow_mcp_mcp_server_sqlite-0.6.2-py3-none-any.whl

Download URL iflow_mcp_mcp_server_sqlite-0.6.2-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32340540d250161830444ed97792d3369efadcd01e54b2bdd22393fa357e805f
BLAKE2b-256 checksum
How to use checksums
cb8225a020e0fad5ba7c67eb5b620317ae73c24e7cdb8a8fa26c059a3545c862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page