# mcpolyglot [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/ishay60/mcpolyglot  
**GitHub Stars:** 1  
**npm Downloads (last month):** 283  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcpolyglot

## Description
Policy-checked, audited agent access to Postgres, MySQL, SQLite, MongoDB and OpenAPI REST APIs.

## Claude Desktop Quick Installation
Install path inferred — verify against the README before running it. Uses `npx` (confidence: medium):

```json
"mcpServers": {
  "mcpolyglot": {
    "command": "npx",
    "args": ["-y","@mcpolyglot/cli","serve","--config","<config>"]
  }
}
```

## Documentation

## What mcpolyglot does

mcpolyglot turns configured database and OpenAPI sources into MCP servers that agents can use through a common interface. Supported database connectors include Postgres, MySQL, SQLite, and MongoDB. It also supports OpenAPI REST APIs, allowing one server configuration to cover heterogeneous sources.

Access is governed by a policy rather than by instructions sent to the model. Policies can expose selected tables for reading or writing, hide unlisted tables, deny specific columns, cap returned rows, limit statement duration, and restrict writes per call. A database connection is read-only unless the policy grants write access. The server also redacts sensitive values, removes denied columns, marks returned content as untrusted data, and records calls in an audit log.

## How it works

The server processes requests through a fixed core pipeline. It checks the agent's scope, applies rate limiting and timeouts, classifies the request against the policy, invokes the relevant connector, then applies redaction, result-size limits, untrusted-data wrapping, and auditing. Connectors cannot bypass these stages. A rejected request stops at the first failing stage and returns a tool error with a reason.

Policies can use `defaultAccess: 'none'` so newly added tables remain hidden until explicitly listed. The `doctor` command compares policy entries with the live schema and reports exposed tables, writable tables, hidden tables, and hidden columns. Requests such as DDL, `GRANT`, `SET`, multiple statements, unreadable SQL, and several server-access functions are always denied. Updates and deletes without a column-based `WHERE` clause are also blocked.

## Setup and configuration

Node.js 22 or newer is required. The CLI can create a configuration from a database URL or SQLite path:

```bash
npx @mcpolyglot/cli init ./app.db
npx @mcpolyglot/cli doctor
npx @mcpolyglot/cli serve
```

`init` introspects the schema and creates a read-oriented policy. It suggests denied columns for names associated with passwords, tokens, social security numbers, API keys, and hashes. Database credentials can be supplied through environment variables, files, or a keychain; inline passwords in database URLs are converted to environment-variable references in generated configuration.

The default serving mode uses stdio. HTTP mode is available with `serve --http`, and the Docker setup mounts configuration at `/config/mcpolyglot.config.json`. HTTP clients can authenticate with per-agent tokens. Claude Desktop can launch the CLI through its MCP configuration using `npx` and a config path.

## Tools and capabilities

The server provides an MCP `query` tool for database requests, including parameterized queries. Its client package can connect to a running HTTP endpoint and reports policy denials as `McpolyglotDeniedError` values with a code and reason. Separate agents can receive individual tokens, scopes, sources, and narrowed policies.

Auditing can write JSONL records to the console, a file, or a webhook. Policy examples cover read-only analytics, constrained transaction posting, and multiple agents sharing one server. The repository also includes connector examples for Postgres, MySQL, SQLite, MongoDB, OpenAPI, streamable HTTP, and Docker.

## Limitations and notes

The project is marked alpha. A policy denial prevents the request from reaching the database and is returned to the agent as a tool error. The parser-based `WHERE` protection is intended to catch omitted clauses, not determined attempts to evade controls; write limits and database constraints provide additional safeguards. A write policy can limit execution to one row per call, and excess writes can be rolled back according to the configured limit.

_Full upstream README: https://allmcps.com/mcp/mcpolyglot/readme_

