lodestar-mcp 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,105 @@
1
- # Temporary Holding Version
1
+ # `lodestar-mcp`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official Model Context Protocol (MCP) server and zero-friction multi-client installer for **Lodestar Glass-Box Inference & System-One Probes** — supporting **Claude Code**, **Claude Desktop**, **OpenAI Codex CLI**, and **Gemini CLI**.
4
+
5
+ ## One-Command Setup (All Clients)
6
+
7
+ ```bash
8
+ npx -y lodestar-mcp setup
9
+ ```
10
+
11
+ `lodestar-mcp setup` automatically:
12
+ 1. Detects installed clients (`claude`, `codex`, `gemini`, and Claude Desktop).
13
+ 2. Writes each client's native MCP configuration without touching existing settings:
14
+ - **Claude Code**: Streamable HTTP in `~/.claude.json` (or `.mcp.json` with `--scope project`).
15
+ - **OpenAI Codex CLI**: Streamable HTTP in `~/.codex/config.toml` (or `.codex/config.toml`).
16
+ - **Gemini CLI**: Streamable HTTP (`httpUrl`) in `~/.gemini/settings.json` (or `.gemini/settings.json`).
17
+ - **Claude Desktop**: Local stdio via `npx -y lodestar-mcp` in `claude_desktop_config.json` (no `mcp-remote` needed).
18
+ 3. Verifies the live MCP handshake (`initialize` + `tools/list`) against `https://lodestar.so/mcp`.
19
+
20
+ ### Non-Interactive / CI Setup
21
+
22
+ ```bash
23
+ npx -y lodestar-mcp setup \
24
+ --client claude,codex,gemini,claude-desktop \
25
+ --api-key "$LODESTAR_API_KEY" \
26
+ --yes
27
+ ```
28
+
29
+ Pass `--use-env` to write `$LODESTAR_API_KEY` / `bearer_token_env_var = "LODESTAR_API_KEY"` references instead of embedding your key in config files.
30
+
31
+ ## Native Per-Client Commands
32
+
33
+ ### Claude Code
34
+
35
+ ```bash
36
+ claude mcp add --transport http --scope user lodestar https://lodestar.so/mcp \
37
+ --header "Authorization: Bearer $LODESTAR_API_KEY"
38
+ ```
39
+
40
+ ### OpenAI Codex CLI
41
+
42
+ ```bash
43
+ export LODESTAR_API_KEY="ld_live_..."
44
+ codex mcp add lodestar \
45
+ --url https://lodestar.so/mcp \
46
+ --bearer-token-env-var LODESTAR_API_KEY
47
+ ```
48
+
49
+ ### Gemini CLI
50
+
51
+ ```bash
52
+ gemini mcp add --scope user --transport http lodestar https://lodestar.so/mcp \
53
+ --header "Authorization: Bearer $LODESTAR_API_KEY"
54
+ ```
55
+
56
+ *(When editing `~/.gemini/settings.json` manually, always use `"httpUrl"` — Gemini CLI reserves `"url"` for legacy SSE.)*
57
+
58
+ ### Claude Desktop
59
+
60
+ ```bash
61
+ npx -y lodestar-mcp setup --client claude-desktop
62
+ ```
63
+
64
+ ## CLI Subcommands
65
+
66
+ | Command | Description |
67
+ | --- | --- |
68
+ | `lodestar-mcp` / `lodestar-mcp serve` | Start local stdio MCP server (proxies to `https://lodestar.so/mcp` by default; pass `--direct` to call `api.lodestar.so/v1` directly). |
69
+ | `lodestar-mcp setup` | Auto-detect and configure Claude Code, Codex CLI, Gemini CLI, and Claude Desktop. |
70
+ | `lodestar-mcp doctor` | Inspect client config status and run a live MCP connectivity check. |
71
+ | `lodestar-mcp print-config` | Print copy-paste CLI commands and JSON/TOML config snippets without writing files. |
72
+ | `lodestar-mcp uninstall` | Cleanly remove the `lodestar` MCP entry from selected clients. |
73
+
74
+ ## Exposed Tools, Resources & Prompts
75
+
76
+ ### Tools (15 on hosted `https://lodestar.so/mcp`)
77
+
78
+ - `lodestar_eval_probes` — Score prompts, messages, RAG context, or tool outputs at Token 0 (~20ms, \$0 output).
79
+ - `lodestar_chat` — Run Glass-Box chat completions with `probes`, `abort_if`, `on_abort` remediation, and surgical `patches`.
80
+ - `lodestar_teach_lesson` — Teach a workspace continual model a permanent rule from plain English, a `trace_id`, or a `bad_output -> good_output` diff (~2–5s).
81
+ - `lodestar_list_lessons` — List learned lessons, versions, trigger counts, delivery modes (`guard`, `episodic`, `hybrid`, `weight`), and consolidation status.
82
+ - `lodestar_revert_lesson` — Instantly roll back a continual model by `lesson_id` or `to_version`.
83
+ - `lodestar_list_probes` — List workspace built-in guards and custom probes.
84
+ - `lodestar_test_guard_stack` — Test a prompt against the workspace's full configured guard stack.
85
+ - `lodestar_update_guard` — Enable/disable or tune a built-in guard threshold (0.10–0.99).
86
+ - `lodestar_create_probe` — Train a custom 20 KB System-One probe in ~3s from 12+ positive and 12+ negative examples.
87
+ - `lodestar_export_probe` — Export a custom probe's portable JSON vector artifact.
88
+ - `lodestar_list_models` — List available models, pricing, guards, and patches.
89
+ - `lodestar_list_traces` — Query recent workspace traces by model, quality signal, search text, and time range.
90
+ - `lodestar_get_trace` — Inspect full telemetry for a single trace (probe scores, top neurons, EEG summary).
91
+ - `lodestar_get_usage` — View workspace credit balance, plan, rate limit, Token-0 aborts, and spend breakdown.
92
+ - `lodestar_list_recommendations` — View trace-derived neuron-patch / guardrail recommendations and active rollouts.
93
+
94
+ ### Resources & Prompts
95
+
96
+ - **Resources**: `lodestar://docs/quickstart`, `lodestar://docs/guards`, `lodestar://docs/patches`, `lodestar://workspace/guards`, `lodestar://workspace/usage`.
97
+ - **Prompts**: `integrate_lodestar`, `audit_traces`, `design_custom_probe`.
98
+
99
+ ## Direct / Self-Hosted Mode
100
+
101
+ To run a standalone stdio MCP server directly against `https://api.lodestar.so/v1` (or a self-hosted Lodestar gateway) without the hosted platform:
102
+
103
+ ```bash
104
+ LODESTAR_API_KEY="ld_live_..." LODESTAR_BASE_URL="https://api.lodestar.so/v1" npx -y lodestar-mcp serve --direct
105
+ ```
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,303 @@
1
+ #!/usr/bin/env node
2
+ import readline from "node:readline/promises";
3
+ import { stdin as input, stdout as output } from "node:process";
4
+ import { CLIENT_METADATA, DEFAULT_MCP_URL, applyClientSetup, buildCliCommand, buildCodexTomlBlock, buildJsonServerEntry, detectInstalledClients, getClientConfigPath, normalizeMcpUrl, parseClientList, removeClientSetup, verifyMcpEndpoint, } from "./clients.js";
5
+ import { startStdioServer } from "./stdio-server.js";
6
+ const VERSION = "0.1.0";
7
+ function printHelp() {
8
+ console.log(`lodestar-mcp v${VERSION} — Lodestar MCP server & multi-client setup CLI
9
+
10
+ Usage:
11
+ lodestar-mcp Start local stdio MCP server (for Claude Desktop / stdio clients)
12
+ lodestar-mcp serve [--direct] Start stdio MCP server (--direct talks to api.lodestar.so/v1)
13
+ lodestar-mcp setup [options] Configure Claude Code, OpenAI Codex, Gemini CLI & Claude Desktop
14
+ lodestar-mcp doctor [options] Check detected clients and test live MCP connectivity
15
+ lodestar-mcp print-config [options] Print copy-paste CLI commands & config snippets (no writes)
16
+ lodestar-mcp uninstall [options] Remove Lodestar MCP from selected clients
17
+
18
+ Setup options:
19
+ --client <list> Comma-separated: claude, codex, gemini, claude-desktop, or all
20
+ (defaults to auto-detected clients, or claude,codex,gemini if none detected)
21
+ --api-key <key> Lodestar API key (ld_live_...). Defaults to $LODESTAR_API_KEY
22
+ --url <url> MCP server URL (default: ${DEFAULT_MCP_URL})
23
+ --scope <scope> user (default) or project
24
+ --transport <mode> http (default for Claude Code/Codex/Gemini) or stdio
25
+ --use-env Reference $LODESTAR_API_KEY instead of writing the key into config files
26
+ --no-verify Skip live MCP initialize + tools/list verification
27
+ --dry-run Preview config changes without writing files
28
+ -y, --yes Non-interactive mode (accept defaults without prompting)
29
+
30
+ Examples:
31
+ npx -y lodestar-mcp setup
32
+ npx -y lodestar-mcp setup --client claude,codex,gemini --api-key ld_live_...
33
+ npx -y lodestar-mcp setup --client all --use-env
34
+ npx -y lodestar-mcp doctor
35
+ `);
36
+ }
37
+ function parseArgs(argv) {
38
+ const flags = {};
39
+ const positionals = [];
40
+ for (let i = 0; i < argv.length; i += 1) {
41
+ const arg = argv[i];
42
+ if (arg === "-h" || arg === "--help") {
43
+ flags.help = true;
44
+ continue;
45
+ }
46
+ if (arg === "-v" || arg === "--version") {
47
+ flags.version = true;
48
+ continue;
49
+ }
50
+ if (arg === "-y" || arg === "--yes") {
51
+ flags.yes = true;
52
+ continue;
53
+ }
54
+ if (arg.startsWith("--")) {
55
+ const eq = arg.indexOf("=");
56
+ if (eq !== -1) {
57
+ flags[arg.slice(2, eq)] = arg.slice(eq + 1);
58
+ }
59
+ else {
60
+ const key = arg.slice(2);
61
+ const next = argv[i + 1];
62
+ if (next &&
63
+ !next.startsWith("-") &&
64
+ ["client", "clients", "api-key", "url", "base-url", "scope", "transport"].includes(key)) {
65
+ flags[key] = next;
66
+ i += 1;
67
+ }
68
+ else {
69
+ flags[key] = true;
70
+ }
71
+ }
72
+ continue;
73
+ }
74
+ positionals.push(arg);
75
+ }
76
+ return {
77
+ command: positionals[0] || "",
78
+ flags,
79
+ };
80
+ }
81
+ function strFlag(flags, ...names) {
82
+ for (const name of names) {
83
+ const v = flags[name];
84
+ if (typeof v === "string" && v.trim())
85
+ return v.trim();
86
+ }
87
+ return undefined;
88
+ }
89
+ function boolFlag(flags, ...names) {
90
+ return names.some((n) => flags[n] === true);
91
+ }
92
+ async function promptForApiKey(rl) {
93
+ console.log("\nCreate or copy your API key at: https://lodestar.so/app/get-started");
94
+ const answer = await rl.question("Lodestar API key (ld_live_..., or leave empty to use $LODESTAR_API_KEY): ");
95
+ return answer.trim();
96
+ }
97
+ async function runSetup(flags) {
98
+ const scopeRaw = strFlag(flags, "scope") || "user";
99
+ if (scopeRaw !== "user" && scopeRaw !== "project") {
100
+ throw new Error(`Invalid --scope '${scopeRaw}'. Use 'user' or 'project'.`);
101
+ }
102
+ const scope = scopeRaw;
103
+ const transportRaw = strFlag(flags, "transport");
104
+ if (transportRaw && transportRaw !== "http" && transportRaw !== "stdio") {
105
+ throw new Error(`Invalid --transport '${transportRaw}'. Use 'http' or 'stdio'.`);
106
+ }
107
+ const transport = transportRaw;
108
+ const mcpUrl = normalizeMcpUrl(strFlag(flags, "url"));
109
+ const dryRun = boolFlag(flags, "dry-run");
110
+ const useEnvRef = boolFlag(flags, "use-env");
111
+ const noVerify = boolFlag(flags, "no-verify");
112
+ const nonInteractive = boolFlag(flags, "yes") || !process.stdin.isTTY;
113
+ const detected = detectInstalledClients({ scope });
114
+ let targets;
115
+ const clientArg = strFlag(flags, "client", "clients");
116
+ if (clientArg) {
117
+ targets = parseClientList(clientArg);
118
+ }
119
+ else {
120
+ const installed = detected.filter((d) => d.installed).map((d) => d.client);
121
+ targets = installed.length > 0 ? installed : ["claude", "codex", "gemini"];
122
+ }
123
+ let apiKey = strFlag(flags, "api-key") || process.env.LODESTAR_API_KEY?.trim() || "";
124
+ if (!nonInteractive) {
125
+ const rl = readline.createInterface({ input, output });
126
+ try {
127
+ console.log("\nLodestar MCP Setup");
128
+ console.log(`Endpoint: ${mcpUrl} (${scope} scope)`);
129
+ console.log("\nDetected clients:");
130
+ for (const d of detected) {
131
+ const mark = d.installed ? "✓" : "·";
132
+ const cfg = d.configured ? " [already configured]" : "";
133
+ console.log(` ${mark} ${d.label.padEnd(18)} ${d.reason}${cfg}`);
134
+ }
135
+ if (!clientArg) {
136
+ const defaultList = targets.join(",");
137
+ const picked = (await rl.question(`\nClients to configure (comma-separated: claude,codex,gemini,claude-desktop,all) [${defaultList}]: `)).trim();
138
+ if (picked) {
139
+ targets = parseClientList(picked);
140
+ }
141
+ }
142
+ if (!apiKey && !useEnvRef) {
143
+ apiKey = await promptForApiKey(rl);
144
+ }
145
+ }
146
+ finally {
147
+ rl.close();
148
+ }
149
+ }
150
+ const effectiveUseEnv = useEnvRef || !apiKey;
151
+ console.log(`\n${dryRun ? "[dry-run] " : ""}Configuring Lodestar MCP (${mcpUrl}) for: ${targets
152
+ .map((c) => CLIENT_METADATA[c].label)
153
+ .join(", ")}`);
154
+ for (const client of targets) {
155
+ const res = applyClientSetup(client, {
156
+ apiKey: apiKey || undefined,
157
+ mcpUrl,
158
+ scope,
159
+ transport,
160
+ useEnvRef: effectiveUseEnv,
161
+ dryRun,
162
+ });
163
+ const status = dryRun ? "would write" : res.changed ? "updated" : "already up to date";
164
+ console.log(`\n✓ ${res.label} (${res.transport}) — ${status}`);
165
+ console.log(` File: ${res.configPath}`);
166
+ if (dryRun) {
167
+ console.log(res.preview
168
+ .split("\n")
169
+ .map((l) => ` ${l}`)
170
+ .join("\n"));
171
+ }
172
+ if (res.note) {
173
+ console.log(` Note: ${res.note}`);
174
+ }
175
+ }
176
+ if (effectiveUseEnv) {
177
+ console.log('\nReminder: export LODESTAR_API_KEY="ld_live_..." in your shell profile (~/.zshrc or ~/.bashrc).');
178
+ }
179
+ if (!noVerify && !dryRun && apiKey) {
180
+ console.log(`\nVerifying live MCP connection to ${mcpUrl}...`);
181
+ const v = await verifyMcpEndpoint({ mcpUrl, apiKey });
182
+ if (v.ok) {
183
+ console.log(`✓ Connected to ${v.serverName || "lodestar"} v${v.serverVersion || "0.1.0"} (MCP ${v.protocolVersion}) — ${v.toolCount ?? 0} tools ready.`);
184
+ }
185
+ else {
186
+ console.log(`! Could not verify live connection (${v.error}). Config files were still saved.`);
187
+ }
188
+ }
189
+ console.log("\nDone! Restart or open your client and run `/mcp` to see Lodestar's tools.");
190
+ }
191
+ async function runDoctor(flags) {
192
+ const scope = strFlag(flags, "scope") || "user";
193
+ const mcpUrl = normalizeMcpUrl(strFlag(flags, "url"));
194
+ const apiKey = strFlag(flags, "api-key") || process.env.LODESTAR_API_KEY?.trim() || "";
195
+ console.log(`Lodestar MCP Doctor (${scope} scope)\n`);
196
+ const detected = detectInstalledClients({ scope });
197
+ for (const d of detected) {
198
+ const inst = d.installed ? "installed" : "not found";
199
+ const cfg = d.configured ? "configured" : "not configured";
200
+ console.log(` ${d.configured ? "✓" : "·"} ${d.label.padEnd(18)} ${inst.padEnd(11)} ${cfg.padEnd(15)} ${d.configPath}`);
201
+ }
202
+ console.log("");
203
+ if (!apiKey) {
204
+ console.log("Auth: LODESTAR_API_KEY not set in environment (pass --api-key ld_live_... to verify live connection).");
205
+ return;
206
+ }
207
+ const v = await verifyMcpEndpoint({ mcpUrl, apiKey });
208
+ if (v.ok) {
209
+ console.log(`Live check: ✓ ${mcpUrl} responded (${v.serverName || "lodestar"} v${v.serverVersion || "0.1.0"}, ${v.toolCount ?? 0} tools).`);
210
+ if (v.tools?.length) {
211
+ console.log(`Tools: ${v.tools.join(", ")}`);
212
+ }
213
+ }
214
+ else {
215
+ console.log(`Live check: ✗ ${mcpUrl} failed (${v.error}).`);
216
+ process.exitCode = 1;
217
+ }
218
+ }
219
+ function runPrintConfig(flags) {
220
+ const scope = strFlag(flags, "scope") || "user";
221
+ const transport = strFlag(flags, "transport");
222
+ const mcpUrl = normalizeMcpUrl(strFlag(flags, "url"));
223
+ const apiKey = strFlag(flags, "api-key");
224
+ const useEnvRef = boolFlag(flags, "use-env") || !apiKey;
225
+ const targets = parseClientList(strFlag(flags, "client", "clients") || "all");
226
+ for (const client of targets) {
227
+ const meta = CLIENT_METADATA[client];
228
+ const effectiveTransport = transport === "http" && !meta.supportsHttp ? "stdio" : (transport ?? meta.defaultTransport);
229
+ const configPath = getClientConfigPath(client, { scope });
230
+ const cmd = buildCliCommand(client, { mcpUrl, apiKey, scope, transport: effectiveTransport });
231
+ console.log(`=== ${meta.label} (${effectiveTransport}) ===`);
232
+ console.log(`CLI: ${cmd}`);
233
+ console.log(`Config: ${configPath}\n`);
234
+ if (client === "codex") {
235
+ console.log(buildCodexTomlBlock({ mcpUrl, transport: effectiveTransport, apiKey, useEnvRef }));
236
+ }
237
+ else {
238
+ const entry = buildJsonServerEntry(client, { mcpUrl, transport: effectiveTransport, apiKey, useEnvRef });
239
+ console.log(JSON.stringify({ mcpServers: { lodestar: entry } }, null, 2));
240
+ }
241
+ console.log("");
242
+ }
243
+ }
244
+ function runUninstall(flags) {
245
+ const scope = strFlag(flags, "scope") || "user";
246
+ const dryRun = boolFlag(flags, "dry-run");
247
+ const targets = parseClientList(strFlag(flags, "client", "clients") || "all");
248
+ for (const client of targets) {
249
+ const res = removeClientSetup(client, { scope, dryRun });
250
+ if (res.removed) {
251
+ console.log(`✓ ${res.label}: ${dryRun ? "would remove" : "removed"} lodestar from ${res.configPath}`);
252
+ }
253
+ else {
254
+ console.log(`· ${res.label}: not configured in ${res.configPath}`);
255
+ }
256
+ }
257
+ }
258
+ async function main() {
259
+ const { command, flags } = parseArgs(process.argv.slice(2));
260
+ if (flags.version) {
261
+ console.log(VERSION);
262
+ return;
263
+ }
264
+ if (flags.help || command === "help") {
265
+ printHelp();
266
+ return;
267
+ }
268
+ switch (command) {
269
+ case "":
270
+ case "serve":
271
+ await startStdioServer({
272
+ apiKey: strFlag(flags, "api-key"),
273
+ mcpUrl: strFlag(flags, "url"),
274
+ apiBaseUrl: strFlag(flags, "base-url"),
275
+ direct: boolFlag(flags, "direct"),
276
+ });
277
+ return;
278
+ case "setup":
279
+ case "init":
280
+ case "install":
281
+ await runSetup(flags);
282
+ return;
283
+ case "doctor":
284
+ case "status":
285
+ await runDoctor(flags);
286
+ return;
287
+ case "print-config":
288
+ case "config":
289
+ runPrintConfig(flags);
290
+ return;
291
+ case "uninstall":
292
+ case "remove":
293
+ runUninstall(flags);
294
+ return;
295
+ default:
296
+ console.error(`Unknown command '${command}'. Run 'lodestar-mcp --help' for usage.`);
297
+ process.exitCode = 1;
298
+ }
299
+ }
300
+ main().catch((err) => {
301
+ console.error(`[lodestar-mcp] ${err instanceof Error ? err.message : String(err)}`);
302
+ process.exit(1);
303
+ });
@@ -0,0 +1,113 @@
1
+ export declare const DEFAULT_MCP_URL = "https://lodestar.so/mcp";
2
+ export declare const DEFAULT_API_BASE_URL = "https://api.lodestar.so/v1";
3
+ export declare const SERVER_NAME = "lodestar";
4
+ export type ClientId = "claude" | "claude-desktop" | "codex" | "gemini";
5
+ export type Scope = "user" | "project";
6
+ export type TransportMode = "http" | "stdio";
7
+ export declare const ALL_CLIENTS: readonly ClientId[];
8
+ export interface ClientMetadata {
9
+ id: ClientId;
10
+ label: string;
11
+ defaultTransport: TransportMode;
12
+ supportsProjectScope: boolean;
13
+ supportsHttp: boolean;
14
+ }
15
+ export declare const CLIENT_METADATA: Record<ClientId, ClientMetadata>;
16
+ export interface SetupOptions {
17
+ apiKey?: string;
18
+ mcpUrl?: string;
19
+ scope?: Scope;
20
+ transport?: TransportMode;
21
+ useEnvRef?: boolean;
22
+ cwd?: string;
23
+ homeDir?: string;
24
+ platform?: NodeJS.Platform;
25
+ dryRun?: boolean;
26
+ }
27
+ export interface ClientApplyResult {
28
+ client: ClientId;
29
+ label: string;
30
+ transport: TransportMode;
31
+ configPath: string;
32
+ changed: boolean;
33
+ preview: string;
34
+ note?: string;
35
+ }
36
+ export interface DetectionResult {
37
+ client: ClientId;
38
+ label: string;
39
+ installed: boolean;
40
+ configured: boolean;
41
+ configPath: string;
42
+ reason: string;
43
+ }
44
+ export interface VerifyResult {
45
+ ok: boolean;
46
+ status: number;
47
+ url: string;
48
+ serverName?: string;
49
+ serverVersion?: string;
50
+ protocolVersion?: string;
51
+ toolCount?: number;
52
+ tools?: string[];
53
+ error?: string;
54
+ }
55
+ export declare function normalizeMcpUrl(raw?: string): string;
56
+ export declare function parseClientList(raw?: string): ClientId[];
57
+ export declare function getClientConfigPath(client: ClientId, opts?: {
58
+ scope?: Scope;
59
+ cwd?: string;
60
+ homeDir?: string;
61
+ platform?: NodeJS.Platform;
62
+ }): string;
63
+ export declare function detectInstalledClients(opts?: {
64
+ scope?: Scope;
65
+ cwd?: string;
66
+ homeDir?: string;
67
+ platform?: NodeJS.Platform;
68
+ }): DetectionResult[];
69
+ export declare function buildCodexTomlBlock(opts: {
70
+ mcpUrl: string;
71
+ transport: TransportMode;
72
+ apiKey?: string;
73
+ useEnvRef?: boolean;
74
+ }): string;
75
+ /**
76
+ * Surgically removes `[mcp_servers.lodestar]` and any `[mcp_servers.lodestar.*]` sub-tables
77
+ * from a TOML file while leaving every other section and comment intact.
78
+ */
79
+ export declare function removeCodexTomlSection(content: string): {
80
+ updated: string;
81
+ removed: boolean;
82
+ };
83
+ export declare function upsertCodexTomlSection(content: string, block: string): string;
84
+ export declare function buildJsonServerEntry(client: Exclude<ClientId, "codex">, opts: {
85
+ mcpUrl: string;
86
+ transport: TransportMode;
87
+ apiKey?: string;
88
+ useEnvRef?: boolean;
89
+ }): Record<string, unknown>;
90
+ export declare function buildCliCommand(client: ClientId, opts?: {
91
+ mcpUrl?: string;
92
+ apiKey?: string;
93
+ scope?: Scope;
94
+ transport?: TransportMode;
95
+ }): string;
96
+ export declare function applyClientSetup(client: ClientId, opts?: SetupOptions): ClientApplyResult;
97
+ export declare function removeClientSetup(client: ClientId, opts?: {
98
+ scope?: Scope;
99
+ cwd?: string;
100
+ homeDir?: string;
101
+ platform?: NodeJS.Platform;
102
+ dryRun?: boolean;
103
+ }): {
104
+ client: ClientId;
105
+ label: string;
106
+ configPath: string;
107
+ removed: boolean;
108
+ };
109
+ export declare function verifyMcpEndpoint(opts: {
110
+ mcpUrl?: string;
111
+ apiKey: string;
112
+ timeoutMs?: number;
113
+ }): Promise<VerifyResult>;