Skip to content
MCP server

mcpolyglot

Turns existing Postgres, MySQL, SQLite, MongoDB or OpenAPI sources into guarded MCP

Actively maintained

The repository was last updated 18 days ago and is published under MIT.

mcpolyglot is an open-source MCP server for databases. It is available on CLI, Self-hosted, API, Linux and macOS.

Pricing
Open source
Platforms
CLI, Self-hosted, API
What it can do
Can change data (1 tool)
GitHub stars
1
Last commit
Language
TypeScript

Similar MCP servers

About mcpolyglot

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.

Tools this server provides (11)

Taken from the project documentation; the running server may differ.

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_tablesName suggests: reads
Lists tables in a SQL source.
describe_tableName suggests: reads
Describes the columns of a SQL table.
queryName suggests: reads
Runs a policy-checked read query against a SQL source.
executeName suggests: changes
Runs a write statement when the policy grants write access to a table.
list_collectionsName suggests: reads
Lists collections in a MongoDB source.
describe_collectionName suggests: reads
Describes a MongoDB collection.
findName suggests: reads
Runs a find query against a MongoDB collection.
aggregate
Runs an aggregation pipeline against a MongoDB collection.
list_operationsName suggests: reads
Lists operations in an OpenAPI source.
describe_operationName suggests: reads
Describes an OpenAPI operation.
call
Calls an operation from an OpenAPI spec.

What it does

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

Pricing

Open source

Free and MIT licensed; self-hosted.

mcpolyglot 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.

How AIPoweredBot checks servers