@revealui/mcp 0.1.11 → 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.
Files changed (54) hide show
  1. package/LICENSE.commercial +90 -0
  2. package/README.md +5 -13
  3. package/dist/adapters/db.d.ts +16 -7
  4. package/dist/adapters/db.d.ts.map +1 -1
  5. package/dist/adapters/db.js +6 -24
  6. package/dist/adapters/db.js.map +1 -1
  7. package/dist/client.d.ts +307 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +492 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/hypervisor.d.ts +18 -0
  12. package/dist/hypervisor.d.ts.map +1 -1
  13. package/dist/hypervisor.js +83 -4
  14. package/dist/hypervisor.js.map +1 -1
  15. package/dist/index.d.ts +6 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +8 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/metering.d.ts +59 -0
  20. package/dist/metering.d.ts.map +1 -0
  21. package/dist/metering.js +25 -0
  22. package/dist/metering.js.map +1 -0
  23. package/dist/oauth.d.ts +171 -0
  24. package/dist/oauth.d.ts.map +1 -0
  25. package/dist/oauth.js +292 -0
  26. package/dist/oauth.js.map +1 -0
  27. package/dist/remote-client.d.ts +86 -0
  28. package/dist/remote-client.d.ts.map +1 -0
  29. package/dist/remote-client.js +130 -0
  30. package/dist/remote-client.js.map +1 -0
  31. package/dist/servers/adapter.d.ts.map +1 -1
  32. package/dist/servers/adapter.js +4 -0
  33. package/dist/servers/adapter.js.map +1 -1
  34. package/dist/servers/factories/revealui-content.d.ts +85 -0
  35. package/dist/servers/factories/revealui-content.d.ts.map +1 -0
  36. package/dist/servers/factories/revealui-content.js +471 -0
  37. package/dist/servers/factories/revealui-content.js.map +1 -0
  38. package/dist/servers/revealui-content.d.ts +12 -18
  39. package/dist/servers/revealui-content.d.ts.map +1 -1
  40. package/dist/servers/revealui-content.js +14 -220
  41. package/dist/servers/revealui-content.js.map +1 -1
  42. package/dist/servers/revealui-memory.d.ts +24 -0
  43. package/dist/servers/revealui-memory.d.ts.map +1 -0
  44. package/dist/servers/revealui-memory.js +339 -0
  45. package/dist/servers/revealui-memory.js.map +1 -0
  46. package/dist/streamable-http.d.ts +72 -0
  47. package/dist/streamable-http.d.ts.map +1 -0
  48. package/dist/streamable-http.js +120 -0
  49. package/dist/streamable-http.js.map +1 -0
  50. package/package.json +21 -8
  51. package/dist/stores/postgres-idempotency.d.ts +0 -32
  52. package/dist/stores/postgres-idempotency.d.ts.map +0 -1
  53. package/dist/stores/postgres-idempotency.js +0 -63
  54. package/dist/stores/postgres-idempotency.js.map +0 -1
