@frihet/mcp-server 1.16.6 → 2.0.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.
Files changed (108) hide show
  1. package/README.md +168 -82
  2. package/dist/agent-onboarding.d.ts +98 -0
  3. package/dist/agent-onboarding.js +275 -0
  4. package/dist/api-origin.d.ts +9 -0
  5. package/dist/api-origin.js +41 -0
  6. package/dist/canary/mcp-harness.d.ts +77 -0
  7. package/dist/canary/mcp-harness.js +552 -0
  8. package/dist/capability-truth.d.ts +29 -0
  9. package/dist/capability-truth.js +262 -0
  10. package/dist/claude-candidate-contract.d.ts +482 -0
  11. package/dist/claude-candidate-contract.js +87 -0
  12. package/dist/claude-output-privacy.d.ts +17 -0
  13. package/dist/claude-output-privacy.js +240 -0
  14. package/dist/claude-profile.d.ts +18 -0
  15. package/dist/claude-profile.js +260 -0
  16. package/dist/client-interface.d.ts +47 -33
  17. package/dist/client.d.ts +172 -40
  18. package/dist/client.js +708 -165
  19. package/dist/demo-client.d.ts +41 -32
  20. package/dist/demo-client.js +202 -31
  21. package/dist/demo-fixtures.d.ts +3 -3
  22. package/dist/demo-fixtures.js +7 -7
  23. package/dist/deposit-contract.d.ts +29 -0
  24. package/dist/deposit-contract.js +76 -0
  25. package/dist/fetch-no-redirect.d.ts +3 -0
  26. package/dist/fetch-no-redirect.js +16 -0
  27. package/dist/fiscal-aliases.d.ts +44 -0
  28. package/dist/fiscal-aliases.js +62 -0
  29. package/dist/fiscal-period.d.ts +26 -0
  30. package/dist/fiscal-period.js +31 -0
  31. package/dist/google-profile.d.ts +19 -0
  32. package/dist/google-profile.js +122 -0
  33. package/dist/index.js +68 -59
  34. package/dist/logger.d.ts +2 -2
  35. package/dist/logger.js +140 -8
  36. package/dist/muse-profile.d.ts +19 -0
  37. package/dist/muse-profile.js +122 -0
  38. package/dist/observability.d.ts +18 -29
  39. package/dist/observability.js +194 -106
  40. package/dist/openai-profile.d.ts +26 -22
  41. package/dist/openai-profile.js +1193 -157
  42. package/dist/openai-review-contract.d.ts +15 -6
  43. package/dist/openai-review-contract.js +714 -41
  44. package/dist/openai-review-oauth.d.ts +149 -2
  45. package/dist/openai-review-oauth.js +220 -6
  46. package/dist/prompts/register-all.d.ts +2 -0
  47. package/dist/prompts/register-all.js +34 -78
  48. package/dist/public-capability-contract.d.ts +39 -0
  49. package/dist/public-capability-contract.js +186 -0
  50. package/dist/redaction.d.ts +15 -0
  51. package/dist/redaction.js +83 -0
  52. package/dist/resources/register-all.js +154 -64
  53. package/dist/retry-after.d.ts +19 -0
  54. package/dist/retry-after.js +84 -0
  55. package/dist/server-composition.d.ts +19 -0
  56. package/dist/server-composition.js +74 -0
  57. package/dist/tool-exposure.d.ts +31 -27
  58. package/dist/tool-exposure.js +211 -87
  59. package/dist/tools/accountingClose.d.ts +14 -5
  60. package/dist/tools/accountingClose.js +41 -23
  61. package/dist/tools/audit_gl.js +8 -8
  62. package/dist/tools/backend-availability.d.ts +8 -29
  63. package/dist/tools/backend-availability.js +31 -30
  64. package/dist/tools/bank_rules.js +66 -15
  65. package/dist/tools/banking.js +5 -13
  66. package/dist/tools/clients.js +261 -15
  67. package/dist/tools/crm.js +22 -21
  68. package/dist/tools/deposits.js +114 -85
  69. package/dist/tools/einvoice.d.ts +16 -2
  70. package/dist/tools/einvoice.js +59 -12
  71. package/dist/tools/expenses.d.ts +16 -0
  72. package/dist/tools/expenses.js +47 -27
  73. package/dist/tools/fiscal.d.ts +3 -4
  74. package/dist/tools/fiscal.js +93 -60
  75. package/dist/tools/gestoria.js +15 -7
  76. package/dist/tools/hr.d.ts +2 -3
  77. package/dist/tools/hr.js +49 -20
  78. package/dist/tools/igic.d.ts +9 -8
  79. package/dist/tools/igic.js +34 -64
  80. package/dist/tools/impuesto_sociedades.d.ts +4 -5
  81. package/dist/tools/impuesto_sociedades.js +16 -37
  82. package/dist/tools/intelligence.js +166 -12
  83. package/dist/tools/invoices.js +224 -54
  84. package/dist/tools/kitchen.js +19 -9
  85. package/dist/tools/payroll.d.ts +5 -8
  86. package/dist/tools/payroll.js +19 -32
  87. package/dist/tools/permissions.d.ts +4 -7
  88. package/dist/tools/permissions.js +11 -14
  89. package/dist/tools/products.js +6 -6
  90. package/dist/tools/quotes.js +172 -26
  91. package/dist/tools/recurring.js +26 -25
  92. package/dist/tools/register-all.d.ts +2 -2
  93. package/dist/tools/register-all.js +9 -6
  94. package/dist/tools/search.d.ts +19 -0
  95. package/dist/tools/search.js +84 -0
  96. package/dist/tools/shared.d.ts +1445 -109
  97. package/dist/tools/shared.js +478 -102
  98. package/dist/tools/team.js +24 -28
  99. package/dist/tools/time.js +4 -12
  100. package/dist/tools/vendors.js +249 -15
  101. package/dist/tools/webhooks.js +35 -30
  102. package/dist/types.d.ts +31 -5
  103. package/dist/workflows/daily-operational-brief.d.ts +163 -0
  104. package/dist/workflows/daily-operational-brief.js +881 -0
  105. package/docs/agent-onboarding.json +391 -0
  106. package/package.json +49 -12
  107. package/dist/tools/onboarding.d.ts +0 -19
  108. package/dist/tools/onboarding.js +0 -64
