Skip to main content

MCP SQLite Tool

PyPI version License: MIT

An MCP server that provides AI with secure and direct access to SQLite databases.

🌟 Features

  • Secure Access: Allows AI to interact with SQLite databases while validating file paths to prevent unauthorized access.
  • Single-File Server: The core logic is contained in a single Python file, making it easy to understand and maintain.
  • Standard I/O (stdio) Transport: Implements the official MCP protocol using standard I/O for seamless integration with tools like VS Code.
  • Pythonic & Easy to Use: Built with the fastmcp framework, which uses decorators to simplify tool creation.

🚀 Installation

This tool is available as a package on PyPI. You can install it using pip.

pip install mcp-sqlite-tool

Note: This tool requires Python 3.10 or higher. The mcp[cli] dependency will be installed automatically.

🤖 Usage with VS Code

To use this tool with an MCP-compatible client like VS Code, you need to configure your workspace to discover and run the server.

  1. Install the package: Ensure you have the mcp-sqlite-tool package installed in the Python environment that VS Code is using.

    pip install mcp-sqlite-tool
    
  2. Configure settings.json: Open the Command Palette in VS Code (Ctrl+Shift+P), search for "Open Workspace Settings (JSON)", and add the following configuration:

    {
     "mcpServers": {
      "sqlite-query": {
       "command": "mcp-sqlite-tool"
      }
     }
    }
    
    • "sqlite-query": This name identifies the server. It must match the name specified in the Python tool's code (FastMCP("sqlite-query")).
    • "command": "mcp-sqlite-tool": This is the command-line entry point installed by pip. VS Code will use this to launch your server.
  3. Interact with the AI: Once configured, the AI client will be able to use the tool execute_sqlite_query. You can now prompt the AI to interact with your SQLite files.

Example Prompt

"Using the sqlite-query tool, tell me the names and emails of all users in the users table of C:\Users\John\Documents\project.db."

The AI will interpret this request and call your tool with the appropriate arguments.

🛠️ Tool Documentation

The core tool provided by this server is:

execute_sqlite_query

Executes a given SQL query on a specified SQLite database file.

Parameter Type Description
db_path str The absolute path to the SQLite database file.
sql_query str The SQL query to execute.

Returns: A dictionary containing the query results or an error message if the operation fails.

🤝 Contributing

Contributions, issues, and feature requests are welcome! If you have any issues, please contact me directly on Telegram (@mrbeandev).

📄 License

Distributed under the MIT License. See LICENSE for more information.

Metadata

Release files for mcp-sqlite-tool 0.1.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 mcp-sqlite-tool 0.1.2
File Size Uploaded Provenance
mcp_sqlite_tool-0.1.2.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-sqlite-tool 0.1.2
File Interpreter ABI Platform
mcp_sqlite_tool-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / mcp_sqlite_tool-0.1.2.tar.gz

Download URL mcp_sqlite_tool-0.1.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2cea9c33c98e291e3e4b2e5beaecb00b1fb02b1f3081d97cbbc2e0bdadc77dd3
BLAKE2b-256 checksum
How to use checksums
f06c82b33e92180d53122e7007435c79ec663454f0f457c83ad9c8c51253d471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release files / mcp_sqlite_tool-0.1.2-py3-none-any.whl

Download URL mcp_sqlite_tool-0.1.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32ed69bcf7ed49e460565763d44b26a01b3fb543c85306beaffc069d2bb2fe89
BLAKE2b-256 checksum
How to use checksums
3ad030ce9972b7f6b629cac9e3fbe772afc52532348d850bd565faafe5b28f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Security for mcp-sqlite-tool 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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