@mongodb-js/mcp-types 2.1.1 → 3.0.0-prerelease.3

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 (53) hide show
  1. package/dist/apiClient.d.ts +4 -14
  2. package/dist/apiClient.d.ts.map +1 -1
  3. package/dist/config.d.ts +20 -0
  4. package/dist/config.d.ts.map +1 -0
  5. package/dist/config.js +2 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/connection.d.ts +46 -0
  8. package/dist/connection.d.ts.map +1 -0
  9. package/dist/connection.js +2 -0
  10. package/dist/connection.js.map +1 -0
  11. package/dist/elicitation.d.ts +79 -5
  12. package/dist/elicitation.d.ts.map +1 -1
  13. package/dist/index.d.ts +8 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/keychain.d.ts +20 -6
  18. package/dist/keychain.d.ts.map +1 -1
  19. package/dist/logging.d.ts +21 -13
  20. package/dist/logging.d.ts.map +1 -1
  21. package/dist/metrics.d.ts +48 -4
  22. package/dist/metrics.d.ts.map +1 -1
  23. package/dist/resources.d.ts +70 -0
  24. package/dist/resources.d.ts.map +1 -1
  25. package/dist/schemas.d.ts +2 -0
  26. package/dist/schemas.d.ts.map +1 -0
  27. package/dist/schemas.js +2 -0
  28. package/dist/schemas.js.map +1 -0
  29. package/dist/server.d.ts +23 -0
  30. package/dist/server.d.ts.map +1 -0
  31. package/dist/server.js +2 -0
  32. package/dist/server.js.map +1 -0
  33. package/dist/sessionStore.d.ts +43 -10
  34. package/dist/sessionStore.d.ts.map +1 -1
  35. package/dist/telemetry.d.ts +73 -0
  36. package/dist/telemetry.d.ts.map +1 -1
  37. package/dist/telemetry.js +6 -1
  38. package/dist/telemetry.js.map +1 -1
  39. package/dist/tool.d.ts +161 -4
  40. package/dist/tool.d.ts.map +1 -1
  41. package/dist/transport.d.ts +37 -1
  42. package/dist/transport.d.ts.map +1 -1
  43. package/dist/transports.d.ts +38 -0
  44. package/dist/transports.d.ts.map +1 -0
  45. package/dist/transports.js +2 -0
  46. package/dist/transports.js.map +1 -0
  47. package/dist/ui.d.ts +26 -2
  48. package/dist/ui.d.ts.map +1 -1
  49. package/package.json +9 -6
  50. package/dist/session.d.ts +0 -30
  51. package/dist/session.d.ts.map +0 -1
  52. package/dist/session.js +0 -2
  53. package/dist/session.js.map +0 -1
