import * as Config from 'effect/Config'; import * as Effect from 'effect/Effect'; import * as FileSystem from 'effect/FileSystem'; import * as Option from 'effect/Option'; import * as Path from 'effect/Path'; import * as Schema from 'effect/Schema'; import { McpConfigError } from '../Errors.js'; import { HttpMcpServer, SseMcpServer, StdioMcpServer, WsMcpServer } from './Schema.js'; declare const McpJsonFile_base: Schema.Class>; }>, {}>; /** * The full `.mcp.json` / `managed-mcp.json` file shape — a record of * named MCP server entries under `mcpServers`. * * @category Schemas * @since 0.1.0 */ export declare class McpJsonFile extends McpJsonFile_base { } export type McpJsonFileInput = ConstructorParameters[0]; declare const ClaudeJsonProject_base: Schema.Class>>; }>, {}>; /** * Per-project entry inside `~/.claude.json`. * * @category Schemas * @since 0.1.0 */ export declare class ClaudeJsonProject extends ClaudeJsonProject_base { } declare const ClaudeJsonFile_base: Schema.Class>>; readonly projects: Schema.optional>; }>, {}>; /** * Tolerant schema for the MCP-related portions of `~/.claude.json`. * * User-scope servers live at top-level `mcpServers`; local-scope * servers live under `projects[projectPath].mcpServers`. Other * Claude Code keys are intentionally ignored. * * @category Schemas * @since 0.1.0 */ export declare class ClaudeJsonFile extends ClaudeJsonFile_base { } export interface EffectiveMcpLoadOptions { /** Override the `~/.claude.json` path, mainly for tests. */ readonly claudeJsonPath?: string; /** Override the project `.mcp.json` path. */ readonly projectMcpPath?: string; /** Plugin-provided MCP configs, lowest precedence in normal loading. */ readonly pluginMcpConfigs?: ReadonlyArray; /** Override the managed MCP directory, mainly for tests. */ readonly managedMcpRoot?: string; /** Override all candidate managed MCP directories. */ readonly managedMcpRoots?: ReadonlyArray; } export interface ManagedMcpLoadOptions { /** Override the managed MCP directory, mainly for tests. */ readonly managedMcpRoot?: string; /** Override all candidate managed MCP directories. */ readonly managedMcpRoots?: ReadonlyArray; } /** * Resolve the canonical `~/.claude.json` path. * * @category Paths * @since 0.1.0 */ export declare const userClaudeJsonPath: Effect.Effect; /** * Resolve the project `.mcp.json` path for a cwd. * * @category Paths * @since 0.1.0 */ export declare const projectMcpJsonPath: (cwd: string) => Effect.Effect; /** * Resolve candidate system `managed-mcp.json` paths. * * @category Paths * @since 0.1.0 */ export declare const managedMcpJsonPaths: (options?: ManagedMcpLoadOptions) => Effect.Effect, never, Path.Path>; /** * Merge MCP config files in increasing precedence order. * * Later files replace earlier files by server name and also remove any * lower-precedence server with the same URL or stdio command/arguments. * Fields inside an individual server entry are never merged. * * @category Helpers * @since 0.1.0 */ export declare const mergeMcpJsonFiles: (files: ReadonlyArray) => McpJsonFile; /** * Convert an MCP config into the current Claude Code JSON shape. * * Deprecated legacy `authorization`, stdio `cwd`, and HTTP * `allowedEnvVars` fields are intentionally decode-only and omitted; * current Claude Code uses `oauth` for OAuth, plain `headers` / * `headersHelper` for bearer or API-key style authentication, and * `${VAR}` expansion syntax for environment placeholders. * * @category Serializers * @since 0.1.0 */ export declare const toClaudeCodeJson: (file: McpJsonFile) => Readonly<{ readonly mcpServers: Readonly>; }>; /** * Read a `.mcp.json` or `managed-mcp.json` file from disk. * * Missing files are errors for this strict loader; use `loadEffective` * or `loadManagedMcp` for optional discovery. A server named * `workspace` is skipped with a warning because Claude Code reserves * that name internally. * * @category Loaders * @since 0.1.0 */ export declare const loadJson: (path: string) => Effect.Effect; /** * Read a `~/.claude.json` file and decode the MCP-related sections. * * @category Loaders * @since 0.1.0 */ export declare const loadClaudeJson: (path: string) => Effect.Effect; /** * Discover and load the first system `managed-mcp.json` file that exists. * * Claude Code treats this file as exclusive enterprise control: when it * exists, user, project, local, and plugin MCP configs are suppressed. * * @category Loaders * @since 0.1.0 */ export declare const loadManagedMcp: (options?: ManagedMcpLoadOptions) => Effect.Effect, McpConfigError, FileSystem.FileSystem | Path.Path>; /** * Load the effective MCP config for a Claude Code project. * * Normal precedence is local (`~/.claude.json` project entry) > project * (`.mcp.json`) > user (`~/.claude.json` top-level) > plugins. Whole * server entries override lower scopes; fields are not merged. If a * system `managed-mcp.json` exists, it has exclusive control and the * returned config contains only managed servers. * * @category Loaders * @since 0.1.0 */ export declare const loadEffective: (cwd: string, options?: EffectiveMcpLoadOptions) => Effect.Effect; export {}; //# sourceMappingURL=JsonFile.d.ts.map