Content
<p align="center">
<img src="resources/readme/datanexa.png" width="144" alt="DataNexa Logo">
</p>
<h1 align="center">DataNexa</h1>
<p align="center">
English | <a href="docs/README.en.md">English</a>
</p>
<p align="center">
Local Read-Only Database MCP Gateway for AI Agents
</p>
<p align="center">
<a href="https://github.com/MingoZacwu/DataNexa/actions/workflows/compile.yml"><img src="https://github.com/MingoZacwu/DataNexa/actions/workflows/compile.yml/badge.svg" alt="Build Status"></a>
<a href="https://github.com/MingoZacwu/DataNexa/releases"><img src="https://img.shields.io/github/v/release/MingoZacwu/DataNexa?display_name=tag" alt="Latest Release"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/MingoZacwu/DataNexa" alt="MIT License"></a>
</p>
DataNexa is a local database MCP server that provides a unified, controlled, and auditable data access entry for AI Agents. It applies read-only policies before executing queries and limits the number of returned rows, execution time, and connections.
The project currently supports SQLite, MySQL, and PostgreSQL, and is built on Tauri, React, and Rust for the desktop.
## Features
- Unified management of read-only connections for SQLite, MySQL, and PostgreSQL
- Provides MCP tools for table structure discovery, field description, data sampling, read-only SQL, and query planning
- Validates queries based on SQL syntax trees and restricts them to read-only statements
- Supports Bearer Token authentication and manual rotation
- Stores database passwords in the operating system's credential library, without writing them to regular configuration files
- Supports maximum returned rows, query timeout, and connection pool limits
- Maintains local audit records and can mask SQL literals
- Provides connection diagnostics, tool switching, emergency disabling, and connection import/export
- Supports Simplified Chinese, English, and light/dark themes
## Interface Preview
<img src="resources/readme/overview.jpg" alt="DataNexa Overview UI">
## Download and Installation
Pre-compiled versions can be downloaded from the [Releases](https://github.com/MingoZacwu/DataNexa/releases) page. Please select the corresponding installation package or executable file according to your operating system, and prioritize the latest stable version.
After the first run, complete the configuration in the following order:
1. Create a new database connection and use a read-only account on the database side.
2. Test the connection to ensure that the network, credentials, and permissions are correctly configured.
3. Start the local service on the "MCP Service" page.
4. Copy the Agent access configuration and add it to the MCP-enabled client.
## Building from Source
### Environment Requirements
- [Git](https://git-scm.com/)
- [Node.js 20](https://nodejs.org/) or higher
- [pnpm 9](https://pnpm.io/)
- [Rust stable](https://www.rust-lang.org/tools/install)
- System dependencies required by Tauri 2
The system dependencies vary by platform. For a complete description, see [Tauri Prerequisites](https://v2.tauri.app/start/prerequisites/):
- Windows: Microsoft C++ Build Tools, WebView2, and Rust MSVC toolchain
- macOS: Xcode Command Line Tools
- Ubuntu/Debian: `libwebkit2gtk-4.1-dev`, `libayatana-appindicator3-dev`, `librsvg2-dev`, `patchelf`, `xdg-utils`
### Get Source Code
```bash
git clone https://github.com/MingoZacwu/DataNexa.git
cd DataNexa
corepack enable
corepack prepare pnpm@9 --activate
pnpm install --frozen-lockfile
```
### Local Development
```bash
pnpm run dev:app
```
This command will start the Vite development server and run the application in a Tauri desktop window.
### Compile Executable File
```bash
pnpm run build:portable
```
The compilation result is located in `src-tauri/target/release/`. On Windows, it is usually `datanexa.exe`, and on macOS and Linux, it is the corresponding platform's `datanexa` executable.
### Build Installer
```bash
pnpm run build:installer
```
The installation package and platform-related products are located in:
```text
src-tauri/target/release/bundle/
```
If you only need to check the front-end types and build results, you can run:
```bash
pnpm run build
```
> DataNexa can only generate native applications for the current build platform. If you need Windows, macOS, and Linux versions, please build them separately on the corresponding systems.
## Security Instructions
"Read-only" is a risk-reducing measure, not equivalent to absolute security. Before accessing real data, it is recommended to implement the following measures:
- Create a minimum permission database account for DataNexa and revoke write and management permissions on the database side
- Set additional access control for sensitive tables, sensitive fields, and production networks
- Keep Bearer Token authentication enabled and do not leak the token to untrusted applications
- Regularly check audit records, only enable MCP tools necessary for the current task
- Backup the database and do not use DataNexa as the only security boundary
The connection export file contains plain text database passwords. After exporting, please save the file in an access-controlled location, complete the migration, and delete it promptly. Do not submit it to the code repository or upload it to public storage.
If you find a security issue, please do not disclose database information, access credentials, or directly exploitable details in the public issue. Instead, report it through the private contact information provided by the repository maintainer.
## Contributing
Welcome to submit issues and suggestions through [Issues](https://github.com/MingoZacwu/DataNexa/issues), and also welcome to submit Pull Requests. Before submitting code, please ensure that the front-end build, Rust format check, test, and Clippy check all pass:
```bash
pnpm run build
cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
cargo test --manifest-path src-tauri/Cargo.toml --locked
cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --locked -- -D warnings
```
When submitting issues or logs, please remove connection strings, database names, accounts, tokens, SQL literals, and business data.
## Disclaimer and Terms of Use
Data is priceless, use with caution.
Read-only policies cannot completely guarantee that all risks are intercepted. You still need to actively constrain the Agent to avoid requesting or allowing it to perform dangerous database operations.
DataNexa is an open-source project developed and maintained by an individual, and it has no affiliation or official cooperation with MySQL, PostgreSQL, SQLite, MCP clients, or their respective organizations.
This project is provided "as is," without any express or implied guarantees of suitability, reliability, security, or data integrity. The project authors and contributors assume no responsibility for any data loss, service interruption, security incidents, or other losses caused by or related to the use or inability to use this project. You should evaluate the risks yourself and be responsible for database permissions, backups, network isolation, and compliance requirements.
## License
This project is open-sourced under the [MIT License](LICENSE). You can use, copy, modify, merge, publish, and distribute this project within the scope allowed by the license, but you must retain the original copyright statement and license text.
## Copyright Information
Copyright (C) 2026 Zachary Wu
MySQL, PostgreSQL, SQLite, and other names and trademarks belong to their respective rights holders.
Connection Info
You Might Also Like
No recommendations available