MCP Database Bridge
A secure, read-only MCP server that empowers Claude Desktop and AI agents to safely query and inspect local SQLite databases.
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, andALTER. 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_querycapabilities 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:
- Completely quit Claude Desktop.
- On macOS, press
Cmd + Q. - On Linux, quit Claude from the application menu.
- On macOS, press
- Reopen Claude Desktop.
- Open a new chat and confirm that
database-mcpappears 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:
- Press
Ctrl + Shift + Escto open Task Manager. - Select the Processes tab.
- Find Claude under Apps or Background processes.
- Select each Claude process and click End task.
- 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:
- Open a new chat.
- Open the tools or integrations menu.
- Confirm that
database-mcpis connected. - 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:
-
Create Virtual Environment & Install Dependencies:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt cp .env.example .env -
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>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.