db-mcp-server  by FreePeak

Database server for AI assistants

Created 6 months ago
293 stars

Top 90.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a multi-database server that implements the Model Context Protocol (MCP) to enable AI assistants to interact with various databases. It targets AI developers and researchers needing structured, simultaneous access to multiple data sources, offering a unified interface for querying, transaction management, schema exploration, and performance analysis.

How It Works

The server connects to multiple MySQL and PostgreSQL databases concurrently, as defined in a JSON configuration file. For each connected database, it dynamically generates specialized tools (e.g., query_mysql1, schema_postgres1) that abstract database-specific operations. This approach, built on Clean Architecture principles, provides a modular and maintainable system for AI agents to interact with data through a consistent interface.

Quick Start & Requirements

  • Install/Run:
    • Docker: docker pull freepeak/db-mcp-server:latest then docker run -p 9092:9092 -v $(pwd)/config.json:/app/my-config.json -e TRANSPORT_MODE=sse -e CONFIG_PATH=/app/my-config.json freepeak/db-mcp-server
    • Source: git clone https://github.com/FreePeak/db-mcp-server.git, cd db-mcp-server, make build, ./bin/server -t sse -c config.json
  • Prerequisites: Go (for building from source), Docker. Configuration requires database credentials.
  • Setup Time: Minimal for Docker, requires Go installation and build time for source.
  • Docs: Go Reference

Highlighted Details

  • Supports simultaneous connections to MySQL, PostgreSQL (v9.6-17), and TimescaleDB.
  • Dynamically generates tools for querying, executing statements, managing transactions, exploring schemas, and analyzing performance.
  • Offers specialized tools for TimescaleDB, including hypertable management and time-series querying.
  • Compatible with OpenAI Agents SDK and tools like Cursor IDE via STDIO transport.

Maintenance & Community

  • Active contributor count is listed via a shield.
  • Contribution guidelines are available in CONTRIBUTING.md.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: Permissive MIT license allows for commercial use and integration with closed-source applications.

Limitations & Caveats

The project primarily supports MySQL and PostgreSQL; other database types are not explicitly mentioned. While TimescaleDB is supported, its specific features are noted as extensions to PostgreSQL.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
3
Star History
27 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.