HS

hannesrudolph/sqlite-explorer-fastmcp-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

108 stars 28 forks 质量 56 趋势 0

hannesrudolph/sqlite-explorer-fastmcp-mcp-server 是从 https://github.com/hannesrudolph/sqlite-explorer-fastmcp-mcp-server. 导入的 MCP 服务器候选

概览

hannesrudolph/sqlite-explorer-fastmcp-mcp-server 是从 https://github.com/hannesrudolph/sqlite-explorer-fastmcp-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

一个MCP服务器,通过模型上下文协议(MCP)提供安全、只读访问SQLite数据库。该服务器采用FastMCP框架构建,使LLM能够探索和查询具有内置安全功能和查询验证功能的SQLite数据库。

📋 系统需求

  • Python 3.6+
  • SQLite 数据库文件(通过环境变量指定路径)

📦 依赖关系

安装所有必需的依赖:

必需包裹

  • fastmcp:构建模型上下文协议服务器的框架

所有依赖关系均在requirements.txt中指定,便于安装。

📑 目录

  • 系统需求
  • 依赖关系
  • MCP 工具
  • 入门指南
  • 安装选项
  • Claude桌面
  • Cline VSCode 插件
  • 安全特征
  • 开发文档
  • 环境变量

🛠️ MCP工具

服务器向大型语言模型展示以下工具:

read_query

在数据库上执行带有内置安全验证功能的SELECT查询。功能:

  • 查询验证与净化
  • 参数绑定支持
  • 行限制执行
  • 结果格式化为词典

list_tables

列出数据库中所有可用表及其名称。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

SQLite Explorer MCP Server

An MCP server that provides safe, read-only access to SQLite databases through Model Context Protocol (MCP). This server is built with the FastMCP framework, which enables LLMs to explore and query SQLite databases with built-in safety features and query validation.

📋 System Requirements

  • Python 3.6+
  • SQLite database file (path specified via environment variable)

📦 Dependencies

Install all required dependencies:

# Using pip
pip install -r requirements.txt

Required Packages

  • fastmcp: Framework for building Model Context Protocol servers

All dependencies are specified in requirements.txt for easy installation.

📑 Table of Contents

🛠️ MCP Tools

The server exposes the following tools to LLMs:

read_query

Execute a SELECT query on the database with built-in safety validations. Features:

  • Query validation and sanitization
  • Parameter binding support
  • Row limit enforcement
  • Results formatted as dictionaries

list_tables

List all available tables in the database with their names.

describe_table

Get detailed schema information for a specific table, including:

  • Column names and types
  • NULL constraints
  • Default values
  • Primary key information

🚀 Getting Started

Clone the repository:

git clone https://github.com/hannesrudolph/sqlite-explorer-fastmcp-mcp-server.git
cd sqlite-explorer-fastmcp-mcp-server

📦 Installation Options

You can install this MCP server in either Claude Desktop or the Cline VSCode plugin. Choose the option that best suits your needs.

Option 1: Install for Claude Desktop

Install using FastMCP:

fastmcp install sqlite_explorer.py --name "SQLite Explorer" -e SQLITE_DB_PATH=/path/to/db

Replace /path/to/db with the path to your SQLite database file.

Option 2: Install for Cline VSCode Plugin

To use this server with the Cline VSCode plugin:

  1. In VSCode, click the server icon (☰) in the Cline plugin sidebar
  2. Click the “Edit MCP Settings” button (✎)
  3. Add the following configuration to the settings file:
{
  "sqlite-explorer": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "fastmcp",
      "--with",
      "uvicorn",
      "fastmcp",
      "run",
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →