AI Skill Hub 推荐使用:SQLite数据库MCP服务器 是一款优质的MCP工具。AI 综合评分 7.8 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
基于MCP协议的SQLite数据库管理工具,提供安全的数据库操作、CSV导入导出、代码修改和数据可观测性功能。适合开发者、数据分析师和系统管理员进行数据库管理和数据处理工作。
SQLite数据库MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于MCP协议的SQLite数据库管理工具,提供安全的数据库操作、CSV导入导出、代码修改和数据可观测性功能。适合开发者、数据分析师和系统管理员进行数据库管理和数据处理工作。
SQLite数据库MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/neverinfamous/db-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"sqlite---mcp---": {
"command": "npx",
"args": ["-y", "db-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 SQLite数据库MCP服务器 执行以下任务... Claude: [自动调用 SQLite数据库MCP服务器 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"sqlite___mcp___": {
"command": "npx",
"args": ["-y", "db-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
SQLite MCP Server with 151 specialized tools, 11 data resources + 9 help resources, and 10 prompts, audit logging with DDL backup snapshots, HTTP/SSE Transport, OAuth 2.1 authentication, tool filtering, granular access control, and structured error handling with categorized, actionable responses. Available in WASM and better-sqlite3 variants.
---
Pull and run instantly:
docker pull writenotenow/db-mcp:latest
Run with volume mount:
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/db-mcp:latest \
--sqlite-native /workspace/database.db
Clone the repository:
git clone https://github.com/neverinfamous/db-mcp.git
Navigate to directory:
cd db-mcp
Install dependencies:
npm install
Build the project:
npm run build
Run the server with Native backend (better-sqlite3 — full features, requires Node.js native build):
node dist/cli.js --transport stdio --sqlite-native ./database.db
Or with WASM backend (sql.js — cross-platform, no compilation required):
node dist/cli.js --transport stdio --sqlite ./database.db
Backend Choice: Use--sqlite-nativefor full features (151 tools, transactions, window functions, SpatiaLite). Use--sqlitefor WASM mode (125 tools, no native dependencies).
If you prefer individual tool calls, starter provides Core + JSON + Text:
{
"args": ["--tool-filter", "starter"]
}
Specify exactly the groups you need:
{
"args": ["--tool-filter", "core,json,stats"]
}
| Variable | Default | Description |
|---|---|---|
MCP_HOST | 0.0.0.0 | Host/IP to bind to (CLI: --server-host) |
SQLITE_DATABASE | — | SQLite database path (CLI: --sqlite / --sqlite-native) |
DB_MCP_TOOL_FILTER | — | Tool filter string (CLI: --tool-filter) |
MCP_AUTH_TOKEN | — | Simple bearer token for HTTP auth (CLI: --auth-token) |
OAUTH_ENABLED | false | Enable OAuth 2.1 (CLI: --oauth-enabled) |
OAUTH_ISSUER | — | Authorization server URL (CLI: --oauth-issuer) |
OAUTH_AUDIENCE | — | Expected token audience (CLI: --oauth-audience) |
OAUTH_JWKS_URI | — | JWKS URI, auto-discovered if omitted (CLI: --oauth-jwks-uri) |
OAUTH_CLOCK_TOLERANCE | 60 | Clock tolerance in seconds (CLI: --oauth-clock-tolerance) |
LOG_LEVEL | info | Log verbosity: debug, info, warning, error |
METADATA_CACHE_TTL_MS | 5000 | Schema cache TTL in ms (auto-invalidated on DDL operations) |
CODEMODE_ISOLATION | worker | Code Mode sandbox: worker (enhanced isolation) or vm |
MCP_RATE_LIMIT_MAX | 100 | Max requests/minute per IP (HTTP transport) |
CSV_EXTENSION_PATH | — | Custom path to CSV extension binary (native only) |
SPATIALITE_PATH | — | Custom path to SpatiaLite extension binary (native only) |
AUDIT_LOG | — | Audit log file path, or stderr (CLI: --audit-log) |
AUDIT_REDACT | false | Redact tool arguments from audit entries (CLI: --audit-redact) |
AUDIT_READS | false | Also log read-scoped tool invocations (CLI: --audit-reads) |
AUDIT_BACKUP | false | Enable pre-mutation DDL snapshots (CLI: --audit-backup) |
AUDIT_BACKUP_DATA | false | Include sample data rows in snapshots (CLI: --audit-backup-data) |
Tip: LowerMETADATA_CACHE_TTL_MSfor development (e.g.,1000), or increase it for production with stable schemas (e.g.,60000= 1 min). Schema cache is automatically invalidated on DDL operations (CREATE/ALTER/DROP).
Add to your ~/.cursor/mcp.json, Claude Desktop config, or equivalent:
{
"mcpServers": {
"db-mcp-sqlite": {
"command": "node",
"args": [
"C:/path/to/db-mcp/dist/cli.js",
"--transport",
"stdio",
"--sqlite-native",
"C:/path/to/your/database.db",
"--tool-filter",
"codemode"
]
}
}
}
Variants (modify the args array above):
| Variant | Change |
|---|---|
| **WASM backend** | Replace --sqlite-native with --sqlite |
| **In-memory database** | Replace the database path with :memory: |
| **Starter preset** | Replace "codemode" with "starter" for individual tool calls |
| **CSV extension** | Add "--csv" before "--tool-filter" (native only) |
| **SpatiaLite** | Add "--spatialite" and set env: { "SPATIALITE_PATH": "/path/to/mod_spatialite" } (native only) |
| **Linux/macOS** | Use forward-slash Unix paths (e.g., /path/to/db-mcp/dist/cli.js) |
| **Docker** | Replace "command": "node" with "command": "docker" and wrap args in run -i --rm -v ./data:/app/data writenotenow/db-mcp:latest |
See Tool Filtering to customize which tools are exposed.
export MCP_AUTH_TOKEN=my-secret node dist/cli.js --transport http --port 3000 --sqlite-native ./database.db ```
Clients must include Authorization: Bearer my-secret on all requests. /health and / are exempt. Unauthenticated requests receive 401 with WWW-Authenticate: Bearer headers per RFC 6750.
| Prefix | Target | Example | Effect |
|---|---|---|---|
| _(none)_ | Shortcut | starter | **Whitelist Mode:** Enable ONLY this shortcut |
| _(none)_ | Group | core | **Whitelist Mode:** Enable ONLY this group |
| _(none)_ | Tool | read_query | **Whitelist Mode:** Enable ONLY this tool |
+ | Group | +vector | Add tools from this group to current set |
- | Group | -admin | Remove tools in this group from current set |
+ | Tool | +fuzzy_search | Add one specific tool |
- | Tool | -drop_table | Remove one specific tool |
db-mcp [options]
Transport: --transport <stdio|http|sse> --port <N> --server-host <host> --stateless
Auth: --auth-token <token> | --oauth-enabled --oauth-issuer <url> --oauth-audience <aud>
Database: --sqlite <path> | --sqlite-native <path>
Extensions: --csv --spatialite (native only)
Audit: --audit-log <path> --audit-redact --audit-reads --audit-backup --audit-backup-data
Server: --name <name> --version <ver> --tool-filter <filter>
CLI flags override environment variables. Run node dist/cli.js --help for full details.
| Method | Endpoint | Purpose |
|---|---|---|
GET | /health | Health check (bypasses rate limiting, always available for monitoring) |
SQLite supports both built-in extensions (compiled into better-sqlite3) and loadable extensions (require separate binaries).
| Extension | Purpose | Status |
|---|---|---|
| **FTS5** | Full-text search with BM25 ranking | ✅ Always loaded |
| **JSON1** | JSON functions (json_extract, etc.) | ✅ Always loaded |
| **R-Tree** | Spatial indexing for bounding boxes | ✅ Always loaded |
| Extension | Purpose | Tools | CLI Flag |
|---|---|---|---|
| **CSV** | CSV virtual tables | 2 | --csv |
| **SpatiaLite** | Advanced GIS capabilities | 7 | --spatialite |
CSV Extension:
Download a precompiled binary or compile from source: https://www.sqlite.org/csv.html
Set the environment variable (Linux/macOS):
export CSV_EXTENSION_PATH=/path/to/csv.so
On Windows, use .dll:
export CSV_EXTENSION_PATH=/path/to/csv.dll
Or use the CLI flag:
db-mcp --sqlite-native ./data.db --csv
SpatiaLite Extension:
Install the library for your platform:
sudo apt install libspatialite-devbrew install libspatialiteSet the environment variable:
export SPATIALITE_PATH=/path/to/mod_spatialite.so
Or use the CLI flag:
db-mcp --sqlite-native ./data.db --spatialite
Note: Extension binaries must match your platform and architecture. The server searches common paths automatically, or use theCSV_EXTENSION_PATH/SPATIALITE_PATHenvironment variables for custom locations.
专业的MCP数据库工具,架构清晰,功能完整。TypeScript实现保证类型安全,适合AI应用集成数据操作能力。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,SQLite数据库MCP服务器 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | db-mcp |
| 原始描述 | 开源MCP工具:SQLite MCP Server — Secure Database Administration & Observability with Code Mod。⭐7 · TypeScript |
| Topics | 数据库SQLiteMCP协议CSV开发工具 |
| GitHub | https://github.com/neverinfamous/db-mcp |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-21 · 更新时间:2026-05-22 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端