@mcpolyglot/config
v0.0.2
Published
Config schema and loader for mcpolyglot. Validates user config and resolves secrets via env / file / OS keychain refs.
Readme
@mcpolyglot/config
Config schema and loader for mcpolyglot. Validates user config with Zod and resolves secrets from env / file / OS keychain refs.
Define a config
import { defineConfig } from '@mcpolyglot/config';
export default defineConfig({
server: { name: 'mcpolyglot', version: '0.0.1' },
transport: { kind: 'stdio' },
sources: [
{
id: 'pg.main',
kind: 'postgres',
url: '${env:DATABASE_URL}',
scopes: ['schema:read', 'tables:read', 'query:raw'],
perEntityTools: { enabled: false },
limits: { rowCap: 200, timeoutMs: 10_000, maxBytes: 262144 },
redact: { columns: ['public.users.password_hash'], patterns: [] },
},
],
});Both .ts and .yaml configs are supported.
Secret refs
Literal credentials are rejected. You must use one of:
${env:NAME}— process environment.${file:./path}— file on disk (good for Docker secrets / mounted files).${keychain:item}— OS keychain via the optionalkeytardep.
Docs
- Full README → https://github.com/ishay60/mcpolyglot
- Schema source →
src/schema.ts
MIT licensed.
