import type { AgentsConfig, ResolvedMcpServer } from '../types.js'; /** * `.mcp.json` in the repository root is read by both Claude Code (project scope) * and Copilot CLI, and `.github/mcp.json` is Copilot CLI's second location. * Both are written here so the two integrations never overwrite each other. */ export interface ProjectMcpState { /** Server names agents wrote into the file, so they can be removed later. */ managedNames: string[]; /** File the state describes, so a path change cleans up the previous file. */ targetPath?: string; } /** Read the legacy single-file state shape, kept for configs written before 0.9.0. */ export declare function readProjectMcpState(statePath: string): Promise; export interface ProjectMcpTarget { /** Absolute path of the file to write. */ targetPath: string; /** Servers to write into it. */ servers: ResolvedMcpServer[]; /** Emit Copilot CLI's `tools` allowlist. */ withTools: boolean; } export interface ProjectMcpPlan { /** Files this run should own; empty when no integration writes a project MCP file. */ targets: ProjectMcpTarget[]; warnings: string[]; } /** * Decide what goes into the project MCP files for the current config. * * Claude Code contributes when its scope is `project`; Copilot CLI contributes when * it is enabled. They share the repository-root `.mcp.json` unless Copilot CLI is * pointed at `.github/mcp.json`, in which case each tool gets its own file. */ export declare function planProjectMcp(args: { config: AgentsConfig; claudeEnabled: boolean; copilotCliEnabled: boolean; claudeServers: ResolvedMcpServer[]; copilotServers: ResolvedMcpServer[]; paths: { copilotCliMcp: string; copilotCliGithubMcp: string; }; }): ProjectMcpPlan; /** * Read which servers agents wrote into each project MCP file. * * @returns A map of absolute file path to the server names agents owns in it. */ export declare function readProjectMcpManagedNames(statePath: string, projectRoot: string): Promise>; /** * Write the project MCP files for a plan, preserving servers and other top-level * keys that the file already had, and removing only the entries agents wrote before. */ export declare function syncProjectMcpFile(args: { plan: ProjectMcpPlan; statePath: string; generatedPath: string; projectRoot: string; check: boolean; changed: string[]; warnings: string[]; /** * Every server name the config defines, including disabled ones. Used as the managed * set when no state file exists yet, which is the case for projects upgrading from * 0.8.x, where this file was rewritten wholesale. */ knownServerNames?: string[]; }): Promise;