Labsco
Xexr logo

libSQL by xexr

β˜… 21

from Xexr

MCP server for libSQL databases with comprehensive security and management tools. Supports file, local HTTP, and remote Turso databases with connection pooling, transaction support, and 6 specialized database tools.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

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

πŸš€ 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

πŸ“‹ Available Tools

  • read-query - Execute SELECT queries with security validation
  • write-query - INSERT/UPDATE/DELETE with transaction support
  • create-table - CREATE TABLE with DDL security
  • alter-table - Modify table structure (ADD/RENAME/DROP)
  • list-tables - Browse database metadata and objects
  • describe-table - Inspect table schema and structure

πŸ“– Detailed API documentation: See docs/API.md for complete input/output examples and parameters.

πŸ§ͺ Testing

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

# Run specific test file
pnpm test security-verification

# Lint code
pnpm lint

# Fix linting issues
pnpm lint:fix

# Type check
pnpm typecheck

Test Coverage: 403 tests covering all functionality including edge cases, error scenarios, CLI arguments, authentication, and comprehensive security validation.

πŸ—οΈ Architecture

Built with TypeScript and modern Node.js patterns:

  • Connection pooling with health monitoring and retry logic
  • Tool-based architecture with consistent validation and error handling
  • Security-first design with multi-layer input validation
  • Comprehensive testing with 244 tests covering all scenarios

🀝 Contributing

  1. Follow TypeScript strict mode and existing code patterns
  2. Write tests for new features
  3. Maintain security measures
  4. Update documentation

Development: pnpm dev β€’ Build: pnpm build β€’ Test: pnpm test

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ”— Links