# SmartDB_MCP

> SmartDB_MCP is an open-source MCP server for databases. Open-source MCP gateway letting AI clients explore and query SQL, NoSQL, vector. It is available on CLI, API, Self-hosted, Linux, macOS and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted, Linux, macOS, Windows
- **Repository:** https://github.com/wenb1n-dev/smartdb_mcp
- **GitHub stars:** 78
- **License:** MIT
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

SmartDB runs as a single Model Context Protocol server that sits in front of several data systems at once. Each configured connection is typed, and the tools it exposes depend on what that kind of store supports, so a relational database gets SQL and schema tools while a Kafka cluster gets topic and consumer-lag tools.

Access is controlled per connection with readonly, writer and admin roles. For SQL databases the role limits which statement types may run, and for Redis, MongoDB, Milvus, Elasticsearch and Kafka a READ, WRITE, ADMIN and DANGEROUS category policy applies. Optional OAuth 2.0 can be turned on when serving over streamable HTTP, and the server also supports stdio and SSE transports.

It suits developers and data teams who want an assistant to inspect schemas, check health, or draft and optimise queries across mixed infrastructure without giving it unrestricted credentials.

## Features

- **Unified multi-database access:** Connects relational, key-value, document, vector, search and message-queue systems through one MCP endpoint.
- **Role-based permissions:** Readonly, writer and admin roles restrict which operations a connection may perform.
- **SQL optimisation and generation:** Offers query-plan-based optimisation advice and generates SQL for supported database types.
- **Health diagnostics:** Reports connection, memory, replication, lock and index status for each configured source.
- **Optional OAuth 2.0:** Protects the HTTP endpoint with bearer tokens when enabled in streamable HTTP mode.
- **Multiple transports and deployment options:** Runs over stdio, SSE or streamable HTTP, installable via pip or Docker.

## Good for

- Letting an AI assistant explore table structures and sample data in a production database under read-only access
- Diagnosing slow SQL by feeding execution plans and index details to an optimisation tool
- Checking Kafka consumer lag or Elasticsearch cluster health from within an MCP-enabled editor
- Running similarity searches against a Milvus collection from a chat client
- Querying several databases from one assistant session without sharing separate credentials for each

## FAQ

### Which data sources are supported?

MySQL, PostgreSQL, Oracle, SQL Server, Dameng, Redis, MongoDB, Milvus, Elasticsearch and Apache Kafka, with 26 MCP tools in total.

### How are permissions enforced?

Each connection has a role of readonly, writer or admin. For relational databases the role limits allowed SQL statement types; for other stores a category-based policy is applied.

### How do I install SmartDB_MCP?

It can be installed with pip as SmartDB-MCP and started with the smartdb command, or run with Docker Compose or from source using uv.

### Is authentication required?

OAuth 2.0 is optional and is enabled with a flag, currently only in streamable HTTP mode.

### Is SmartDB_MCP free?

Yes. SmartDB_MCP is open source, so you can use and self-host it for free.

### What are the best alternatives to SmartDB_MCP?

The closest alternatives to SmartDB_MCP are db-mcp-server, Db Access MCP, MCP DB Connect, mcp-multi-db and sql-query-mcp.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.
- [Db Access MCP](https://ai-powered.com/mcp/db-access-mcp): Db Access MCP is an open-source MCP server for databases.
- [MCP DB Connect](https://ai-powered.com/mcp/mcp-db-connect): MCP DB Connect is an open-source MCP server for databases.
- [mcp-multi-db](https://ai-powered.com/mcp/mcp-multi-db): mcp-multi-db is an open-source MCP server for databases.
- [sql-query-mcp](https://ai-powered.com/mcp/sql-query-mcp): sql-query-mcp is an open-source MCP server for databases.
- [db-mcp (SQLite MCP Server)](https://ai-powered.com/mcp/db-mcp-sqlite-mcp-server): db-mcp (SQLite MCP Server) is an open-source MCP server for databases.
- [MultiDB MCP](https://ai-powered.com/mcp/multidb-mcp): MultiDB MCP is an open-source MCP server for databases.
- [ArcadeDB MCP Server](https://ai-powered.com/mcp/arcadedb-mcp-server): ArcadeDB MCP Server is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/smartdb-mcp
