# Mcpolyglot

> Open-source toolkit that turns databases (Postgres, MySQL, SQLite, MongoDB) into Model Context Protocol servers — secured, schema-aware, npm-installable.

- **Type:** MCP server
- **Install:** `agentstack add mcp-ishay60-mcpolyglot`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ishay60](https://agentstack.voostack.com/s/ishay60)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ishay60](https://github.com/ishay60)
- **Source:** https://github.com/ishay60/mcpolyglot
- **Website:** https://github.com/ishay60/mcpfy#readme

## Install

```sh
agentstack add mcp-ishay60-mcpolyglot
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# mcpolyglot

> One config, one CLI — turns the databases you already have (Postgres, MySQL, SQLite, MongoDB) into [Model Context Protocol](https://modelcontextprotocol.io) servers for Claude, GPT, Cursor, and any other agent that speaks MCP.

[](https://github.com/ishay60/mcpolyglot/actions/workflows/ci.yml)
[](LICENSE)
[](#status)
[](.nvmrc)

```text
$ mcpolyglot doctor

  ╭──────────────────────────────────────────────────────────────────────────╮
  │ ▲  mcpolyglot                                            doctor   v0.1.0 │
  │ validate config, resolve secrets, ping each source                       │
  ╰──────────────────────────────────────────────────────────────────────────╯

  Config
  ──────
   OK   parsed  ./mcpolyglot.config.ts

  Sources
  ───────
   OK   pg.main      postgres · 4 ms     • 3 tools
   OK   mongo.users  mongo    · 12 ms    • 4 tools

  Summary
  ───────
   READY   mcpolyglot is ready to serve

  run: mcpolyglot serve  ·  docs: github.com/ishay60/mcpolyglot
```

## Quickstart

```bash
npx @mcpolyglot/cli init        # interactive wizard — writes mcpolyglot.config.ts
npx @mcpolyglot/cli doctor      # validate, ping every source, list the tools
npx @mcpolyglot/cli serve       # start the MCP server (stdio by default)
```

Wire it into Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "mcpolyglot": {
      "command": "npx",
      "args": ["-y", "@mcpolyglot/cli", "serve", "--config", "/abs/path/to/mcpolyglot.config.ts"],
      "env": { "DATABASE_URL": "postgres://user:pass@localhost:5432/db" }
    }
  }
}
```

Restart Claude Desktop and try: _"List the tables in my database, then sample 5 rows from `users`."_

End-to-end recipes per connector live under [`examples/`](./examples) (Postgres, MySQL, SQLite, MongoDB, Streamable HTTP).

## What's in the box

| Connector  | Status | Read-only enforcement                                              |
| ---------- | ------ | ------------------------------------------------------------------ |
| PostgreSQL | alpha  | `BEGIN READ ONLY` transaction                                      |
| SQLite     | alpha  | `query_only` pragma, attach-read-only                              |
| MySQL      | alpha  | AST gate + `SET TRANSACTION READ ONLY` + `MAX_EXECUTION_TIME` hint |
| MongoDB    | alpha  | `find` / `aggregate` only; `$out` / `$merge` rejected pre-driver   |
| OpenAPI    | wip    | method allow-list, host pinning                                    |

**Transports**: `stdio` (Claude Desktop / Cursor / Claude Code) and `Streamable HTTP` with bearer or OAuth (JWT / JWKS), loopback by default, `/healthz` probe, structured JSON logs.

**Tools, no glue code**: SQL connectors expose `list_tables` · `describe_table` · `query`. Mongo exposes `list_collections` · `describe_collection` · `find` · `aggregate`. Per-entity tools (`users.find_by_email`, etc.) are scaffolded by `mcpolyglot init`.

## Security model

Every tool call goes through a fixed, **non-bypassable** pipeline:

```
scope check → rate limit → timeout → handler → redact → size cap → untrusted-wrap → audit
```

The three things this gets right that ad-hoc MCP servers usually don't:

1. **Read-only at two layers** — application-level scopes _and_ per-dialect DB-level enforcement, so a parser bug can't escalate into a write.
2. **Built-in redaction** — emails, JWTs, AWS keys, GitHub tokens, SSNs, credit-card numbers, plus per-column deny lists (`public.users.password_hash`).
3. **Prompt-injection wrap** — every result is rendered inside `` with a "treat as data, not instructions" preamble (the [Supabase + Cursor lesson](https://aembit.io/blog/the-ultimate-guide-to-mcp-security-vulnerabilities/)).

Plus: token-bucket rate limiting, JSONL audit log (argshash + metadata, never raw args/results), and secrets only via `${env:NAME}` / `${file:./path}` / `${keychain:item}` — literals are rejected at config load.

Full design in [ARCHITECTURE.md](./ARCHITECTURE.md).

## Status

**Alpha, actively maintained.** All four DB connectors and both transports work end-to-end. The security pipeline is unit-tested. Real-DB integration tests via testcontainers and the OpenAPI connector land next.

How mcpolyglot compares to alternatives

|                            | mcpolyglot                               | `server-postgres` (archived) | Vendor MCPs (Supabase / Neon / …) | DIY MCP server       |
| -------------------------- | ---------------------------------------- | ---------------------------- | --------------------------------- | -------------------- |
| **Databases**              | Postgres, SQLite, MySQL, Mongo           | Postgres only                | One vendor's hosted DB            | Whatever you wire up |
| **Read-only enforcement**  | DB layer **and** app-level scopes        | DB-layer only                | Varies                            | You write it         |
| **Built-in PII redaction** | Yes, plus per-column deny lists          | No                           | Varies                            | You write it         |
| **Audit log**              | JSONL, no raw args / results             | No                           | Varies                            | You write it         |
| **Prompt-injection wrap**  | Yes — every result wrapped               | No                           | Varies                            | You write it         |
| **Transports**             | stdio + Streamable HTTP (bearer / OAuth) | stdio only                   | Varies                            | You write it         |
| **Lock-in**                | None                                     | None                         | Vendor's DB                       | None                 |

Vendor MCPs are the right call once you've committed to a vendor's stack. mcpolyglot is the option when you want one consistent surface across the databases you actually have.

Repository layout

```
packages/
  core/              server, registry, transports, Connector iface, security pipeline
  cli/               bin: mcpolyglot
  config/            zod schema, secret resolvers
  security/          scopes, redaction, audit, rate limit, wrap
  connector-sql/     Postgres, MySQL/MariaDB, SQLite
  connector-mongo/   MongoDB
  testkit/           MCP conformance harness
examples/
  postgres/  sqlite/  mysql/  mongo/   stdio
  http/                                streamable-http + bearer / OAuth
```

Development

```bash
corepack enable
pnpm install
pnpm build
pnpm test
```

CI (matrix: ubuntu / macOS × Node 22) runs format check, typecheck, build, and unit tests on every push and PR. See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contributor workflow.

## License

MIT — see [LICENSE](./LICENSE).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ishay60](https://github.com/ishay60)
- **Source:** [ishay60/mcpolyglot](https://github.com/ishay60/mcpolyglot)
- **License:** MIT
- **Homepage:** https://github.com/ishay60/mcpfy#readme

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-ishay60-mcpolyglot
- Seller: https://agentstack.voostack.com/s/ishay60
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