@@ -0,0 +1,275 @@
1
+ /**
2
+ * Agent-native onboarding contract.
3
+ *
4
+ * Two artefacts, one source:
5
+ *
6
+ * 1. `AGENT_SERVER_INSTRUCTIONS` — the MCP `instructions` string returned by
7
+ * `initialize`. Every MCP client hands this to the model before the first
8
+ * tool call, so it is the only onboarding channel that costs the human
9
+ * zero configuration. It deliberately contains NO counts: a number in a
10
+ * per-session prompt is a number that drifts. It teaches the *mechanism*
11
+ * for finding the current numbers instead.
12
+ *
13
+ * 2. `captureAgentOnboardingDescriptor()` — the machine-readable descriptor
14
+ * written to `docs/agent-onboarding.json` by
15
+ * `scripts/generate-agent-onboarding.mjs`. It is captured through the real
16
+ * MCP SDK against the real registration path, so the tool lists in it
17
+ * cannot drift from the server: `npm run gate:agent-onboarding` re-captures
18
+ * and byte-compares.
19
+ *
20
+ * Nothing here registers a tool, a resource or a prompt. The surface counts the
21
+ * conformance baseline and the public capability contract already pin are
22
+ * unchanged by this module, on purpose.
23
+ */
24
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
25
+ import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
26
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
27
+ import { CAPABILITY_META_KEY } from "./capability-truth.js";
28
+ import { localMcpSurfaceComposition, registerMcpSurface, } from "./server-composition.js";
29
+ export const AGENT_ONBOARDING_CONTRACT_VERSION = 1;
30
+ /** Where an API key actually comes from — a deep link, not a navigation
31
+ * instruction, so the human has one click instead of a hunt.
32
+ *
33
+ * Verified against the ERP: `settingsSectionToPath` renders `/settings/<id>`
34
+ * and `api` is in `ALL_SETTINGS_SECTIONS`, so this URL resolves to the
35
+ * ApiKeysSettings panel. The old index.ts wording ("Settings > Developers >
36
+ * API Keys") pointed at a section that does not exist. */
37
+ export const API_KEY_LOCATION = "https://app.frihet.io/settings/api";
38
+ /* ------------------------------------------------------------------ */
39
+ /* 1. initialize.instructions */
40
+ /* ------------------------------------------------------------------ */
41
+ export const AGENT_SERVER_INSTRUCTIONS = `Frihet ERP — real business and fiscal records. Read freely, propose before you mutate.
42
+
43
+ AUTH
44
+ - Local (stdio): FRIHET_API_KEY=fri_... — create one at ${API_KEY_LOCATION}.
45
+ - No key yet: FRIHET_DEMO=1 serves example fixtures. No network call, nothing persisted, demo_-prefixed IDs, fiscal actions simulated.
46
+ - Hosted: https://mcp.frihet.io/mcp — OAuth 2.1 + PKCE, or Authorization: Bearer fri_...
47
+
48
+ ORIENT BEFORE ACTING (read-only)
49
+ - get_business_context — fiscal zone, currency, IRPF/IVA defaults, plan limits. Call this first; the correct tax treatment depends on it.
50
+ - Resources carry informational reference data with declared provenance: frihet://tax/rates and frihet://tax/calendar (Spanish statutory schedules and deadlines), frihet://config/expense-categories (LIRPF/LIVA deductibility guidelines), frihet://config/countries and currencies (defaults and ISO codes), frihet://api/schema (endpoint snapshot; canonical at https://api.frihet.io/v1/openapi.json). Read them instead of guessing, but treat as informational: writing tools and server endpoints enforce business and fiscal invariants server-side.
51
+
52
+ CAPABILITY DISCOVERY
53
+ - Every tool in tools/list carries _meta["${CAPABILITY_META_KEY}"] = {callability, writesFrihet, externalInteraction, externalSideEffects}. Read it before you call.
54
+ - callability is a conservative fact, not a promise: api_dependent | runtime_checked | deferred | unavailable | local. Registration does NOT mean the backing API is enabled for this workspace; deferred and unavailable tools will refuse.
55
+ - Large surface: set FRIHET_TOOL_MODE=grouped for progressive disclosure (list_tool_groups, search_tools, describe_tool) instead of loading every schema.
56
+
57
+ THE SAFE WORKFLOW — draft, show, stop
58
+ - create_invoice defaults to status=draft: no fiscal number, no hash, nothing submitted to a tax authority. create_quote and create_credit_note are drafts too.
59
+ - Build the draft, read it back, present it to the human, and stop there. Issuing is a separate, human-authorised step.
60
+
61
+ HUMAN AUTHORITY — do not call unprompted
62
+ - Any tool whose capability shows a non-empty externalSideEffects reaches outside Frihet — email to a client, webhook delivery, money movement, or a submission to AEAT / VeriFactu / TicketBAI / FACe. You cannot undo those.
63
+ - Several also take confirm=true. It is a local client/agent interlock, not server-verifiable human attestation and not actor/resource/payload/expiry-bound. Never set it to satisfy your own plan; ask, then pass what you were told.
64
+ - delete_invoice does not always delete: an issued invoice is CANCELLED (status=cancelled) because VeriFactu forbids breaking the hash chain. Same for quotes.
65
+
66
+ WHEN A CALL FAILS
67
+ - Errors carry sanitized remediation text — read it, do not guess. 401 = key; 403 = scope or plan; 429 = wait Retry-After seconds.
68
+ - After 409 IDEMPOTENCY_REQUEST_IN_PROGRESS, do NOT retry with a fresh Idempotency-Key. Read the resource back and decide from its actual state; a new key would create a second fiscal document.
69
+
70
+ Machine-readable version of this contract: https://github.com/Frihet-io/frihet-mcp/blob/main/docs/agent-onboarding.json`;
71
+ function makeRegistrationClient() {
72
+ return new Proxy({}, { get: () => async () => ({ data: [], total: 0, limit: 0, offset: 0 }) });
73
+ }
74
+ /** True when the tool's JSON Schema declares a top-level `confirm` property.
75
+ * Derived, never hand-listed — a new confirm guard shows up in the descriptor
76
+ * on the next generate, and the gate fails until it is committed. */
77
+ function declaresConfirm(inputSchema) {
78
+ if (typeof inputSchema !== "object" || inputSchema === null)
79
+ return false;
80
+ const properties = inputSchema.properties;
81
+ if (typeof properties !== "object" || properties === null)
82
+ return false;
83
+ return Object.hasOwn(properties, "confirm");
84
+ }
85
+ async function captureLocalFullSurface() {
86
+ const server = new McpServer({
87
+ name: "agent-onboarding-capture",
88
+ version: "1.0.0",
89
+ });
90
+ registerMcpSurface(server, makeRegistrationClient(), localMcpSurfaceComposition(false, false));
91
+ const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
92
+ const client = new Client({ name: "agent-onboarding-capture-client", version: "1.0.0" }, { capabilities: {} });
93
+ try {
94
+ await Promise.all([
95
+ server.connect(serverTransport),
96
+ client.connect(clientTransport),
97
+ ]);
98
+ const listed = await client.listTools();
99
+ const tools = listed.tools
100
+ .map((tool) => {
101
+ const meta = tool._meta;
102
+ const capability = meta?.[CAPABILITY_META_KEY];
103
+ return {
104
+ name: tool.name,
105
+ annotations: (tool.annotations ?? {}),
106
+ ...(capability ? { capability } : {}),
107
+ hasConfirm: declaresConfirm(tool.inputSchema),
108
+ };
109
+ })
110
+ .sort((left, right) => left.name.localeCompare(right.name));
111
+ const [resources, prompts] = await Promise.all([
112
+ client.listResources(),
113
+ client.listPrompts(),
114
+ ]);
115
+ return {
116
+ tools,
117
+ resources: resources.resources.length,
118
+ prompts: prompts.prompts.length,
119
+ };
120
+ }
121
+ finally {
122
+ await Promise.allSettled([client.close(), server.close()]);
123
+ }
124
+ }
125
+ export async function captureAgentOnboardingDescriptor() {
126
+ const { tools, resources, prompts } = await captureLocalFullSurface();
127
+ const confirmRequired = tools
128
+ .filter((tool) => tool.hasConfirm)
129
+ .map((tool) => tool.name);
130
+ const externalSideEffects = tools
131
+ .filter((tool) => (tool.capability?.externalSideEffects.length ?? 0) > 0)
132
+ .map((tool) => ({
133
+ tool: tool.name,
134
+ effects: [...(tool.capability?.externalSideEffects ?? [])],
135
+ }));
136
+ return {
137
+ onboardingContractVersion: AGENT_ONBOARDING_CONTRACT_VERSION,
138
+ server: {
139
+ mcpName: "io.frihet/erp",
140
+ npmPackage: "@frihet/mcp-server",
141
+ remoteEndpoint: "https://mcp.frihet.io/mcp",
142
+ transport: ["stdio", "streamable-http"],
143
+ },
144
+ auth: {
145
+ envVar: "FRIHET_API_KEY",
146
+ keyFormat: "fri_<key>",
147
+ obtainAt: API_KEY_LOCATION,
148
+ remoteMethods: ["oauth2.1-pkce", "bearer"],
149
+ noAuthTrial: {
150
+ env: { FRIHET_DEMO: "1" },
151
+ persists: false,
152
+ network: false,
153
+ },
154
+ },
155
+ quickstart: {
156
+ "claude-code": {
157
+ steps: [
158
+ "claude mcp add frihet -s user -e FRIHET_API_KEY=fri_... -- npx -y @frihet/mcp-server",
159
+ ],
160
+ configFormat: "managed by the CLI (user scope writes ~/.claude.json)",
161
+ verify: "claude mcp list",
162
+ },
163
+ codex: {
164
+ steps: [
165
+ "codex mcp add frihet --env FRIHET_API_KEY=fri_... -- npx -y @frihet/mcp-server",
166
+ ],
167
+ configFormat: "toml (~/.codex/config.toml — JSON in this file is a parse error)",
168
+ verify: "codex mcp list",
169
+ },
170
+ "generic-mcp-client-stdio": {
171
+ steps: [
172
+ 'mcpServers.frihet = { "command": "npx", "args": ["-y", "@frihet/mcp-server"], "env": { "FRIHET_API_KEY": "fri_..." } }',
173
+ ],
174
+ configFormat: "json",
175
+ verify: "initialize → tools/list returns a non-empty catalogue",
176
+ },
177
+ "generic-mcp-client-http": {
178
+ steps: [
179
+ 'mcpServers.frihet = { "type": "streamable-http", "url": "https://mcp.frihet.io/mcp", "headers": { "Authorization": "Bearer fri_..." } }',
180
+ ],
181
+ configFormat: "json",
182
+ verify: "initialize → tools/list returns a non-empty catalogue",
183
+ },
184
+ },
185
+ capabilityDiscovery: {
186
+ metaKey: CAPABILITY_META_KEY,
187
+ callabilityValues: [
188
+ "api_dependent",
189
+ "runtime_checked",
190
+ "deferred",
191
+ "unavailable",
192
+ "local",
193
+ ],
194
+ groupedModeEnv: { FRIHET_TOOL_MODE: "grouped" },
195
+ counts: {
196
+ toolNames: tools.length,
197
+ readOnly: tools.filter((tool) => tool.annotations.readOnlyHint === true)
198
+ .length,
199
+ writesFrihet: tools.filter((tool) => tool.capability?.writesFrihet === true).length,
200
+ externalInteraction: externalSideEffects.length,
201
+ destructive: tools.filter((tool) => tool.annotations.destructiveHint === true).length,
202
+ resources,
203
+ prompts,
204
+ },
205
+ },
206
+ safeWorkflow: {
207
+ description: "Discover → orient → retrieve → propose → hand back. No step mutates data or reaches a third party.",
208
+ steps: [
209
+ {
210
+ call: "get_business_context",
211
+ kind: "read",
212
+ note: "Fiscal zone, currency and defaults. Everything downstream depends on it.",
213
+ },
214
+ {
215
+ call: "resources/read frihet://tax/rates",
216
+ kind: "read",
217
+ note: "Spanish statutory IVA / IGIC / IPSI reference schedule. Do not recall a rate from memory; server validates transaction math.",
218
+ },
219
+ {
220
+ call: "list_clients",
221
+ kind: "read",
222
+ note: "Resolve the client by name before referencing an id.",
223
+ },
224
+ {
225
+ call: "STOP",
226
+ kind: "handoff",
227
+ note: "Present the proposed draft inputs and all disclosed effects. Creating, issuing, sending, or submitting is a separate human decision.",
228
+ },
229
+ ],
230
+ },
231
+ humanAuthority: {
232
+ rule: "Do not call a tool with non-empty externalSideEffects, and do not set confirm=true, without an explicit human instruction for that specific action.",
233
+ confirmRequired,
234
+ externalSideEffects,
235
+ },
236
+ errors: [
237
+ {
238
+ condition: "startup exits 1 with code FRIHET_API_KEY_MISSING",
239
+ meaning: "No credential in the environment.",
240
+ agentAction: "Ask the human for a key from " +
241
+ API_KEY_LOCATION +
242
+ ", or re-launch with FRIHET_DEMO=1 to explore without one.",
243
+ },
244
+ {
245
+ condition: "HTTP 401",
246
+ meaning: "Key missing, malformed or revoked.",
247
+ agentAction: "Stop and ask for a new key. Do not retry.",
248
+ },
249
+ {
250
+ condition: "HTTP 403",
251
+ meaning: "The key is valid but lacks the scope, or the plan excludes it.",
252
+ agentAction: "Report which operation was refused. Do not try a different tool to route around it.",
253
+ },
254
+ {
255
+ condition: "HTTP 429",
256
+ meaning: "Rate limited.",
257
+ agentAction: "Wait the Retry-After seconds, then retry once.",
258
+ },
259
+ {
260
+ condition: "HTTP 409 IDEMPOTENCY_REQUEST_IN_PROGRESS",
261
+ meaning: "The first attempt's outcome could not be recorded; the server refuses to execute twice.",
262
+ agentAction: "Read the resource back and reconcile from its actual state. Never retry with a fresh Idempotency-Key.",
263
+ },
264
+ {
265
+ condition: "capability.callability is deferred or unavailable",
266
+ meaning: "The tool is registered but the backing API is not serving it.",
267
+ agentAction: "Do not call it. Tell the human the capability is not live for this workspace.",
268
+ },
269
+ ],
270
+ };
271
+ }
272
+ export function serializeAgentOnboardingDescriptor(descriptor) {
273
+ return JSON.stringify(descriptor, null, 2) + "\n";
274
+ }
275
+ //# sourceMappingURL=agent-onboarding.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Validate the optional public API base URL accepted by the stdio entrypoint.
3
+ *
4
+ * The returned base is canonical and always ends in `/v1`. Validation happens
5
+ * before a FrihetClient is constructed, so an API key cannot be sent to an
6
+ * attacker-controlled origin through the public environment override.
7
+ */
8
+ export declare function normalizePublicApiBaseUrl(value: string): string;
9
+ //# sourceMappingURL=api-origin.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Validate the optional public API base URL accepted by the stdio entrypoint.
3
+ *
4
+ * The returned base is canonical and always ends in `/v1`. Validation happens
5
+ * before a FrihetClient is constructed, so an API key cannot be sent to an
6
+ * attacker-controlled origin through the public environment override.
7
+ */
8
+ export function normalizePublicApiBaseUrl(value) {
9
+ if (value !== value.trim()) {
10
+ throw new Error("FRIHET_API_URL must not contain surrounding whitespace");
11
+ }
12
+ let parsed;
13
+ try {
14
+ parsed = new URL(value);
15
+ }
16
+ catch {
17
+ throw new Error("FRIHET_API_URL must be a valid URL");
18
+ }
19
+ if (parsed.protocol !== "https:") {
20
+ throw new Error("FRIHET_API_URL must use https");
21
+ }
22
+ const hostname = parsed.hostname.toLowerCase();
23
+ if (hostname.split(".").some((label) => label.length === 0)
24
+ || !(hostname === "frihet.io" || hostname.endsWith(".frihet.io"))) {
25
+ throw new Error("FRIHET_API_URL hostname must be under frihet.io");
26
+ }
27
+ if (parsed.username || parsed.password) {
28
+ throw new Error("FRIHET_API_URL must not contain URL credentials");
29
+ }
30
+ if (parsed.port) {
31
+ throw new Error("FRIHET_API_URL must use the default HTTPS port");
32
+ }
33
+ if (parsed.search || parsed.hash) {
34
+ throw new Error("FRIHET_API_URL must not contain a query or fragment");
35
+ }
36
+ if (parsed.pathname !== "/" && parsed.pathname !== "/v1" && parsed.pathname !== "/v1/") {
37
+ throw new Error("FRIHET_API_URL path must be / or /v1");
38
+ }
39
+ return `https://${hostname}/v1`;
40
+ }
41
+ //# sourceMappingURL=api-origin.js.map
@@ -0,0 +1,77 @@
1
+ /**
2
+ * MCP SDK Compatibility & Golden Baseline Canary Harness.
3
+ *
4
+ * Deterministically verifies @frihet/mcp-server SDK v1 compatibility,
5
+ * golden contract, tool enumeration, JSON schema validity, pagination parameters,
6
+ * typed error contracts, capability metadata, and representative READ operations
7
+ * against @modelcontextprotocol/sdk v1.x before v2.0 migration.
8
+ *
9
+ * NOTE: This is an in-process SDK client/server compatibility harness.
10
+ * Model Context Protocol Inspector 2.3.0 is documented as a reference authority,
11
+ * while this harness executes in-process via @modelcontextprotocol/sdk v1.x client
12
+ * with zero daemons to provide deterministic CI verification.
13
+ *
14
+ * Zero production writes. Zero credential leaks.
15
+ */
16
+ export declare const HARNESS_CONTRACT_VERSION = 1;
17
+ export declare const INSPECTOR_PINNED_VERSION = "2.3.0";
18
+ export declare const CANONICAL_OPERATIONS_COUNT = 156;
19
+ export declare const FISCAL_ALIASES_COUNT: number;
20
+ export type CheckStatus = "PASS" | "FAIL" | "UNSUPPORTED" | "NOT_EXERCISED";
21
+ export type OverallStatus = "PASS" | "PASS_WITH_GAPS" | "FAIL";
22
+ export interface HarnessCheckResult {
23
+ id: string;
24
+ name: string;
25
+ category: "initialize" | "tools" | "resources" | "prompts" | "reads" | "pagination" | "errors" | "mutations" | "auth";
26
+ status: CheckStatus;
27
+ detail: string;
28
+ durationMs?: number;
29
+ }
30
+ export interface ToolSnapshot {
31
+ name: string;
32
+ title?: string;
33
+ description?: string;
34
+ inputSchema: Record<string, unknown>;
35
+ hasOutputSchema: boolean;
36
+ annotations: Record<string, unknown>;
37
+ capabilityMeta?: Record<string, unknown>;
38
+ }
39
+ export interface McpBaselineReport {
40
+ contractVersion: number;
41
+ inspectorPinnedVersion: string;
42
+ harnessMode: "in-process-sdk-client";
43
+ protocolVersion: string | null;
44
+ serverInfo: {
45
+ name: string;
46
+ version: string;
47
+ description?: string;
48
+ };
49
+ summary: {
50
+ totalTools: number;
51
+ canonicalOperations: number;
52
+ fiscalAliases: number;
53
+ resources: number;
54
+ prompts: number;
55
+ checks: {
56
+ total: number;
57
+ pass: number;
58
+ fail: number;
59
+ unsupported: number;
60
+ notExercised: number;
61
+ };
62
+ overallStatus: OverallStatus;
63
+ };
64
+ checkMatrix: HarnessCheckResult[];
65
+ tools: ToolSnapshot[];
66
+ resources: string[];
67
+ prompts: string[];
68
+ sanitized: boolean;
69
+ }
70
+ /**
71
+ * Executes the complete compatibility harness in-process and returns
72
+ * a structured, sanitized baseline report.
73
+ */
74
+ export declare function runMcpBaseline(): Promise<McpBaselineReport>;
75
+ export declare function serializeMcpBaseline(report: McpBaselineReport): string;
76
+ export declare function assertMcpBaseline(actual: McpBaselineReport, expected: McpBaselineReport): void;
77
+ //# sourceMappingURL=mcp-harness.d.ts.map