Defines Zod schemas for configuring MCP services and access control
// Source: https://github.com/rodaddy/mcp2cli | License: MIT | Copyright 2026 Rico Rojas
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";
/**
* Routing source for per-service remote/local control.
* - "local": always use local daemon (Mac-only services)
* - "remote": always route to remote daemon
* - "remote-local": try remote first, fall back to local if unreachable
* When omitted, defaults to "local" (no remote URL) or "remote-local" (remote URL set).
*/
export const SourceSchema = z
.enum(["local", "remote", "remote-local"])
.optional();
export type ServiceSource = z.infer<typeof SourceSchema>;
const SecretRefUrlSchema = z
.string()
.refine(
(value) =>
/^\$\{secret:[^}]+\}$/.test(value) ||
z.string().url().safePars
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key