Skip to main content
Glama
jacksteamdev

SQLite MCP Server

by jacksteamdev

SQLite MCP 服务器

概述

模型上下文协议 (MCP) 服务器实现,通过 SQLite 提供数据库交互和商业智能功能。该服务器支持运行 SQL 查询、分析业务数据并自动生成业务洞察备忘录。

Related MCP server: SQLite MCP Server

安装

  1. 如果尚未安装Bun

  2. 克隆此存储库

  3. 安装依赖项:

    bun install
  4. 运行安装脚本以在 Claude Desktop 中配置服务器:

    bun run setup

安装脚本将自动将服务器配置添加到您的 Claude Desktop 配置文件中,该文件位于:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

成分

资源

服务器公开单个动态资源:

  • memo://insights :持续更新的业务洞察备忘录,汇总分析过程中发现的洞察

    • 通过附加洞察工具发现新见解时自动更新

提示

服务器提供演示提示:

  • mcp-demo :指导用户完成数据库操作的交互式提示

    • 必需参数: topic - 要分析的业务领域

    • 生成适当的数据库模式和示例数据

    • 指导用户进行分析和洞察生成

    • 与业务洞察备忘录集成

工具

该服务器提供六个核心工具:

查询工具

  • read-query

    • 执行 SELECT 查询以从数据库读取数据

    • 输入:

      • query (字符串):要执行的 SELECT SQL 查询

    • 返回:查询结果作为对象数组

  • write-query

    • 执行 INSERT、UPDATE 或 DELETE 查询

    • 输入:

      • query (字符串):SQL 修改查询

    • 返回: { affected_rows: number }

  • create-table

    • 在数据库中创建新表

    • 输入:

      • query (字符串):CREATE TABLE SQL语句

    • 返回:表创建确认

架构工具

  • list-tables

    • 获取数据库中所有表的列表

    • 无需输入

    • 返回:表名称数组

  • describe-table

    • 查看特定表的架构信息

    • 输入:

      • table_name (字符串):要描述的表的名称

    • 返回:具有名称和类型的列定义数组

分析工具

  • append-insight

    • 向备忘录资源添加新的业务见解

    • 输入:

      • insight (字符串):从数据分析中发现的商业洞察

    • 返回:确认洞察力的增加

    • 触发 memo://insights 资源的更新

发展

项目结构

  • src/index.ts :主服务器实现

  • src/logger.ts :日志实用程序

  • scripts/setup.ts :Claude Desktop 配置脚本

日志记录

服务器维护详细日志:

  • server.log :位于项目根目录

  • 日志包括时间戳、日志级别(DEBUG、INFO、WARN、ERROR、FATAL)和结构化元数据

数据库

SQLite 数据库文件创建于:

  • data.sqlite :位于项目根目录

  • 如果不存在则自动创建

可用脚本

  • bun run setup :在 Claude Desktop 中配置服务器

  • bun run lint :运行 ESLint 检查

  • bun run lint:fix :自动修复 ESLint 问题

  • bun run inspect :运行 MCP 检查器

执照

此 MCP 服务器采用 MIT 许可证。详情请参阅许可证文件。

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    A
    maintenance
    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.
    90,399
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
    7
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    A Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.
    7
    42 npm
    1
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.
    11 npm
    8
    MIT