XM

xexr/mcp-libsql

开发工具

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

21 stars 5 forks 质量 85 趋势 24MIT

为 libSQL 数据库提供安全的 MCP 服务器,配备全面的工具、连接池和事务支持。使用 TypeScript 构建于 Claude 桌面版、Claude Code、Cursor 及其他 MCP 客户端。

概览

一款用于 libSQL 数据库操作的模型上下文协议(MCP)服务器,通过 Claude Desktop、Claude Code、Cursor 及其他兼容 MCP 的客户端提供安全的数据库访问。 3. 使用您的Node.js路径和数据库URL(见下方配置示例) ✅ - 全部6个核心工具实现并测试 ✅ - 67项安全测试涵盖所有注入矢量 ✅ - 244项测试(177个单元+67个安全),通过率✅ 100% - 成功与MCP客户端✅合作 - 连接重试、优雅降级和审计日志 - : 执行带有全面安全验证的SELECT查询 - : 支持事务的插入/更新/删除操作 - : 带有安全措施的表创建DDL操作 - : 表结构修改(添加/重命名/删除操作) - : 带过滤选项的数据库元数据浏览 - : 多种输出格式的表模式检查 - 全面安全验证 - 健康监测和自动重试逻辑 - - 配备......

概述(AI 翻译)

一款用于 libSQL 数据库操作的模型上下文协议(MCP)服务器,通过 Claude Desktop、Claude Code、Cursor 及其他兼容 MCP 的客户端提供安全的数据库访问。

运行在Node上,用TypeScript编写

🔧 快速启动

  1. 安装:

  2. 本地测试:

  3. **配置Claude Desktop,使用您的Node.js路径和数据库URL(见下方配置示例)

🚀 状态

✅ 完整的数据库管理能力 - 全部6个核心工具均已实现并测试 ✅ 全面的安全验证 - 涵盖所有注入载体的67项安全测试 ✅ 广泛的测试覆盖 - 共244次测试(177个单元+67个安全测试),通过率100% ✅ 生产部署验证 - 成功与MCP客户端合作 ✅ 强健的错误处理 - 连接重试、优雅降级和审计日志

🛠️ 特色

可用工具

  • read-query:执行带有全面安全验证的SELECT查询
  • write-query:支持事务的插入/更新/删除操作
  • create-table:用于创建带有安全措施的DDL表创建操作

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

README

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

MCP libSQL by xexr

A Model Context Protocol (MCP) server for libSQL database operations, providing secure database access through Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients.

Runs on Node, written in TypeScript

🔧 Quick Start

  1. Install:

    pnpm install -g @xexr/mcp-libsql
    
  2. Test locally:

    mcp-libsql --url file:///tmp/test.db --log-mode console
    
  3. Configure Claude Desktop with your Node.js path and database URL (see configuration examples below)

🚀 Status

✅ Complete database management capabilities - All 6 core tools implemented and tested
✅ Comprehensive security validation - 67 security tests covering all injection vectors
✅ Extensive test coverage - 244 total tests (177 unit + 67 security) with 100% pass rate
✅ Production deployment verified - Successfully working with MCP clients
✅ Robust error handling - Connection retry, graceful degradation, and audit logging

🛠️ Features

Available Tools

  • read-query: Execute SELECT queries with comprehensive security validation
  • write-query: INSERT/UPDATE/DELETE operations with transaction support
  • create-table: DDL operations for table creation with security measures
  • alter-table: Table structure modifications (ADD/RENAME/DROP operations)
  • list-tables: Database metadata browsing with filtering options
  • describe-table: Table schema inspection with multiple output formats

Security & Reliability

  • Multi-layer SQL injection prevention with comprehensive security validation
  • Connection pooling with health monitoring and automatic retry logic
  • Transaction support with automatic rollback on errors
  • Comprehensive audit logging for security compliance

🔐 Security details: See docs/SECURITY.md for comprehensive security features and testing.

Developer Experience

  • Beautiful table formatting with proper alignment and NULL handling
  • Performance metrics displayed for all operations
  • Clear error messages with actionable context
  • Parameterized query support for safe data handling
  • Development mode with enhanced logging and hot reload

📋 Prerequisites

  • Node.js 20+
  • pnpm (or npm) package manager
  • libSQL database (file-based or remote)
  • Claude Desktop (for MCP integration)

Platform Requirements

  • macOS: Native Node.js installation
  • Linux: Native Node.js installation
  • Windows: Native Node.js installation or WSL2 with Node.js installation

🔧 Installation

# Use your package manager of choice, e.g. npm, pnpm, bun etc

# Install globally
pnpm install -g @xexr/mcp-libsql
mcp-libsql -v # check version

# ...or build from the repository
git clone https://github.com/Xexr/mcp-libsql.git
cd mcp-libsql
pnpm install # Install dependencies
pnpm build # Build the project
在 GitHub 查看完整 README

安装

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

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

配置

{ "mcpServers": { "mcp-libsql": { "command": "mcp-libsql", "args": [ "--url", "file:///Users/username/database.db" ] } } }