@@ -0,0 +1,90 @@
1
+ RevealUI Studio — Commercial Licensing for Pro Packages
2
+
3
+ This file is an explainer for the dual-license structure of this repository.
4
+ It is NOT a standalone license document; the canonical license terms for
5
+ each Pro package live in that package's own LICENSE file.
6
+
7
+ ## Repository Licensing Overview
8
+
9
+ Most of this repository (the OSS packages, apps, scripts, docs, and tooling)
10
+ is licensed under the MIT License. See LICENSE in the repository root for
11
+ those terms.
12
+
13
+ A small number of "Pro" packages are licensed under the Functional Source
14
+ License v1.1 with MIT Future License (FSL-1.1-MIT) instead of MIT. Those
15
+ packages each carry their own LICENSE file containing the canonical FSL
16
+ terms; this file documents which packages are covered and what FSL-1.1-MIT
17
+ permits and restricts.
18
+
19
+ ## Pro Packages Covered
20
+
21
+ The following packages distributed in this repository are licensed under
22
+ FSL-1.1-MIT, not MIT:
23
+
24
+ - @revealui/ai (see packages/ai/LICENSE)
25
+ - @revealui/harnesses (see packages/harnesses/LICENSE)
26
+
27
+ Additional Pro packages may be added in future. The presence of a LICENSE
28
+ file inside a package directory containing the FSL-1.1-MIT text is the
29
+ authoritative signal that the package is governed by FSL terms rather than
30
+ the root MIT LICENSE.
31
+
32
+ ## What FSL-1.1-MIT Permits
33
+
34
+ Source code for Pro packages is publicly available. You may:
35
+
36
+ - Use the package internally for any purpose, including commercial use
37
+ - Modify the package and distribute derivative works under the same terms
38
+ - Inspect, audit, and debug the source
39
+ - Depend on the package from your own software
40
+
41
+ ## What FSL-1.1-MIT Restricts
42
+
43
+ You may NOT make the functionality of a Pro package available to third
44
+ parties as a service that competes with RevealUI Studio's commercial
45
+ offerings. The full restriction text in each per-package LICENSE controls;
46
+ in plain language, prohibited uses include:
47
+
48
+ - Hosting the package as part of a SaaS that primarily delivers the
49
+ package's functionality
50
+ - Offering a service whose value derives entirely or primarily from the
51
+ package
52
+ - Repackaging the functionality for redistribution as a competing service
53
+
54
+ If you are unsure whether your intended use is restricted, contact
55
+ founder@revealui.com before relying on the package.
56
+
57
+ ## Change Date and MIT Conversion
58
+
59
+ Each Pro package's LICENSE file specifies a Change Date. On the earlier of
60
+ that date or the fourth anniversary of the first publicly-available
61
+ distribution of a specific version of the package under FSL, the package
62
+ automatically converts to the MIT License (the "Change License"). After
63
+ conversion, all FSL restrictions are removed for the version in question
64
+ and going forward.
65
+
66
+ This means every Pro package in this repository will eventually become MIT;
67
+ FSL-1.1-MIT is a time-limited restriction, not a permanent one.
68
+
69
+ ## Commercial Licensing Alternatives
70
+
71
+ If FSL-1.1-MIT terms do not fit your use case (for example, you are
72
+ building a service that the FSL would prohibit, or you need contractual
73
+ guarantees beyond what an open license provides), commercial licensing is
74
+ available.
75
+
76
+ Contact: founder@revealui.com
77
+
78
+ ## Canonical FSL-1.1-MIT Text
79
+
80
+ The Functional Source License v1.1 with MIT Future License is published at:
81
+
82
+ https://fsl.software/FSL-1.1-MIT.template.md
83
+
84
+ The full canonical text is reproduced verbatim in each Pro package's
85
+ LICENSE file. If there is any conflict between this explainer and a
86
+ per-package LICENSE file, the per-package LICENSE file controls.
87
+
88
+ ---
89
+
90
+ Copyright (c) 2025-2026 RevealUI Studio
package/README.md CHANGED
@@ -11,7 +11,7 @@ Centralized MCP server infrastructure, configuration, and documentation for Reve
11
11
 
12
12
  This package contains everything MCP-related:
13
13
 
14
- - **10 MCP Servers** - Code validator, Vercel, Stripe, Neon, Supabase, Playwright, Next.js DevTools, RevealUI Content, RevealUI Email, RevealUI Stripe
14
+ - **12 MCP Servers** Code Validator, Neon, Next.js DevTools, Playwright, RevealUI Content, RevealUI Email, RevealUI Memory, RevealUI Stripe, Stripe, Supabase, Vercel, and an Email Provider helper. Ground-truth count is enforced by `pnpm validate:claims`.
15
15
  - **Configuration Templates** - For Claude Code / Claude Desktop
16
16
  - **Utilities** - Config management, database adapters
17
17
  - **Documentation** - Complete guides and per-server docs
