mcpField
M
mcpolyglot

mcpolyglot

Local
github.com/ishay60Databases1Updated 2d ago

About mcpolyglot

mcpolyglot is an MCP server for agents that connects to Postgres, MySQL, SQLite, MongoDB, and OpenAPI REST APIs. Policies, audit identity, and per-agent tokens and scopes govern access to sources and tools.

Key features

  1. 01Connect to databases and REST APIs
  2. 02Restrict table access with policies
  3. 03Set per-agent tokens and scopes
  4. 04Check connectivity and exposed tools
  5. 05Serve over stdio or Streamable HTTP

Use cases

  1. 01Isolate database access by agent
  2. 02Limit readable tables and permitted operations
  3. 03Validate configuration, sources, and available tools

MCP support

It exposes tools to MCP clients according to configured sources, policies, and scopes. The server runs over stdio or Streamable HTTP with bearer authentication.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"ishay60-mcpolyglot": {
"command": "npx",
"args": [
"-y",
"@mcpolyglot/cli"
]
}
}
}
Run commandnpx -y @mcpolyglot/cli

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@mcpolyglot/cli0.4.3

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

@mcpolyglot/cli

The mcpolyglot command-line interface. Scaffolds a config, validates connectivity, lists tools, and serves the MCP server over stdio or Streamable HTTP.

npx @mcpolyglot/cli init       # interactive wizard
npx @mcpolyglot/cli doctor     # validate config, ping sources, list tools
npx @mcpolyglot/cli tools      # list tools mcpolyglot would expose
npx @mcpolyglot/cli serve      # start the MCP server (stdio)
npx @mcpolyglot/cli serve --http --port 7337   # start over Streamable HTTP

Commands

CommandPurpose
initInteractively scaffold an mcpolyglot.config.ts in the current directory.
doctorLoad + validate config, resolve secrets, ping each source, list tools.
toolsPrint every tool mcpolyglot would expose for the current config.
serveStart the server. --http flips to Streamable HTTP with bearer auth.
tokentoken create <agentId> mints a per-agent token; token hash hashes one.

serve --http prints the bearer token, MCP URL, and /healthz URL on stderr. Pin the token in your config (transport.auth.token) for stable deployments; omit it to mint a fresh token on each start.

Multiple agents over HTTP

Give each agent its own token, sources and scopes. Tokens are stored only as sha256 hashes:

mcpolyglot token create analyst       # prints the token once, its hash, and a config snippet
echo -n "$TOKEN" | mcpolyglot token hash
agents: [
  {
    id: 'analyst',
    tokens: [{ hash: '<sha256 hex>', label: '2026-09' }],
    scopes: ['schema:read', 'tables:read', 'query:raw'],
    sources: { 'pg.main': { policy: { tables: { users: 'none' } } } },
  },
],
  • An agent sees only tools of the sources listed under it, and only tools its scopes fully cover. scopes defaults to, and is capped at, the union of those sources' scopes.
  • A per-agent policy can only narrow the source's policy: per table the most restrictive access wins, deny lists are combined, and caps take the smaller value. An agent can't re-open a table the source hides or gain writes the source doesn't grant. The reverse also holds: a table the agent's policy doesn't list falls to its defaultAccess (at most read), so an agent that should keep a source's write access must list that table as write again. It gets its own connector, so its own DB connection; sources listed without a policy share the main one.
  • The token decides the audit agentId; the x-mcpolyglot-agent header is ignored when agents is set. Unknown or revoked tokens get 401.
  • Rotate: add the new hash, move the client over, set revoked: true on the old one (or delete it), restart serve. There is no hot reload.
  • agents needs bearer auth (not OAuth) and is ignored under stdio (single local user). doctor lists what each agent can and can't use.

Stdio servers must keep stdout clean, so all CLI output goes to stderr.

Docs

MIT licensed.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.