# mcpolyglot

> mcpolyglot is an open-source MCP server for databases. Turns existing Postgres, MySQL, SQLite, MongoDB or OpenAPI sources into guarded MCP. It is available on CLI, Self-hosted, API, Linux and macOS.

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

## About

Most teams that want an agent to read their data end up choosing between a vendor-locked server, an archived Postgres-only one, or a custom build that skips access controls. mcpolyglot sits in front of databases you already run and exposes them over the Model Context Protocol with the guardrails handled by the server itself rather than by asking the model to behave.

Every query is parsed and checked against a per-table and per-column policy before it reaches the database, and connections are read-only at the database level unless the policy explicitly grants writes. Sensitive values such as emails and credential-like strings are redacted, results are wrapped as untrusted data, and each call is written to an audit log that identifies the agent by its own token.

Setup is driven by a single config file and a CLI that introspects the schema, writes a read-only starting policy and checks it against the live database. It suits developers who want one consistent MCP surface across several databases or REST APIs, and who need per-agent access rules.

## Features

- **Policy-checked SQL:** Each statement is parsed and every table, column and function it touches is checked against the policy before execution.
- **Read-only by default:** Connections are opened read-only at the database level unless the policy grants write access to specific tables.
- **Result redaction:** Emails, tokens, AWS and GitHub keys, SSNs and card numbers are redacted from results, and denied columns are dropped.
- **Per-agent tokens:** Each agent gets its own hashed token with its own sources and scopes, and audit entries are tied to that identity.
- **Audit logging:** Every allowed or denied call produces a JSONL entry with decision, reason and latency, without raw arguments or rows.
- **Multiple connectors:** Supports Postgres, MySQL, SQLite, MongoDB and OpenAPI specs, exposed over stdio or Streamable HTTP.

## Good for

- Letting a support or analytics agent answer product questions from a production database without write access
- Giving a finance agent limited, row-capped write access to a transactions table
- Exposing a slice of a REST API described by an OpenAPI spec to an AI client
- Running one MCP endpoint for several databases used by the same team
- Hiding personal columns such as password hashes or national IDs from agents

## Tools

From the tool list in its README, going by the names, 1 of 11 tools changes data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `list_tables` (name suggests: reads): Lists tables in a SQL source.
- `describe_table` (name suggests: reads): Describes the columns of a SQL table.
- `query` (name suggests: reads): Runs a policy-checked read query against a SQL source.
- `execute` (name suggests: changes): Runs a write statement when the policy grants write access to a table.
- `list_collections` (name suggests: reads): Lists collections in a MongoDB source.
- `describe_collection` (name suggests: reads): Describes a MongoDB collection.
- `find` (name suggests: reads): Runs a find query against a MongoDB collection.
- `aggregate`: Runs an aggregation pipeline against a MongoDB collection.
- `list_operations` (name suggests: reads): Lists operations in an OpenAPI source.
- `describe_operation` (name suggests: reads): Describes an OpenAPI operation.
- `call`: Calls an operation from an OpenAPI spec.

## FAQ

### Which databases are supported?

PostgreSQL, MySQL, SQLite and MongoDB, plus REST APIs described by an OpenAPI 3 spec. The connectors are marked alpha.

### Can an agent write to my database?

Only if the policy grants write access to a table. Otherwise the connection itself is read-only, and writes are limited to one tool that runs in a transaction with a row limit.

### How is access controlled per agent?

Each agent has its own token, stored as a SHA-256 hash, and a policy that can only narrow the source's permissions. Tokens can be revoked, though revocation requires a server restart.

### What transports does mcpolyglot support?

Standard input/output for desktop clients such as Claude Desktop, Cursor and Claude Code, and Streamable HTTP with a bearer token, per-agent tokens or OAuth.

### Is mcpolyglot free?

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

### What are the best alternatives to mcpolyglot?

The closest alternatives to mcpolyglot are mcp-multi-db, Safedb MCP, postgres_mcp, db-mcp-server and MCP Postgres.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [mcp-multi-db](https://ai-powered.com/mcp/mcp-multi-db): mcp-multi-db is an open-source MCP server for databases.
- [Safedb MCP](https://ai-powered.com/mcp/safedb-mcp): Safedb MCP is an open-source MCP server for databases.
- [postgres_mcp](https://ai-powered.com/mcp/postgres-mcp-5): postgres_mcp is an open-source MCP server for databases.
- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.
- [MCP Postgres](https://ai-powered.com/mcp/mcp-postgres): MCP Postgres is an open-source MCP server for databases.
- [Postgres MCP](https://ai-powered.com/mcp/postgres-mcp): Postgres MCP is an open-source MCP server for databases.
- [Custom MCP Database](https://ai-powered.com/mcp/custom-mcp-database): Custom MCP Database is an open-source MCP server for databases.
- [datamcp — Hosted Model Context Protocol for Databases, APIs, and Agent Memory](https://ai-powered.com/mcp/datamcp-hosted-model-context-protocol-for-databases-apis-and): datamcp — Hosted Model Context Protocol for Databases, APIs, and Agent Memory is a freemium MCP server for databases.

---
Source: https://ai-powered.com/mcp/mcpolyglot-2