@@ -55,14 +55,9 @@ tsx packages/mcp/src/servers/code-validator.ts
55
55
  ```
56
56
  packages/mcp/
57
57
  ├── src/
58
- │ ├── servers/ # 7 MCP server implementations
58
+ │ ├── servers/ # MCP server implementations (run `ls packages/mcp/src/servers/` for the current list)
59
59
  │ │ ├── code-validator.ts ← AI code standards enforcer
60
- │ │ ├── vercel.ts
61
- │ │ ├── stripe.ts
62
- │ │ ├── neon.ts
63
- │ │ ├── supabase.ts
64
- │ │ ├── playwright.ts
65
- │ │ └── next-devtools.ts
60
+ │ │ └── … ← Neon, Next.js DevTools, Playwright, RevealUI-*, Stripe, Supabase, Vercel
66
61
  │ ├── config/ # Configuration utilities
67
62
  │ │ ├── index.ts
68
63
  │ │ ├── config.json
@@ -78,9 +73,6 @@ packages/mcp/
78
73
  │ ├── SETUP.md # Setup instructions
79
74
  │ └── servers/ # Per-server documentation
80
75
  │ └── code-validator.md
81
- ├── migrations/ # Database migrations
82
- │ ├── 0001_add_crdt_columns.sql
83
- │ └── ...
84
76
  └── package.json
85
77
  ```
86
78
 
@@ -259,5 +251,5 @@ Commercial - see [LICENSE.commercial](../../LICENSE.commercial)
259
251
  ---
260
252
 
261
253
  **Status:** ✅ Consolidated and Active
262
- **Servers:** 7 available (1 active, 6 optional)
263
- **Last Updated:** 2026-03-04
254
+ **Servers:** 12 available (ground truth: `pnpm validate:claims` — source of truth is `packages/mcp/src/servers/`)
255
+ **Last Updated:** 2026-04-20
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * DB adapter for MCP.
3
- * - `connectPglite()` initializes ElectricSQL/pglite client with CRDT metadata.
4
- * - `connectPostgres()` creates a standard Postgres client with Electric metadata.
5
- * - `createMcpDbClient()` factory that selects adapter based on config.
3
+ * - `connectPglite()` returns a PGlite-backed client.
4
+ * - `connectPostgres()` returns a `pg.Pool`-backed client.
5
+ * - `createMcpDbClient()` selects adapter based on `persistenceDriver` config.
6
6
  *
7
- * Uses @revealui/contracts as the single source of truth for CRDT operation types.
7
+ * Schema is the caller's responsibility these factories do NOT bootstrap any
8
+ * tables. Apply drizzle-kit migrations (`pnpm --filter @revealui/db db:migrate`
9
+ * or the PGlite equivalent) before issuing queries.
8
10
  */
