SQLite MCP 服务器
概述
模型上下文协议 (MCP) 服务器实现,通过 SQLite 提供数据库交互和商业智能功能。该服务器支持运行 SQL 查询、分析业务数据并自动生成业务洞察备忘录。
安装
如果尚未安装Bun
克隆此存储库
安装依赖项:
bun install运行安装脚本以在 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 许可证。详情请参阅许可证文件。
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器,通过SQLite提供数据库交互能力,让用户能够运行SQL查询,分析业务数据,并自动生成业务洞察备忘录。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA 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.Last updated -71,192MIT License
- -securityFlicense-qualityA Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.Last updated -3
- -securityFlicense-qualityA Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.Last updated -18
- AsecurityAlicenseAqualityA Model Context Protocol server that allows users to store, retrieve, update, and delete memories using SQLite storage.Last updated -57MIT License