@@ -1,20 +1,10 @@
1
- export interface IApiClient<TEvent extends unknown[] = unknown[]> {
1
+ import type { TelemetryCommonProperties, TelemetryEvent } from "./telemetry.js";
2
+ export interface IApiClient<TEvent extends unknown[] = TelemetryEvent<TelemetryCommonProperties>[]> {
2
3
  isAuthConfigured(): boolean;
3
4
  close(): Promise<void>;
4
- sendEvents(options?: {
5
+ validateAuthConfig(): Promise<void>;
6
+ sendEvents(events: TEvent, options?: {
5
7
  signal?: AbortSignal;
6
- events: TEvent;
7
8
  }): Promise<void>;
8
9
  }
9
- export type ApiClientOptions = {
10
- baseUrl: string;
11
- userAgent?: string;
12
- credentials?: {
13
- clientId: string;
14
- clientSecret: string;
15
- };
16
- requestContext?: {
17
- headers?: Record<string, string | string[] | undefined>;
18
- };
19
- };
20
10
  //# sourceMappingURL=apiClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../src/apiClient.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE;IAC5D,gBAAgB,IAAI,OAAO,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,UAAU,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,cAAc,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;KAC3D,CAAC;CACL,CAAC"}
1
+ {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../src/apiClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhF,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,OAAO,EAAE,GAAG,cAAc,CAAC,yBAAyB,CAAC,EAAE;IAC9F,gBAAgB,IAAI,OAAO,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF"}
@@ -0,0 +1,20 @@
1
+ import type { PreviewFeature } from "./schemas.js";
2
+ export type TransportType = "stdio" | "http";
3
+ export interface IToolConfig {
4
+ transport: TransportType;
5
+ httpBodyLimit?: number;
6
+ httpResponseType: "sse" | "json";
7
+ readOnly: boolean;
8
+ disabledTools: string[];
9
+ confirmationRequiredTools: string[];
10
+ previewFeatures: PreviewFeature[];
11
+ }
12
+ /** Server metadata for the server. */
13
+ export type ServerMetadata = {
14
+ version: string;
15
+ mcpServerName: string;
16
+ engines?: {
17
+ node: string;
18
+ };
19
+ };
20
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,aAAa,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,yBAAyB,EAAE,MAAM,EAAE,CAAC;IACpC,eAAe,EAAE,cAAc,EAAE,CAAC;CACrC;AAED,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Atlas cluster connection info containing details about the connected Atlas cluster.
3
+ * When provided, indicates the connection is to an Atlas cluster.
4
+ *
5
+ * The cluster's projectId, name and id are required. A host that establishes the
6
+ * connection without minting a temporary database user — via its own credential
7
+ * issuance, X.509, a pre-provisioned user, a proxy — still knows which cluster it
8
+ * connected to and needs to be able to specify it: this field is what marks a
9
+ * connection as pointing at Atlas, and leaving it unset prevents cluster
10
+ * attribution on tool telemetry, the `atlas` host type, and the ability of
11
+ * `pause-resume-cluster` to find connections to the cluster it just paused.
12
+ * Hosts that only know the cluster name should resolve the id through the Atlas
13
+ * API before connecting.
14
+ */
15
+ export type AtlasClusterConnectionInfo = {
16
+ /** Which Atlas cluster this connection points at. */
17
+ projectId: string;
18
+ clusterName: string;
19
+ clusterId: string;
20
+ /**
21
+ * The temporary database user backing the connection. Set only by
22
+ * `connect-cluster`, which also schedules its deletion; absent when the
23
+ * host supplied its own credentials.
24
+ */
25
+ username?: string;
26
+ /** The cluster's tier, set when the host resolved it. */
27
+ instanceType?: "FREE" | "FLEX" | "DEDICATED";
28
+ };
29
+ /**
30
+ * Connection string info describing the auth and host type of a MongoDB connection.
31
+ */
32
+ export type ConnectionStringInfo = {
33
+ authType: "scram" | "ldap" | "kerberos" | "oidc-auth-flow" | "oidc-device-flow" | "x.509" | "unknown";
34
+ hostType: "unknown" | "atlas" | "local" | "atlas_local" | "other";
35
+ };
36
+ /**
37
+ * Structural subset of a MongoDB connection's state used by tool telemetry
38
+ * (kept dependency-free in mcp-types so core can describe it without
39
+ * importing the tools-mongodb connection model).
40
+ */
41
+ export type SupportedConnectionState = {
42
+ tag: string;
43
+ connectionStringInfo?: ConnectionStringInfo;
44
+ connectedAtlasCluster?: AtlasClusterConnectionInfo;
45
+ };
46
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACrC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;IACtG,QAAQ,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC;CACrE,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,0BAA0B,CAAC;CACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":""}
@@ -1,3 +1,6 @@
1
+ import type { ElicitRequestFormParams, InputRequiredResult, InputResponses } from "@modelcontextprotocol/server";
2
+ /** Values that can be read back from a retried request's `inputResponses`. */
3
+ export type ElicitationInputResponses = InputResponses | Record<string, unknown> | undefined;
1
4
  export type ElicitedInputResult = {
2
5
  accepted: true;
3
6
  fields: Record<string, string>;
@@ -5,12 +8,83 @@ export type ElicitedInputResult = {
5
8
  accepted: false;
6
9
  fields?: undefined;
7
10
  };
11
+ /** The schema accepted by {@link IElicitation.inputRequired}. */
12
+ export type ElicitRequestSchema = ElicitRequestFormParams["requestedSchema"];
13
+ /** Parameters for {@link IElicitation.inputRequired}. */
14
+ export type ElicitInputRequiredParams = {
15
+ /** The identifier the answers arrive under in `inputResponses`. */
16
+ key: string;
17
+ /** The message/title to display in the form. */
18
+ message: string;
19
+ /** A JSON Schema describing the fields to collect. */
20
+ schema: ElicitRequestSchema;
21
+ };
22
+ /**
23
+ * Elicitation service used by tools to request confirmation or structured
24
+ * input from the user.
25
+ *
26
+ * Protocol revision 2026-07-28 replaced push-style server→client requests
27
+ * with **multi-round-trip**: a handler that needs user input returns
28
+ * `inputRequired(...)` from the request handler and the client retries the
29
+ * original request carrying the answers (`inputResponses`). The MongoDB MCP
30
+ * server's handlers are written in that style once and serve both eras: on
31
+ * 2025-era connections the SDK's legacy shim turns the same `inputRequired`
32
+ * return into real server→client requests and re-enters the handler with the
33
+ * collected responses.
34
+ *
35
+ * Implementations therefore expose two complementary halves:
36
+ * - *builders* (`confirmationRequired`, `inputRequired`) that produce the
37
+ * `InputRequiredResult` a handler returns when the required input has not
38
+ * been provided yet;
39
+ * - *readers* (`readConfirmation`, `readInput`) that extract the answers from
40
+ * a retried request's `inputResponses` (resent by the client verbatim on
41
+ * re-entry, so they must be treated as untrusted input).
42
+ */
8
43
  export interface IElicitation {
44
+ /**
45
+ * Checks if the client supports elicitation capabilities.
46
+ * @returns True if the client supports elicitation, false otherwise.
47
+ */
9
48
  supportsElicitation(): boolean;
10
- requestConfirmation(message: string): Promise<boolean>;
11
- requestInput(options: {
12
- message: string;
13
- schema: unknown;
14
- }): Promise<ElicitedInputResult>;
49
+ /**
50
+ * Builds the `inputRequired` result asking the user to confirm an
51
+ * operation. The handler returns it on the first entry; on re-entry the
52
+ * answers are read back with {@link IElicitation.readConfirmation}.
53
+ *
54
+ * @param message - The message to display to the user.
55
+ * @returns The `InputRequiredResult` to return from the request handler.
56
+ */
57
+ confirmationRequired(message: string): InputRequiredResult;
58
+ /**
59
+ * Reads the user's answer to a {@link IElicitation.confirmationRequired}
60
+ * request from a retried request's `inputResponses`.
61
+ *
62
+ * @returns `true` when the user confirmed, `false` when they declined, and
63
+ * `undefined` when this round carries no answer yet (the handler should
64
+ * return {@link IElicitation.confirmationRequired} instead).
65
+ */
66
+ readConfirmation(inputResponses: ElicitationInputResponses): boolean | undefined;
67
+ /**
68
+ * Builds the `inputRequired` result asking the user for structured input
69
+ * via a form. The handler returns it on the first entry; on re-entry the
70
+ * answers are read back with {@link IElicitation.readInput}.
71
+ *
72
+ * @param params - The identifier the answers arrive under in `inputResponses`
73
+ * (`key`), the message/title to display in the form (`message`) and a JSON
74
+ * Schema describing the fields to collect (`schema`).
75
+ * @returns The `InputRequiredResult` to return from the request handler.
76
+ */
77
+ inputRequired(params: ElicitInputRequiredParams): InputRequiredResult;
78
+ /**
79
+ * Reads the accepted fields of a {@link IElicitation.inputRequired}
80
+ * request from a retried request's `inputResponses`.
81
+ *
82
+ * @returns `{ accepted: true, fields }` with the user-provided values keyed
83
+ * by field name, `{ accepted: false }` when the user declined or cancelled
84
+ * (or the client does not support elicitation), and `undefined` when this
85
+ * round carries no response for `key` yet (the handler should return
86
+ * {@link IElicitation.inputRequired} again).
87
+ */
88
+ readInput(inputResponses: ElicitationInputResponses, key: string): ElicitedInputResult | undefined;
15
89
  }
16
90
  //# sourceMappingURL=elicitation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicitation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GACzB;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClD;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE9C,MAAM,WAAW,YAAY;IACzB,mBAAmB,IAAI,OAAO,CAAC;IAC/B,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,YAAY,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7F"}
1
+ {"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicitation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEjH,8EAA8E;AAC9E,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;AAE7F,MAAM,MAAM,mBAAmB,GACzB;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClD;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE9C,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AAE7E,yDAAyD;AACzD,MAAM,MAAM,yBAAyB,GAAG;IACpC,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,MAAM,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;IAE/B;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAE3D;;;;;;;OAOG;IACH,gBAAgB,CAAC,cAAc,EAAE,yBAAyB,GAAG,OAAO,GAAG,SAAS,CAAC;IAEjF;;;;;;;;;OASG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,mBAAmB,CAAC;IAEtE;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;CACtG"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,19 @@
1
- export type * from "./session.js";
2
- export type * from "./sessionStore.js";
1
+ export type * from "./config.js";
2
+ export type { AtlasClusterConnectionInfo, ConnectionStringInfo, SupportedConnectionState } from "./connection.js";
3
+ export type * from "./schemas.js";
4
+ export type * from "./transports.js";
3
5
  export type * from "./keychain.js";
4
6
  export type * from "./elicitation.js";
5
7
  export type * from "./logging.js";
6
8
  export type * from "./tool.js";
7
9
  export type * from "./transport.js";
8
10
  export type * from "./apiClient.js";
9
- export type * from "./metrics.js";
11
+ export type { IObservable, ICounter, IGauge, DefaultMetricDefinitions, IMetrics } from "./metrics.js";
10
12
  export type * from "./ui.js";
11
13
  export type * from "./resources.js";
12
14
  export type * from "./telemetry.js";
15
+ export { SHARED_TIER_METRIC_NAMES } from "./telemetry.js";
13
16
  export type * from "./helpers.js";
17
+ export type * from "./server.js";
18
+ export type * from "./sessionStore.js";
14
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAC;AACjC,YAAY,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAClH,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtG,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export {};
1
+ export { SHARED_TIER_METRIC_NAMES } from "./telemetry.js";
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,9 +1,23 @@
1
- export interface IKeychain {
2
- register(options: {
3
- value: unknown;
4
- kind: string;
5
- }): void;
1
+ import type { Secret } from "mongodb-redact";
2
+ export type { Secret } from "mongodb-redact";
3
+ /**
4
+ * The redaction half of a keychain, for consumers that need to scrub secrets out of a value but
5
+ * have no business registering or clearing them - loggers and tools. Kept separate so those
6
+ * consumers are not coupled to secret management just to reach {@link IRedactor.redact}.
7
+ */
8
+ export interface IRedactor {
9
+ /**
10
+ * Redacts the registered secrets from the strings in `value`, returning a copy of the same
11
+ * shape. Arrays and own enumerable properties are visited recursively, and the prototype of
12
+ * any object descended into is preserved. Values that keep their contents behind an API
13
+ * rather than in own properties - `Map`, `Set` and the like - are returned untouched, as are
14
+ * non-string primitives, so not every string transitively reachable is guaranteed to be
15
+ * redacted. Never mutates `value`, and terminates on self-referencing input.
16
+ */
17
+ redact<T>(value: T): T;
18
+ }
19
+ export interface IKeychain extends IRedactor {
20
+ register(value: Secret["value"], kind: Secret["kind"]): void;
6
21
  clearAllSecrets(): void;
7
- readonly allSecrets: unknown[];
8
22
  }
9
23
  //# sourceMappingURL=keychain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../src/keychain.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,eAAe,IAAI,IAAI,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../src/keychain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;;OAOG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,SAAU,SAAQ,SAAS;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7D,eAAe,IAAI,IAAI,CAAC;CAC3B"}
package/dist/logging.d.ts CHANGED
@@ -1,8 +1,18 @@
1
- import type { MongoLogId } from "mongodb-log-writer";
2
- export type LogLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency";
1
+ import type { LoggingMessageNotification } from "@modelcontextprotocol/server";
2
+ import type { IRedactor } from "./keychain.js";
3
+ export type { McpServer } from "@modelcontextprotocol/server";
4
+ export type LogLevel = LoggingMessageNotification["params"]["level"];
3
5
  export type LoggerType = "console" | "disk" | "mcp";
4
6
  export type EventMap<T> = Record<keyof T, any[]>;
5
7
  export type DefaultEventMap = Record<string, never[]>;
8
+ export type MongoDBLogLevel = "info" | "warn" | "error" | "debug" | "fatal";
9
+ export type LogWriteFunction = (component: string, id: MongoLogId, context: string, message: string, attr?: unknown) => void;
10
+ export type LogWriter = Record<MongoDBLogLevel, LogWriteFunction> & {
11
+ flush(): Promise<void>;
12
+ };
13
+ export type MongoLogId = {
14
+ __value: number;
15
+ };
6
16
  export type LogPayload = {
7
17
  id: MongoLogId;
8
18
  context: string;
@@ -10,11 +20,8 @@ export type LogPayload = {
10
20
  noRedaction?: boolean | LoggerType | LoggerType[];
11
21
  attributes?: Record<string, string>;
12
22
  };
13
- export interface ILoggerBase {
14
- log(options: {
15
- level: LogLevel;
16
- payload: LogPayload;
17
- }): void;
23
+ export interface ILogger {
24
+ log(level: LogLevel, payload: LogPayload): void;
18
25
  info(payload: LogPayload): void;
19
26
  error(payload: LogPayload): void;
20
27
  debug(payload: LogPayload): void;
@@ -23,12 +30,13 @@ export interface ILoggerBase {
23
30
  critical(payload: LogPayload): void;
24
31
  alert(payload: LogPayload): void;
25
32
  emergency(payload: LogPayload): void;
33
+ flush(): Promise<PromiseSettledResult<void>[]>;
26
34
  }
27
- export interface ICompositeLogger extends ILoggerBase {
28
- addLogger(logger: ILoggerBase): void;
29
- setAttribute(options: {
30
- key: string;
31
- value: string;
32
- }): void;
35
+ export type LoggerConfig = {
36
+ keychain: IRedactor;
37
+ };
38
+ export interface ICompositeLogger extends ILogger {
39
+ addLogger(logger: ILogger): void;
40
+ setAttribute(key: string, value: string): void;
33
41
  }
34
42
  //# sourceMappingURL=logging.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;AAE9G,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG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AAG,UAAU,EAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,WAAW,OAAO;IACpB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACrC,KAAK,IAAI,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;CAClD;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC7C,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD"}
package/dist/metrics.d.ts CHANGED
@@ -1,8 +1,52 @@
1
- export type MetricDefinitions = {
2
- [key: string]: unknown;
1
+ /**
2
+ * Labels type for metrics.
3
+ */
4
+ export type MetricLabels = Partial<Record<string, string | number>>;
5
+ /**
6
+ * Interface for observable metrics (like histograms).
7
+ * Used for recording values that can be observed over time.
8
+ */
9
+ export interface IObservable {
10
+ observe(labels: MetricLabels, value: number): void;
11
+ }
12
+ /**
13
+ * Interface for counter metrics.
14
+ * Used for counting events, can be incremented.
15
+ */
16
+ export interface ICounter {
17
+ inc(labels?: MetricLabels, value?: number): void;
18
+ }
19
+ /**
20
+ * Interface for gauge metrics.
21
+ * Used for metrics that can go up and down (e.g. currently active sessions).
22
+ */
23
+ export interface IGauge {
24
+ set(value: number): void;
25
+ inc(labels?: MetricLabels, value?: number): void;
26
+ dec(labels?: MetricLabels, value?: number): void;
27
+ }
28
+ /**
29
+ * Default metric definitions for MCP servers.
30
+ * These are the standard metrics used across the MCP packages.
31
+ */
32
+ export type DefaultMetricDefinitions = {
33
+ /** Counter for tracking created sessions */
34
+ sessionCreated: ICounter;
35
+ /** Counter for tracking closed sessions with reason label */
36
+ sessionClosed: ICounter;
37
+ /** Histogram for tracking tool execution duration in seconds */
38
+ toolExecutionDuration: IObservable;
39
+ /** Gauge for tracking currently active sessions */
40
+ sessionsActive: IGauge;
3
41
  };
4
- export interface IMetrics<TMetrics extends MetricDefinitions = MetricDefinitions> {
5
- get<K extends keyof TMetrics>(key: K): TMetrics[K];
42
+ /**
43
+ * Interface for accessing metrics.
44
+ * @template TMetricsDefinitions - The type of metric definitions this metrics instance uses
45
+ */
46
+ export interface IMetrics<TMetricsDefinitions extends DefaultMetricDefinitions = DefaultMetricDefinitions> {
47
+ /** Get a specific metric by name */
48
+ get<K extends keyof TMetricsDefinitions>(key: K): TMetricsDefinitions[K];
49
+ /** Get all metrics as a formatted string (e.g., Prometheus format) */
6
50
  getMetrics(): Promise<string>;
7
51
  }
8
52
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,QAAQ,CAAC,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB;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AAC,CAAC,SAAS,MAAM,mBAAmB,EAAE,GAAG,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACzE,sEAAsE;IACtE,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC"}
@@ -1,5 +1,75 @@
1
+ import type { ResourceMetadata, ReadResourceCallback } from "@modelcontextprotocol/server";
2
+ import type { ITelemetry } from "./telemetry.js";
3
+ import type { IToolConfig } from "./config.js";
4
+ import type { ICompositeLogger } from "./logging.js";
5
+ import type { IKeychain } from "./keychain.js";
6
+ import type { TransportRequestContext } from "./transport.js";
7
+ /**
8
+ * The minimal services resources read off the host server at construction,
9
+ * injected individually (no server-scoped "session" object exists). The server
10
+ * is deliberately stateless (connection state lives in the app-level registry),
11
+ * so resources read only the specific services they need from the server;
12
+ * host-specific extras (e.g. the connection registry) are read directly off
13
+ * the concrete server type by the resource implementation.
14
+ */
15
+ export type ResourceServices = {
16
+ readonly config: IToolConfig;
17
+ readonly logger: ICompositeLogger;
18
+ readonly keychain: IKeychain;
19
+ };
1
20
  export interface IResource {
2
21
  register(server: unknown): void;
3
22
  }
4
23
  export type IResources = readonly IResource[];
24
+ /** Static resource metadata (name/uri/description). Mirrors `resourceConfiguration` from v2-move. */
25
+ export type ResourceConfiguration = {
26
+ name: string;
27
+ uri: string;
28
+ config: ResourceMetadata;
29
+ };
30
+ export type ReactiveResourceOptions<Value> = {
31
+ initial: Value;
32
+ };
33
+ /**
34
+ * The host server surface resources register against and read services from.
35
+ * Resources are constructed with the server itself (`{ server }`) and derive
36
+ * the minimal services (config/logger/keychain) plus telemetry from it.
37
+ */
38
+ export interface IResourceServer {
39
+ readonly config: ResourceServices["config"];
40
+ readonly logger: ResourceServices["logger"];
41
+ readonly keychain: ResourceServices["keychain"];
42
+ readonly telemetry: ITelemetry;
43
+ mcpServer: {
44
+ registerResource: (name: string, uri: string, config: ResourceMetadata, callback: ReadResourceCallback) => void;
45
+ };
46
+ sendResourceListChanged(): void;
47
+ sendResourceUpdated(uri: string): void;
48
+ }
49
+ /**
50
+ * The construction argument every resource class receives: the host server plus
51
+ * the transport request that drove server creation (undefined for non-HTTP
52
+ * constructions such as stdio / dry-run).
53
+ */
54
+ export type ResourceServerArg<TServer extends IResourceServer = IResourceServer> = {
55
+ server: TServer;
56
+ /** The transport request that drove server creation (undefined for stdio / dry-run). */
57
+ transportRequest?: TransportRequestContext;
58
+ };
59
+ /**
60
+ * The type that all resource classes must conform to when implementing custom resources
61
+ * for the MongoDB MCP Server.
62
+ *
63
+ * This type enforces that resource classes have a constructor accepting
64
+ * `({ server })`, matching the construction pattern used by
65
+ * {@link CliServer} (see `registerResources`). The resolved user
66
+ * configuration is read from `server.config`.
67
+ */
68
+ export type ResourceClass<TServer extends IResourceServer = IResourceServer> = {
69
+ new (arg: ResourceServerArg<TServer>): {
70
+ register(server: IResourceServer): void;
71
+ };
72
+ };
73
+ /** Resource constructor type for registries that may include resource-specific servers. */
74
+ export type AnyResourceClass = ResourceClass<any>;
5
75
  //# sourceMappingURL=resources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,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iB,CAAC,OAAO,SAAS,eAAe,GAAG,eAAe,IAAI;IAC/E,MAAM,EAAE,OAAO,CAAC;IAChB,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,eAAe,GAAG,eAAe,IAAI;IAC3E,KAAK,GAAG,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAA;KAAE,CAAC;CACtF,CAAC;AAEF,2FAA2F;AAE3F,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type PreviewFeature = "mcpUI";
2
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import type { McpServer } from "@modelcontextprotocol/server";
2
+ /**
3
+ * Minimum server interface required by MCPHttpServer and the stdio runner:
4
+ * a request-scoped server instance that has been configured with tools,
5
+ * resources, capabilities and lifecycle hooks, ready to be handed to the
6
+ * protocol serving entry.
7
+ *
8
+ * The server is deliberately stateless and request-scoped: app-level services
9
+ * (connections, exports, API clients, telemetry) live once per process and
10
+ * are referenced by, not owned by, each request's server instance.
11
+ */
12
+ export type BaseServer = {
13
+ /**
14
+ * Registers resources, capabilities, tools, request handlers and lifecycle
15
+ * hooks on the underlying MCP server without connecting it to a transport.
16
+ * Required by the 2026-07-28 serving entries (`serveStdio`,
17
+ * `createMcpHandler`), which build/register instances through a factory.
18
+ */
19
+ register(): Promise<void>;
20
+ /** The protocol-level MCP server handed to the serving entry. */
21
+ mcpServer: McpServer;
22
+ };
23
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB;;;;;OAKG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,iEAAiE;IACjE,SAAS,EAAE,SAAS,CAAC;CACxB,CAAC"}
package/dist/server.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}