9
- import type { CrdtOperationsInsert, CrdtOperationsRow } from '@revealui/contracts';
11
+ import type { McpDocumentOperationsInsert, McpDocumentOperationsRow } from '@revealui/contracts';
10
12
  export interface QueryResult<T = Record<string, unknown>> {
11
13
  rows: T[];
12
14
  affectedRows?: number;
@@ -15,8 +17,15 @@ export type McpDbClient = {
15
17
  query: <T = Record<string, unknown>>(sql: string, params?: unknown[]) => Promise<QueryResult<T>>;
16
18
  close: () => Promise<void>;
17
19
  };
18
- /** Re-export contracts CRDT types for consumers */
19
- export type { CrdtOperationsInsert, CrdtOperationsRow };
20
+ /**
21
+ * Re-export the Drizzle-generated types for MCP's document-operations log so
22
+ * consumers of `@revealui/mcp` don't have to also import `@revealui/contracts`
23
+ * just to type a `mcp_document_operations` row. These types ARE the source of
24
+ * truth — they are generated from the Drizzle schema at
25
+ * `packages/db/src/schema/mcp-document-operations.ts` and will track any
26
+ * future column changes automatically.
27
+ */
28
+ export type { McpDocumentOperationsInsert, McpDocumentOperationsRow };
20
29
  /**
21
30
  * Connect to PGlite (embedded PostgreSQL) for local development/testing.
22
31
  * Uses dynamic import to avoid bundling @electric-sql/pglite when not needed.
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/adapters/db.ts"],"names":[],"mappings":"AAAA;;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,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,YAAY,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,CAAC;AAatE;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CA2CxF;AAED;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CA4C5D;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CAS9D;;;;;;AAED,wBAAqE"}
@@ -1,31 +1,17 @@
1
1
  /**
2
2
  * DB adapter for MCP.
3
- * - `connectPglite()` initializes ElectricSQL/pglite client with CRDT metadata.
4
- * - `connectPostgres()` creates a standard Postgres client with Electric metadata.
5
- * - `createMcpDbClient()` factory that selects adapter based on config.
3
+ * - `connectPglite()` returns a PGlite-backed client.
4
+ * - `connectPostgres()` returns a `pg.Pool`-backed client.
5
+ * - `createMcpDbClient()` selects adapter based on `persistenceDriver` config.
6
6
  *
7
- * Uses @revealui/contracts as the single source of truth for CRDT operation types.
7
+ * Schema is the caller's responsibility these factories do NOT bootstrap any
8
+ * tables. Apply drizzle-kit migrations (`pnpm --filter @revealui/db db:migrate`
9
+ * or the PGlite equivalent) before issuing queries.
8
10
  */
9
11
  import { mkdir } from 'node:fs/promises';
10
12
  import { dirname } from 'node:path';
11
13
  import getMcpConfig from '@revealui/config/mcp';
12
14
  import { getSSLConfig } from '@revealui/core/database/ssl-config';
13
- // CRDT operations table schema for conflict-free replication
14
- const CRDT_TABLE_SQL = `
15
- CREATE TABLE IF NOT EXISTS crdt_operations (
16
- id TEXT PRIMARY KEY,
17
- document_id TEXT NOT NULL,
18
- operation_type TEXT NOT NULL,
19
- payload JSONB NOT NULL,
20
- vector_clock JSONB NOT NULL,
21
- node_id TEXT NOT NULL,
22
- created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
23
- applied_at TIMESTAMPTZ
24
- );
25
- CREATE INDEX IF NOT EXISTS idx_crdt_ops_document ON crdt_operations(document_id);
26
- CREATE INDEX IF NOT EXISTS idx_crdt_ops_node ON crdt_operations(node_id);
27
- CREATE INDEX IF NOT EXISTS idx_crdt_ops_created ON crdt_operations(created_at DESC);
28
- `;
29
15
  /**
30
16
  * Connect to PGlite (embedded PostgreSQL) for local development/testing.
31
17
  * Uses dynamic import to avoid bundling @electric-sql/pglite when not needed.
@@ -55,8 +41,6 @@ export async function connectPglite(options) {
55
41
  }
56
42
  throw error;
57
43
  }
58
- // Create CRDT operations table
59
- await db.exec(CRDT_TABLE_SQL);
60
44
  return {
61
45
  async query(sql, params) {
62
46
  const result = await db.query(sql, params);
@@ -96,8 +80,6 @@ export async function connectPostgres() {
96
80
  finally {
97
81
  client.release();
98
82
  }
99
- // Create CRDT operations table
100
- await pool.query(CRDT_TABLE_SQL);
101
83
  return {
102
84
  async query(sql, params) {
103
85
  const result = await pool.query(sql, params);
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/adapters/db.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AA0BlE,6DAA6D;AAC7D,MAAM,cAAc,GAAG;;;;;;;;;;;;;;C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AAC;KACpC,CAAC,CAAC;IAEH,kBAAkB;IAClB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACL,KAAK,CAAC,KAAK,CACT,GAAW,EACX,MAAkB;YAElB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAC7C,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,IAAW;gBACxB,YAAY,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;aAC3C,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,KAAK;YACT,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAE3B,IAAI,GAAG,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;QACzC,OAAO,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED,0CAA0C;IAC1C,OAAO,aAAa,EAAE,CAAC;AACzB,CAAC;AAED,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,307 @@
1
+ /**
2
+ * MCP Client wrapper for `@revealui/mcp`.
3
+ *
4
+ * Phase: Stage 0 of the MCP v1 plan (see `.jv/docs/mcp-productionization-scope.md`).
5
+ *
6
+ * Wraps `@modelcontextprotocol/sdk`'s `Client` with a RevealUI-shaped surface:
7
+ * transport selection, capability enforcement (method throws a typed error if
8
+ * the server doesn't advertise the feature), per-URI resource subscription
9
+ * fan-out, and application-layer handlers for the server-initiated primitives
10
+ * (sampling, elicitation, roots).
11
+ *
12
+ * Stage 0 completion as of PR-0.3:
13
+ * PR-0.1 — resources + prompts.
14
+ * PR-0.2 — sampling + elicitation + roots + completions.
15
+ * PR-0.3 — logging, progress, cancellation, generic notification routing,
16
+ * per-request options (signal + onProgress + timeout) threaded
17
+ * through every client-initiated call.
18
+ *
19
+ * The hypervisor (`./hypervisor.ts`) continues to speak its custom JSON-RPC
20
+ * for tool calls. Stage 1 migrates the hypervisor to route through this
21
+ * client so transport abstraction (Streamable HTTP) lands cleanly.
22
+ */
23
+ import type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
24
+ import { type StreamableHTTPClientTransportOptions, type StreamableHTTPReconnectionOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
25
+ import type { AnyObjectSchema, SchemaOutput } from '@modelcontextprotocol/sdk/server/zod-compat.js';
26
+ import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
27
+ import { type CallToolResult, type ClientCapabilities, type CompleteRequest, type CompleteResult, type CreateMessageRequest, type CreateMessageResult, type ElicitRequest, type ElicitResult, type LoggingLevel, type LoggingMessageNotification, type Progress, type Prompt, type PromptMessage, type PromptReference, type Resource, type ResourceContents, type ResourceTemplateReference, type Root, type ServerCapabilities, type Tool } from '@modelcontextprotocol/sdk/types.js';
28
+ /**
29
+ * Spawn a local subprocess and talk MCP over its stdio.
30
+ * Matches `StdioClientTransport` from the SDK; we surface the fields we use.
31
+ */
32
+ export type StdioTransportOptions = {
33
+ kind: 'stdio';
34
+ command: string;
35
+ args?: string[];
36
+ env?: Record<string, string>;
37
+ cwd?: string;
38
+ };
39
+ /**
40
+ * Inject a pre-built SDK `Transport`. Intended for tests (`InMemoryTransport`)
41
+ * and for experimental transports not yet first-classed in this discriminator.
42
+ */
43
+ export type CustomTransportOptions = {
44
+ kind: 'custom';
45
+ transport: Transport;
46
+ };
47
+ /**
48
+ * Talk MCP over the spec's Streamable HTTP transport. The preferred remote
49
+ * transport as of the 2025 spec revision — supports request/response JSON,
50
+ * SSE streaming for progress/notifications, and OAuth 2.1 for authenticated
51
+ * deployments.
52
+ *
53
+ * Pass `authProvider` to enable OAuth 2.1 (Authorization Code + PKCE,
54
+ * Dynamic Client Registration, automatic refresh). `@revealui/mcp` ships
55
+ * `McpOAuthProvider` at `./oauth.js` — construct it with a
56
+ * `(tenant, server, vault)` triple and a redirect URL, and attach it here.
57
+ * If `authProvider` is omitted and the server requires auth, the SDK throws
58
+ * `UnauthorizedError` on connect. Callers who need static bearer-token auth
59
+ * instead can pass the header via `requestInit.headers`.
60
+ */
61
+ export type StreamableHttpTransportOptions = {
62
+ kind: 'streamable-http';
63
+ /** MCP endpoint URL (e.g. `https://example.com/mcp`). */
64
+ url: string | URL;
65
+ /** Fetch `RequestInit` applied to every outgoing request. Use this for
66
+ * headers, credentials, custom signals, etc. */
67
+ requestInit?: RequestInit;
68
+ /** Override `fetch`. Defaults to global `fetch`. */
69
+ fetch?: typeof fetch;
70
+ /** Reuse a server-issued session ID (e.g. for reconnection). */
71
+ sessionId?: string;
72
+ /** SSE reconnection tuning (delays, retry ceiling). */
73
+ reconnectionOptions?: StreamableHTTPReconnectionOptions;
74
+ /**
75
+ * OAuth 2.1 client provider. The SDK invokes discovery, DCR, PKCE, and
76
+ * refresh flows through this object, persisting state via the provider's
77
+ * storage methods. See `./oauth.js` for a revvault-backed implementation.
78
+ */
79
+ authProvider?: OAuthClientProvider;
80
+ };
81
+ export type TransportOptions = StdioTransportOptions | CustomTransportOptions | StreamableHttpTransportOptions;
82
+ export type { StreamableHTTPClientTransportOptions, StreamableHTTPReconnectionOptions };
83
+ /**
84
+ * Handle a `sampling/createMessage` request FROM the server. The server is
85
+ * asking the client to run an LLM completion on its behalf — typically the
86
+ * client delegates to the application's configured LLM provider.
87
+ *
88
+ * Providing this handler causes the client to advertise the `sampling`
89
+ * capability during initialize; omitting it leaves the capability absent and
90
+ * the server will treat sampling as unsupported.
91
+ */
92
+ export type SamplingHandler = (params: CreateMessageRequest['params']) => Promise<CreateMessageResult>;
93
+ /**
94
+ * Handle an `elicitation/create` request FROM the server. The server is
95
+ * asking the client to elicit structured input from the user (form mode) or
96
+ * direct them to a URL (URL mode). The handler is responsible for rendering
97
+ * UI and returning the user's response.
98
+ */
99
+ export type ElicitationHandler = (params: ElicitRequest['params']) => Promise<ElicitResult>;
100
+ /**
101
+ * Return the client's current roots (directories or URI namespaces it
102
+ * exposes to the server). Called each time the server issues `roots/list`,
103
+ * so the provider SHOULD return current state rather than a cached snapshot.
104
+ *
105
+ * Providing this advertises the `roots` capability (with `listChanged: true`
106
+ * — the client can notify via `notifyRootsListChanged()`).
107
+ */
108
+ export type RootsProvider = () => Root[] | Promise<Root[]>;
109
+ /**
110
+ * Per-request options applied to every client-initiated call. Mirrors the
111
+ * SDK's `RequestOptions` but exposes only the fields we expect consumers to
112
+ * use (we may add more as Stage 0 / 1 evolve).
113
+ *
114
+ * - `signal` — pass an `AbortSignal` to cancel the request mid-flight. When
115
+ * aborted the SDK emits `notifications/cancelled` to the server and the
116
+ * pending promise rejects with an AbortError.
117
+ * - `onProgress` — subscribe to per-request progress notifications. The SDK
118
+ * automatically correlates `notifications/progress` by the progress token
119
+ * and invokes this callback.
120
+ * - `timeout` — request-level timeout in ms. If exceeded the SDK raises a
121
+ * `RequestTimeout` error. Absent = SDK default.
122
+ * - `resetTimeoutOnProgress` — if true, receiving a progress notification
123
+ * resets the timeout clock. Useful for long-running operations.
124
+ */
125
+ export type McpRequestOptions = {
126
+ signal?: AbortSignal;
127
+ onProgress?: (progress: Progress) => void;
128
+ timeout?: number;
129
+ resetTimeoutOnProgress?: boolean;
130
+ };
131
+ export type McpClientOptions = {
132
+ /** Advertised to the server during `initialize`. Required by spec. */
133
+ clientInfo: {
134
+ name: string;
135
+ version: string;
136
+ };
137
+ /** Where and how to reach the server. */
138
+ transport: TransportOptions;
139
+ /** Handle `sampling/createMessage` requests from the server. */
140
+ samplingHandler?: SamplingHandler;
141
+ /** Handle `elicitation/create` requests from the server. */
142
+ elicitationHandler?: ElicitationHandler;
143
+ /** Provide the client's current roots in response to `roots/list`. */
144
+ rootsProvider?: RootsProvider;
145
+ };
146
+ /**
147
+ * Thrown when a caller invokes a method that requires a server-side capability
148
+ * the server did NOT advertise during initialize. Signals a misconfiguration
149
+ * or a version mismatch — not a transient failure; do not retry.
150
+ */
151
+ export declare class McpCapabilityError extends Error {
152
+ readonly capability: string;
153
+ constructor(capability: string);
154
+ }
155
+ /**
156
+ * Thrown when a method is called before `connect()` has resolved.
157
+ */
158
+ export declare class McpNotConnectedError extends Error {
159
+ constructor(method: string);
160
+ }
161
+ export type { CallToolResult, ClientCapabilities, CompleteRequest, CompleteResult, CreateMessageRequest, CreateMessageResult, ElicitRequest, ElicitResult, LoggingLevel, LoggingMessageNotification, Progress, Prompt, PromptMessage, PromptReference, Resource, ResourceContents, ResourceTemplateReference, Root, ServerCapabilities, Tool, };
162
+ /** Parameters delivered to a `subscribeResource` handler. */
163
+ export type ResourceUpdatedParams = {
164
+ uri: string;
165
+ };
166
+ /** Return shape of `getPrompt` — the spec's `GetPromptResult`, narrowed. */
167
+ export type GetPromptResult = {
168
+ description?: string;
169
+ messages: PromptMessage[];
170
+ };
171
+ /** Either a prompt or a resource-template reference — the two valid targets
172
+ * for `completions/complete`. */
173
+ export type CompletionReference = PromptReference | ResourceTemplateReference;
174
+ /** The completion result returned by `complete()`. */
175
+ export type Completion = CompleteResult['completion'];
176
+ /** Parameters delivered to an `onLog` subscriber. */
177
+ export type LogMessageParams = LoggingMessageNotification['params'];
178
+ export declare class McpClient {
179
+ private readonly sdk;
180
+ private readonly options;
181
+ private connected;
182
+ /**
183
+ * Tracks the Streamable HTTP transport when that kind is in use, so
184
+ * `finishAuth()` can delegate to it. Set by `createTransport`, cleared
185
+ * on `close()`.
186
+ */
187
+ private httpTransport?;
188
+ private readonly resourceSubscribers;
189
+ private readonly listChangedHandlers;
190
+ /**
191
+ * Subscribers per notification schema. First `on(schema, handler)` call for
192
+ * a schema registers a single fan-out handler with the SDK; subsequent
193
+ * calls just add to the Set. Removing the last subscriber keeps the SDK
194
+ * handler registered (no public API to unregister by schema) — empty
195
+ * fan-out is a cheap no-op.
196
+ */
197
+ private readonly notificationSubscribers;
198
+ constructor(options: McpClientOptions);
199
+ /**
200
+ * Connect the underlying transport and run MCP `initialize`. Idempotent:
201
+ * calling twice is a no-op on the second call.
202
+ */
203
+ connect(): Promise<void>;
204
+ /**
205
+ * Close the underlying transport and invalidate the client. Idempotent.
206
+ */
207
+ close(): Promise<void>;
208
+ /**
209
+ * Finalize an OAuth 2.1 authorization flow initiated by an `authProvider`.
210
+ *
211
+ * After `connect()` triggers `OAuthClientProvider.redirectToAuthorization`,
212
+ * the user completes consent at the authorization server and is redirected
213
+ * back to the caller's callback URL with a `code` query parameter. The
214
+ * caller passes that `code` here, which delegates to the Streamable HTTP
215
+ * transport's `finishAuth`: the SDK exchanges the code (with the stored
216
+ * PKCE verifier) at the token endpoint and persists the resulting token
217
+ * set via the provider's `saveTokens`. Retry `connect()` afterward.
218
+ *
219
+ * Throws if the client is not using the `streamable-http` transport or if
220
+ * `connect()` has not been called yet (the transport is constructed during
221
+ * `connect`).
222
+ */
223
+ finishAuth(authorizationCode: string): Promise<void>;
224
+ /** Server capabilities returned by `initialize`. Undefined before connect. */
225
+ getServerCapabilities(): ServerCapabilities | undefined;
226
+ listResources(options?: McpRequestOptions): Promise<Resource[]>;
227
+ readResource(uri: string, options?: McpRequestOptions): Promise<ResourceContents[]>;
228
+ /**
229
+ * Subscribe to updates for a single resource URI. The returned function
230
+ * removes this subscription (and unsubscribes on the wire once no
231
+ * subscribers remain for the URI).
232
+ *
233
+ * Requires the server to advertise `resources.subscribe`; throws
234
+ * `McpCapabilityError` otherwise.
235
+ */
236
+ subscribeResource(uri: string, handler: (params: ResourceUpdatedParams) => void, options?: McpRequestOptions): Promise<() => Promise<void>>;
237
+ /**
238
+ * Enumerate tools the server exposes. Requires the server to advertise the
239
+ * `tools` capability.
240
+ *
241
+ * Returns the SDK's `Tool` shape unchanged — name, description, input JSON
242
+ * Schema (as `inputSchema`), and any spec-defined annotations.
243
+ */
244
+ listTools(options?: McpRequestOptions): Promise<Tool[]>;
245
+ /**
246
+ * Invoke a tool by name with the supplied structured arguments. Requires
247
+ * the server to advertise `tools`. Returns the full SDK `CallToolResult`
248
+ * (structured content + isError flag + optional `_meta`).
249
+ *
250
+ * Tool failures surface as `{ isError: true, content: [...] }` rather than
251
+ * thrown exceptions — the server is explicitly asked to communicate tool
252
+ * errors in-band per the MCP spec. Transport-level failures still throw.
253
+ */
254
+ callTool(name: string, args?: Record<string, unknown>, options?: McpRequestOptions): Promise<CallToolResult>;
255
+ listPrompts(options?: McpRequestOptions): Promise<Prompt[]>;
256
+ getPrompt(name: string, args?: Record<string, string>, options?: McpRequestOptions): Promise<GetPromptResult>;
257
+ onResourcesListChanged(handler: () => void): () => void;
258
+ onPromptsListChanged(handler: () => void): () => void;
259
+ onToolsListChanged(handler: () => void): () => void;
260
+ /**
261
+ * Notify the server that the client's roots have changed. The server will
262
+ * typically re-fetch via `roots/list`, which routes to the `rootsProvider`
263
+ * passed at construction. No-op if the client wasn't constructed with a
264
+ * `rootsProvider` — advertising list-changed without a provider is
265
+ * nonsensical, so we fail fast.
266
+ */
267
+ notifyRootsListChanged(): Promise<void>;
268
+ /**
269
+ * Request argument completions from the server. The reference points at a
270
+ * prompt or resource-template; the server returns suggestion values for
271
+ * the named argument given the current partial value.
272
+ */
273
+ complete(reference: CompletionReference, argument: {
274
+ name: string;
275
+ value: string;
276
+ }, options?: McpRequestOptions): Promise<Completion>;
277
+ /**
278
+ * Set the minimum log level the server should emit. Requires the server to
279
+ * advertise the `logging` capability.
280
+ */
281
+ setLoggingLevel(level: LoggingLevel, options?: McpRequestOptions): Promise<void>;
282
+ /**
283
+ * Subscribe to server-emitted log messages. Returns an unregister function.
284
+ *
285
+ * Implemented on top of the generic `on()` fan-out, so multiple subscribers
286
+ * coexist cleanly (admin UI, CLI logger, telemetry exporter, …).
287
+ */
288
+ onLog(handler: (params: LogMessageParams) => void): () => void;
289
+ /**
290
+ * Subscribe to arbitrary server notifications by zod schema. First
291
+ * subscription per schema installs a single SDK handler that fans out to
292
+ * every registered subscriber; later subscriptions join the existing fan.
293
+ * Returns an unregister function.
294
+ *
295
+ * Typically callers use the purpose-built subscribers (`onLog`,
296
+ * `onResourcesListChanged`, `subscribeResource`) rather than this. Use
297
+ * `on()` for schemas the client doesn't yet expose a named subscriber for.
298
+ */
299
+ on<T extends AnyObjectSchema>(schema: T, handler: (notification: SchemaOutput<T>) => void): () => void;
300
+ ping(options?: McpRequestOptions): Promise<void>;
301
+ private createTransport;
302
+ private assertConnected;
303
+ private requireCapability;
304
+ private addListChanged;
305
+ private fireListChanged;
306
+ }
307
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAGpF,OAAO,EAEL,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACvC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAEpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAElB,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAE/B,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAE9B,KAAK,I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