# FreePeak/db-mcp-server [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/FreePeak/db-mcp-server  
**GitHub Stars:** 487  
**Views:** 15  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/freepeak-db-mcp-server

## Description
A high-performance multi-database MCP server built with Golang, supporting MySQL & PostgreSQL (NoSQL coming soon). Includes built-in tools for query execution, transaction management, schema exploration, query building, and performance analysis, with seamless Cursor integration for enhanced database workflows.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/FreePeak/db-mcp-server), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
make build
```

2. Start the server:

```sh
./bin/server -t stdio -c /absolute/path/to/config.local.json
```

3. Start the server:

```sh
./bin/server -t sse -h 127.0.0.1 -p 9092 \
  -allow-insecure-sse -c /absolute/path/to/config.local.json
```

4. Install:

```sh
docker build -t db-mcp-server:local .
```

5. Start the server:

```sh
docker run --rm -p 127.0.0.1:9092:9092 \
  -p 127.0.0.1:9093:9093 \
  -v "$(pwd)/config.local.json:/app/config.json:ro" \
  db-mcp-server:local
```

6. Install:

```sh
git clone https://github.com/FreePeak/db-mcp-server.git
```

## Documentation

## What FreePeak/db-mcp-server does

FreePeak/db-mcp-server gives MCP-compatible AI assistants structured access to multiple databases through one server. A configuration can contain several connections, each with its own identifier and database type. Supported systems include MySQL, PostgreSQL, SQLite, Oracle, and TimescaleDB.

Each connection receives a separate set of generated tools. The tool names incorporate the connection ID, allowing an agent to distinguish operations such as `query_mysql1` and `query_postgres1` when working with more than one database.

The server covers common database workflows: running SQL queries, executing data-modifying statements, managing transactions, inspecting schemas, and analyzing query performance. It is implemented in Go and follows a layered architecture separating domain logic, repositories, use cases, and MCP delivery.

## How it works

Connections are declared with database-specific settings such as an ID, type, host, port, database name, username, and password. SQLite connections can use file-based or in-memory databases, with SQLCipher support. Oracle connections support service names, RAC, cloud wallets, and TNS configurations.

At startup, the server validates database connectivity and creates tools for each configured connection. Lazy loading can defer connection establishment until a database is first used, which is useful for configurations containing many databases. The safest local deployment uses STDIO. HTTP transports are still being hardened and should not be exposed directly to a shared network.

## Setup and configuration

Configure one or more database entries in the server configuration. A connection can include a `read_only` policy, `max_rows` result cap, `query_timeout`, masking rules, and PII masking. The `--lazy-loading` option enables deferred connections.

`read_only` blocks writes through both query and execute tools. PostgreSQL and MySQL also receive read-only engine settings, while SQLite opens in read-only mode. Oracle relies on the application classifier and database privileges. Query timeouts apply across queries, statements, transactions, explain operations, and schema inspection; the default is 30 seconds, and `-1` disables the timeout.

Set `QUERY_TIMEOUT_SECONDS` to provide a timeout for connections without an explicit JSON value. `DB_MCP_AUDIT_LOG` enables JSONL auditing for executed statements and rejected read-only attempts. Audit records include the operation, database, statement, duration, timestamp, and error when applicable.

## Tools and capabilities

Generated tools include:

- `query_<connection>` for SQL queries and result retrieval
- `execute_<connection>` for data-modifying statements
- `transaction_<connection>` for transaction operations
- `schema_<connection>` for schema exploration
- `performance_<connection>` for query-performance analysis

Result controls can cap returned rows and add a truncation notice. Masking rules can replace, null, or partially reveal values in columns matching configured regular expressions. Optional PII masking detects emails, phone numbers, credit-card numbers, SSNs, IP addresses, and long numeric identifiers by content shape, including values in free-text results.

## Limitations and notes

NoSQL support is planned rather than part of the listed database support. Oracle result limits are applied client-side, unlike the database-side limit optimization available for PostgreSQL, MySQL, and SQLite in applicable single-query cases. HTTP deployment should be treated cautiously; STDIO is the preferred local transport. Database users should still follow least-privilege practices even when server-side read-only protections are enabled.

_Full upstream README: https://allmcps.com/mcp/freepeak-db-mcp-server/readme_

