MCP Database Bridge

MCP Database Bridge

A secure, read-only MCP server that empowers Claude Desktop and AI agents to safely query and inspect local SQLite databases.

Category
访问服务器

README

<div align="center"> <img src="img/logo_txt.png" alt="Infinite Inovators Logo" width="360" /> <br /> <h2><samp>DB / BRIDGE</samp></h2>

<p><b>A secure, read-only Model Context Protocol (MCP) server that empowers Claude Desktop and other AI agents to safely query and inspect local SQLite databases.</b></p>

<p> <img src="https://img.shields.io/badge/Python-3.11+-blue.svg?style=for-the-badge&logo=python&logoColor=white" alt="Python" /> <img src="https://img.shields.io/badge/SQLite-003B57?style=for-the-badge&logo=sqlite&logoColor=white" alt="SQLite" /> <img src="https://img.shields.io/badge/Claude_Desktop-Ready-D97757?style=for-the-badge&logo=anthropic&logoColor=white" alt="Claude Ready" /> <img src="https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge" alt="License" /> </p> </div>


Demo Video

Click the preview below to watch the MCP Database Bridge project demonstration on YouTube.

<p align="center"> <a href="https://youtu.be/PGUQi27JBAw"> <img src="https://img.youtube.com/vi/PGUQi27JBAw/maxresdefault.jpg" alt="Watch the MCP Database Bridge Demo Video on YouTube" width="720"> </a> </p>

<p align="center"> <a href="https://youtu.be/PGUQi27JBAw"><b>Watch the Demo Video on YouTube</b></a> </p>


✨ Features

  • 🛡️ Read-Only Safeties: Strict regex filtering intercepts and rejects destructive operations like INSERT, UPDATE, DROP, and ALTER. The AI can look, but it can't touch.
  • 🔍 Introspection: AI can autonomously list tables and read schemas (PRAGMA table_info) directly to understand your data structure before writing queries.
  • 🚀 Claude Desktop Ready: Comes with one-click automated setup scripts for both macOS/Linux and Windows that instantly wire it up to your Claude Desktop config.
  • 📊 Query Analysis: Includes explain_query capabilities to help AI debug complex data retrieval.

Quick Start

The setup scripts create a Python virtual environment, install dependencies, and register database-mcp in Claude Desktop.

Prerequisites

  • Python 3.11 or newer
  • Git
  • Claude Desktop

<br />

1. Clone the Repository

git clone https://github.com/buvaneswaraneb/mcp-database-bridge.git
cd mcp-database-bridge

<br />

2. Run the Setup Script

Choose the instructions for your operating system.

<details> <summary><b>macOS / Linux</b></summary>

<br />

Run:

chmod +x setup.sh
./setup.sh

After setup completes:

  1. Completely quit Claude Desktop.
    • On macOS, press Cmd + Q.
    • On Linux, quit Claude from the application menu.
  2. Reopen Claude Desktop.
  3. Open a new chat and confirm that database-mcp appears in the available tools.

</details>

<br />

<details open> <summary><b>Windows</b></summary>

<br />

Run setup.bat from Command Prompt:

setup.bat

You can also double-click setup.bat from File Explorer.

Completely Restart Claude Desktop on Windows

Closing the Claude window may leave it running in the background. Fully stop it before reopening:

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Select the Processes tab.
  3. Find Claude under Apps or Background processes.
  4. Select each Claude process and click End task.
  5. Wait a few seconds, then reopen Claude Desktop.

If Claude does not appear under Processes, open the Details tab and end any Claude.exe processes.

</details>

<br />

3. Verify the Connection

In Claude Desktop:

  1. Open a new chat.
  2. Open the tools or integrations menu.
  3. Confirm that database-mcp is connected.
  4. Ask: What databases are available?

If the server is not listed, completely stop Claude Desktop again and reopen it.

<br />


🛠️ Manual Setup (Claude Code / Custom Agents)

If you prefer to configure things manually or use Claude Code in your terminal:

  1. Create Virtual Environment & Install Dependencies:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    cp .env.example .env
    
  2. Add to Claude Code:

    claude mcp add database-mcp .venv/bin/python src/server.py
    

🧪 Running Tests

Ensure everything is working correctly by running the comprehensive test suite:

pytest tests/ -v

🏗️ Architecture & Internals

graph TD
    A[🤖 Claude Desktop / AI Agents] <-->|stdio JSON-RPC| B{MCP Bridge Router}
    
    subgraph Database MCP Server
        B -->|tools/call: list_tables| C[📋 list_tables]
        B -->|tools/call: get_schema| D[🔍 get_schema]
        B -->|tools/call: explain_query| E[📊 explain_query]
        B -->|tools/call: run_select| F[▶️ run_select]
        
        F --> G{🛡️ Read-Only Safeties}
        G -. Block UPDATE/DROP/INSERT .-> H[❌ Reject]
        G -- Allow SELECT --> I[✅ Execute]
    end

    C & D & E & I --> J[(🗄️ SQLite Database)]
    
    style A fill:#4B32C3,stroke:#fff,stroke-width:2px,color:#fff
    style B fill:#2D3748,stroke:#4B32C3,stroke-width:2px,color:#fff
    style G fill:#9B2C2C,stroke:#FC8181,stroke-width:2px,color:#fff
    style J fill:#276749,stroke:#68D391,stroke-width:2px,color:#fff
    style H fill:#E53E3E,stroke:#fff,stroke-width:1px,color:#fff
    style C fill:#2A4365,stroke:#63B3ED,color:#fff
    style D fill:#2A4365,stroke:#63B3ED,color:#fff
    style E fill:#2A4365,stroke:#63B3ED,color:#fff
    style F fill:#2A4365,stroke:#63B3ED,color:#fff
    style I fill:#38A169,stroke:#fff,color:#fff

Curious how it works under the hood?

  • Read docs/structure.md for a detailed walkthrough of the file architecture and the JSON-RPC execution flow.
  • Read docs/ai_usage_note.md for notes on how AI was leveraged to build this project.

<div align="center"> <h2>Infinite Inovators</h2> <p><sub><samp>PROJECT TEAM</samp></sub></p> <p> <b>Buvaneswaran E</b>  |  <b>P Vishal Kanna</b>  |  <b>S.B. Jaisree</b> |  <b>Rithish R</b> </p> <sub>Built with care for controlled, agent-readable data access.</sub> </div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选