Provides comprehensive SQLite database management capabilities including executing SQL queries, performing CRUD operations, creating tables, and managing database schemas with built-in SQL injection protection.
SQLite MCP Server
通用SQLite数据库管理工具,通过MCP协议提供SQL执行能力。
功能特性
执行任意合法的SQL查询
支持SELECT/INSERT/UPDATE/DELETE/CREATE等操作
内置SQL注入防护
支持stdio、SSE和streamable-http三种通信模式
可配置的IP和端口
快速开始
安装依赖
SQLite3 是Python内置模块,无需单独安装。
启动服务器
客户端调用示例
使用提供的客户端类
直接调用MCP工具
配置与启动
启动参数
参数 | 默认值 | 描述 |
--server_type | sse | 服务器类型: stdio/sse/streamable-http |
--host | 0.0.0.0 | 监听地址 |
--port | 8000 | 监听端口 |
--log_level | INFO | 日志级别: DEBUG/INFO/WARNING/ERROR |
环境变量配置
环境变量 | 默认值 | 描述 |
MCP_HOST | 0.0.0.0 | 监听地址 |
MCP_PORT | 8000 | 监听端口 |
MCP_SERVER_TYPE | sse | 服务器类型 (sse/stdio/streamable-http) |
数据库自动创建
服务启动时会自动在项目根目录创建demo.db
数据库文件(如果不存在)
启动示例
JSON配置示例
stdio模式配置
sse模式配置
streamable-http模式配置
项目结构
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A universal SQLite database management tool that enables SQL query execution through MCP protocol. Supports SELECT/INSERT/UPDATE/DELETE/CREATE operations with built-in SQL injection protection across stdio, SSE, and streamable-http communication modes.