@firfi/huly-mcp 0.44.5 → 0.44.7

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 (3) hide show
  1. package/README.md +11 -8
  2. package/dist/index.cjs +189 -61
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,9 @@
10
10
 
11
11
  **Huly MCP** is a feature-complete MCP server for [Huly](https://huly.io/) integration. Published on npm as [`@firfi/huly-mcp`](https://www.npmjs.com/package/@firfi/huly-mcp).
12
12
 
13
+ > [!IMPORTANT]
14
+ > **Hosted Huly is shutting down.** Huly's upstream README says shutdown is expected July 20. If you use `https://huly.app`, [export and migrate your data](https://github.com/hcengineering/platform/blob/develop/README.md) as soon as possible. See the [backup and restore guide](https://github.com/hcengineering/platform/blob/develop/docs/guides/backup-restore.en.md) and [self-hosting repository](https://github.com/hcengineering/huly-selfhost). Self-hosted deployments are not affected.
15
+
13
16
  ## Installation
14
17
 
15
18
  The standard configuration works with most MCP clients:
@@ -21,7 +24,7 @@ The standard configuration works with most MCP clients:
21
24
  "command": "npx",
22
25
  "args": ["-y", "@firfi/huly-mcp@latest"],
23
26
  "env": {
24
- "HULY_URL": "https://huly.app",
27
+ "HULY_URL": "https://your-huly-instance.example.com",
25
28
  "HULY_EMAIL": "your@email.com",
26
29
  "HULY_PASSWORD": "yourpassword",
27
30
  "HULY_WORKSPACE": "yourworkspace"
@@ -44,7 +47,7 @@ Use Codex's MCP manager:
44
47
 
45
48
  ```bash
46
49
  codex mcp add huly \
47
- --env HULY_URL=https://huly.app \
50
+ --env HULY_URL=https://your-huly-instance.example.com \
48
51
  --env HULY_EMAIL=your@email.com \
49
52
  --env HULY_PASSWORD=yourpassword \
50
53
  --env HULY_WORKSPACE=yourworkspace \
@@ -59,7 +62,7 @@ command = "npx"
59
62
  args = ["-y", "@firfi/huly-mcp@latest"]
60
63
 
61
64
  [mcp_servers.huly.env]
62
- HULY_URL = "https://huly.app"
65
+ HULY_URL = "https://your-huly-instance.example.com"
63
66
  HULY_EMAIL = "your@email.com"
64
67
  HULY_PASSWORD = "yourpassword"
65
68
  HULY_WORKSPACE = "yourworkspace"
@@ -72,7 +75,7 @@ HULY_WORKSPACE = "yourworkspace"
72
75
 
73
76
  ```bash
74
77
  claude mcp add huly \
75
- -e HULY_URL=https://huly.app \
78
+ -e HULY_URL=https://your-huly-instance.example.com \
76
79
  -e HULY_EMAIL=your@email.com \
77
80
  -e HULY_PASSWORD=yourpassword \
78
81
  -e HULY_WORKSPACE=yourworkspace \
@@ -105,7 +108,7 @@ Add with Command Palette → "MCP: Add Server", or put this in a VS Code MCP con
105
108
  "command": "npx",
106
109
  "args": ["-y", "@firfi/huly-mcp@latest"],
107
110
  "env": {
108
- "HULY_URL": "https://huly.app",
111
+ "HULY_URL": "https://your-huly-instance.example.com",
109
112
  "HULY_EMAIL": "your@email.com",
110
113
  "HULY_PASSWORD": "yourpassword",
111
114
  "HULY_WORKSPACE": "yourworkspace"
@@ -143,7 +146,7 @@ Open the global configuration file (`~/.config/opencode/opencode.json`) and merg
143
146
  "type": "local",
144
147
  "command": ["npx", "-y", "@firfi/huly-mcp@latest"],
145
148
  "environment": {
146
- "HULY_URL": "https://huly.app",
149
+ "HULY_URL": "https://your-huly-instance.example.com",
147
150
  "HULY_EMAIL": "your@email.com",
148
151
  "HULY_PASSWORD": "yourpassword",
149
152
  "HULY_WORKSPACE": "yourworkspace"
@@ -173,7 +176,7 @@ The `@latest` tag asks the package runner for the newest version. Some MCP clien
173
176
  By default, the server uses stdio transport. For HTTP transport (Streamable HTTP):
174
177
 
175
178
  ```bash
176
- HULY_URL=https://huly.app \
179
+ HULY_URL=https://your-huly-instance.example.com \
177
180
  HULY_EMAIL=your@email.com \
178
181
  HULY_PASSWORD=yourpassword \
179
182
  HULY_WORKSPACE=yourworkspace \
@@ -235,7 +238,7 @@ For a Smithery publish schema example, see [docs/SMITHERY_URL_PUBLISH.md](docs/S
235
238
 
236
239
  | Variable | Required | Description |
237
240
  |----------|----------|-------------|
238
- | `HULY_URL` | Yes | Huly instance URL |
241
+ | `HULY_URL` | Yes | Reachable self-hosted or replacement hosted Huly instance URL |
239
242
  | `HULY_EMAIL` | Auth* | Account email |
240
243
  | `HULY_PASSWORD` | Auth* | Account password |
241
244
  | `HULY_TOKEN` | Auth* | API token (alternative to email/password) |
package/dist/index.cjs CHANGED
@@ -162617,12 +162617,54 @@ var DocumentReferenceError = class extends Schema_exports.TaggedError()(
162617
162617
  }
162618
162618
  };
162619
162619
 
162620
+ // src/domain/schemas/tool-warnings.ts
162621
+ var ToolWarningCodeSchema = Schema_exports.Literal(
162622
+ "status_metadata_unresolved",
162623
+ "space_role_assignments_degraded",
162624
+ "message_template_metadata_degraded",
162625
+ "viewlet_descriptor_metadata_degraded",
162626
+ "space_preference_metadata_degraded",
162627
+ "approval_request_person_metadata_degraded",
162628
+ "approval_request_count_metadata_degraded",
162629
+ "hosted_huly_shutdown"
162630
+ ).annotations({
162631
+ identifier: "ToolWarningCode",
162632
+ title: "ToolWarningCode",
162633
+ description: "Machine-readable code for an agent-visible MCP tool warning."
162634
+ });
162635
+ var StatusMetadataUnresolvedWarningCode = ToolWarningCodeSchema.literals[0];
162636
+ var SpaceRoleAssignmentsDegradedWarningCode = ToolWarningCodeSchema.literals[1];
162637
+ var MessageTemplateMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[2];
162638
+ var ViewletDescriptorMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[3];
162639
+ var SpacePreferenceMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[4];
162640
+ var ApprovalRequestPersonMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[5];
162641
+ var ApprovalRequestCountMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[6];
162642
+ var HostedHulyShutdownWarningCode = ToolWarningCodeSchema.literals[7];
162643
+ var ToolWarningSchema = Schema_exports.Struct({
162644
+ code: ToolWarningCodeSchema,
162645
+ message: Schema_exports.Trim.pipe(Schema_exports.nonEmptyString()).annotations({
162646
+ description: "LLM-facing explanation of degraded result fidelity or an important operational condition requiring user action."
162647
+ })
162648
+ }).annotations({
162649
+ identifier: "ToolWarning",
162650
+ title: "ToolWarning",
162651
+ description: "Warning surfaced to an agent alongside a tool result without changing whether that tool call succeeded."
162652
+ });
162653
+
162620
162654
  // src/huly/unavailable-diagnostics.ts
162621
162655
  var DEFAULT_HULY_CLOUD_ORIGIN = "https://huly.app";
162622
162656
  var HOSTED_HULY_SUNSET = {
162623
- sourceUrl: "https://github.com/hcengineering/huly",
162657
+ sourceUrl: "https://github.com/hcengineering/platform/blob/develop/README.md",
162658
+ backupRestoreUrl: "https://github.com/hcengineering/platform/blob/develop/docs/guides/backup-restore.en.md",
162659
+ selfHostingUrl: "https://github.com/hcengineering/huly-selfhost",
162624
162660
  expectedShutdown: "July 20"
162625
162661
  };
162662
+ var HOSTED_HULY_MIGRATION_LINKS = `Announcement: ${HOSTED_HULY_SUNSET.sourceUrl}. Backup and restore guide: ${HOSTED_HULY_SUNSET.backupRestoreUrl}. Self-hosting: ${HOSTED_HULY_SUNSET.selfHostingUrl}.`;
162663
+ var HOSTED_HULY_MIGRATION_INSTRUCTIONS = `Important: Hosted Huly is shutting down. Huly's upstream README says the hosted service is being discontinued because hosting is no longer funded, with shutdown expected ${HOSTED_HULY_SUNSET.expectedShutdown}. If this MCP uses ${DEFAULT_HULY_CLOUD_ORIGIN}, export and back up important data and migrate as soon as possible. ${HOSTED_HULY_MIGRATION_LINKS} Self-hosted deployments are not affected.`;
162664
+ var HOSTED_HULY_MIGRATION_WARNING = Schema_exports.decodeUnknownSync(ToolWarningSchema)({
162665
+ code: HostedHulyShutdownWarningCode,
162666
+ message: HOSTED_HULY_MIGRATION_INSTRUCTIONS
162667
+ });
162626
162668
  var HulyEndpointOriginSchema = Schema_exports.String.pipe(
162627
162669
  Schema_exports.filter((value3) => {
162628
162670
  try {
@@ -166187,7 +166229,7 @@ var INTERNAL_ERROR_PREFIX = {
166187
166229
  var hulyUnavailableMessage = (error2) => {
166188
166230
  const failureGuidance = error2.failureKind === "timeout" ? " The request timed out; verify HULY_CONNECTION_TIMEOUT before retrying." : error2.failureKind === "dns" || error2.failureKind === "tls" ? " Verify the hostname, certificate, DNS, and proxy configuration before retrying." : "";
166189
166231
  if (isDefaultHulyCloudOrigin(error2.endpointOrigin)) {
166190
- return `Cannot reach hosted Huly (${error2.endpointOrigin}) from this MCP server. Huly's README announces that hosted Huly is being discontinued, with shutdown expected ${HOSTED_HULY_SUNSET.expectedShutdown}; this outage may be related but is not confirmed. Export and back up your data, then migrate to a hosted alternative or self-hosted Huly. Check network/DNS/proxy access if you need one last connection; set HULY_URL to a reachable self-hosted instance after migration. Do not retry a write until connectivity is restored.${failureGuidance}`;
166232
+ return `Cannot reach hosted Huly (${error2.endpointOrigin}) from this MCP server. Huly's README announces that hosted Huly is being discontinued, with shutdown expected ${HOSTED_HULY_SUNSET.expectedShutdown}; this outage may be related but is not confirmed. Export and back up your data, then migrate to a hosted alternative or self-hosted Huly. ${HOSTED_HULY_MIGRATION_LINKS} Check network/DNS/proxy access if you need one last connection; set HULY_URL to a reachable self-hosted instance after migration. Do not retry a write until connectivity is restored.${failureGuidance}`;
166191
166233
  }
166192
166234
  return `Cannot reach the configured Huly endpoint (${error2.endpointOrigin}). Check with this deployment's operator, then verify HULY_URL, network/DNS/proxy access, and HULY_CONNECTION_TIMEOUT before retrying. Do not retry a write until connectivity is restored.${failureGuidance}`;
166193
166235
  };
@@ -166271,6 +166313,36 @@ var createSuccessResponse = (result, warnings = []) => ({
166271
166313
  result
166272
166314
  }
166273
166315
  });
166316
+ var appendWarningContent = (content, warnings, replaceExistingWarningBlock) => {
166317
+ const [first2, ...remaining] = content;
166318
+ const preserved = replaceExistingWarningBlock ? remaining.slice(0, remaining.length - 1) : remaining;
166319
+ return [first2, ...preserved, { type: "text", text: encodeJsonText({ warnings }) }];
166320
+ };
166321
+ var appendToolWarnings = (response, warnings) => {
166322
+ if (warnings.length === 0) return response;
166323
+ if (response.isError === true) {
166324
+ return {
166325
+ ...response,
166326
+ content: appendWarningContent(response.content, warnings, false)
166327
+ };
166328
+ }
166329
+ if (response.structuredContent === void 0) {
166330
+ return {
166331
+ ...response,
166332
+ content: appendWarningContent(response.content, warnings, false)
166333
+ };
166334
+ }
166335
+ const existingWarnings = response.structuredContent.warnings ?? [];
166336
+ const combinedWarnings = [...existingWarnings, ...warnings];
166337
+ return {
166338
+ ...response,
166339
+ content: appendWarningContent(response.content, combinedWarnings, existingWarnings.length > 0),
166340
+ structuredContent: {
166341
+ result: response.structuredContent.result,
166342
+ warnings: combinedWarnings
166343
+ }
166344
+ };
166345
+ };
166274
166346
  var createUnknownToolError = (toolName) => createErrorResponse(`Unknown tool: ${toolName}`, McpErrorCode.InvalidParams, "UnknownTool");
166275
166347
  var createInvalidParamsError = (message, errorTag) => createErrorResponse(message, McpErrorCode.InvalidParams, errorTag);
166276
166348
  var toMcpResponse = (response) => response.isError === true ? {
@@ -166931,38 +167003,6 @@ var StdioServerTransport = class {
166931
167003
  // src/domain/schemas/output-helpers.ts
166932
167004
  var optionalOutput = (schema) => Schema_exports.optionalWith(schema, { exact: true });
166933
167005
 
166934
- // src/domain/schemas/tool-warnings.ts
166935
- var ToolWarningCodeSchema = Schema_exports.Literal(
166936
- "status_metadata_unresolved",
166937
- "space_role_assignments_degraded",
166938
- "message_template_metadata_degraded",
166939
- "viewlet_descriptor_metadata_degraded",
166940
- "space_preference_metadata_degraded",
166941
- "approval_request_person_metadata_degraded",
166942
- "approval_request_count_metadata_degraded"
166943
- ).annotations({
166944
- identifier: "ToolWarningCode",
166945
- title: "ToolWarningCode",
166946
- description: "Machine-readable code for an agent-visible MCP tool warning."
166947
- });
166948
- var StatusMetadataUnresolvedWarningCode = ToolWarningCodeSchema.literals[0];
166949
- var SpaceRoleAssignmentsDegradedWarningCode = ToolWarningCodeSchema.literals[1];
166950
- var MessageTemplateMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[2];
166951
- var ViewletDescriptorMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[3];
166952
- var SpacePreferenceMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[4];
166953
- var ApprovalRequestPersonMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[5];
166954
- var ApprovalRequestCountMetadataDegradedWarningCode = ToolWarningCodeSchema.literals[6];
166955
- var ToolWarningSchema = Schema_exports.Struct({
166956
- code: ToolWarningCodeSchema,
166957
- message: Schema_exports.Trim.pipe(Schema_exports.nonEmptyString()).annotations({
166958
- description: "LLM-facing explanation of what part of the returned tool payload is degraded and how the agent should interpret it."
166959
- })
166960
- }).annotations({
166961
- identifier: "ToolWarning",
166962
- title: "ToolWarning",
166963
- description: "Warning surfaced to an agent when a tool result is intentionally degraded instead of failing."
166964
- });
166965
-
166966
167006
  // src/domain/schemas/document-native-references.ts
166967
167007
  var HULY_NATIVE_REFERENCE_MARKDOWN_INPUT = "Markdown links to current-workspace Huly browse URLs with _class, _id, and label become native Huly references; external URLs and other-workspace browse URLs stay normal links.";
166968
167008
  var DOCUMENT_NATIVE_REFERENCE_LINK_USAGE = "Use markdown links to current-workspace Huly browse URLs for native references; Huly browse links returned in get_document content round-trip as native references. The URL identifies the object; link text is display text; plain issue keys stay text.";
@@ -178444,7 +178484,7 @@ var parseDeleteDriveFileCommentParams = Schema_exports.decodeUnknown(DeleteDrive
178444
178484
  var parseListDriveFileActivityParams = Schema_exports.decodeUnknown(ListDriveFileActivityParamsSchema);
178445
178485
 
178446
178486
  // src/version.ts
178447
- var VERSION = true ? "0.44.5" : "0.0.0-dev";
178487
+ var VERSION = true ? "0.44.7" : "0.0.0-dev";
178448
178488
 
178449
178489
  // src/mcp/json-schema-refs.ts
178450
178490
  var isJsonObject = (value3) => typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
@@ -178489,7 +178529,7 @@ var stripCollidingSchemaIdsProperties = (properties) => Object.fromEntries(
178489
178529
  var toolWarningCodeEnum = [...ToolWarningCodeSchema.literals];
178490
178530
  var warningOutputSchema = {
178491
178531
  type: "array",
178492
- description: "Optional agent-visible warnings about degraded result fidelity. Omitted when the server returned the documented happy-path payload.",
178532
+ description: "Optional agent-visible warnings about degraded result fidelity or important operational conditions. Omitted when there is nothing the agent needs to surface.",
178493
178533
  items: {
178494
178534
  type: "object",
178495
178535
  properties: {
@@ -206783,7 +206823,61 @@ var toListedHulyTool = (tool) => toListedTool({
206783
206823
  annotations: resolveAnnotations(tool)
206784
206824
  });
206785
206825
 
206826
+ // src/mcp/tool-call-notices.ts
206827
+ var noNoticeClaim = { _tag: "None" };
206828
+ var noToolCallNoticeProvider = {
206829
+ claim: () => noNoticeClaim
206830
+ };
206831
+ var isHostedHulyOrigin = (origin) => origin !== void 0 && isDefaultHulyCloudOrigin(normalizeHulyOrigin(origin));
206832
+ var hostedHulyMigrationInstructionsForOrigin = (origin) => isHostedHulyOrigin(origin) ? HOSTED_HULY_MIGRATION_INSTRUCTIONS : void 0;
206833
+ var alwaysNoticeProvider = () => ({
206834
+ claim: () => ({
206835
+ _tag: "Claimed",
206836
+ warning: HOSTED_HULY_MIGRATION_WARNING,
206837
+ delivered: () => {
206838
+ },
206839
+ release: () => {
206840
+ }
206841
+ })
206842
+ });
206843
+ var onceNoticeProvider = () => {
206844
+ let state = "pending";
206845
+ return {
206846
+ claim: () => {
206847
+ if (state !== "pending") return noNoticeClaim;
206848
+ state = "claimed";
206849
+ return {
206850
+ _tag: "Claimed",
206851
+ warning: HOSTED_HULY_MIGRATION_WARNING,
206852
+ delivered: () => {
206853
+ if (state === "claimed") state = "delivered";
206854
+ },
206855
+ release: () => {
206856
+ if (state === "claimed") state = "pending";
206857
+ }
206858
+ };
206859
+ }
206860
+ };
206861
+ };
206862
+ var createHostedHulyMigrationNoticeProvider = (config3) => {
206863
+ if (hostedHulyMigrationInstructionsForOrigin(config3.hulyOrigin) === void 0) return noToolCallNoticeProvider;
206864
+ return config3.delivery === "always" ? alwaysNoticeProvider() : onceNoticeProvider();
206865
+ };
206866
+
206786
206867
  // src/mcp/protocol-handlers.ts
206868
+ var ServerDiscoverResultSchema = Schema_exports.Struct({
206869
+ resultType: Schema_exports.Literal("complete"),
206870
+ supportedVersions: Schema_exports.Tuple(Schema_exports.Literal("2026-07-28")),
206871
+ capabilities: Schema_exports.Struct({
206872
+ tools: Schema_exports.Struct({}),
206873
+ resources: Schema_exports.Struct({})
206874
+ }),
206875
+ serverInfo: Schema_exports.Struct({
206876
+ name: Schema_exports.Literal("huly-mcp"),
206877
+ version: Schema_exports.String
206878
+ }),
206879
+ instructions: Schema_exports.optionalWith(Schema_exports.Literal(HOSTED_HULY_MIGRATION_INSTRUCTIONS), { exact: true })
206880
+ });
206787
206881
  var DRAIN_POLL_MS = 50;
206788
206882
  var DRAIN_TIMEOUT_MS2 = 3e4;
206789
206883
  var NPM_FETCH_TIMEOUT_MS = 5e3;
@@ -206798,6 +206892,7 @@ var deriveEditMode = (name, args2) => {
206798
206892
  };
206799
206893
  var validateHulyContextResult = (value3) => Schema_exports.decodeUnknownSync(GetHulyContextResultSchema)(value3);
206800
206894
  var validateVersionToolResult = (value3) => Schema_exports.decodeUnknownSync(VersionToolResultSchema)(value3);
206895
+ var parseServerDiscoverResult = (value3) => Schema_exports.decodeUnknownSync(ServerDiscoverResultSchema)(value3);
206801
206896
  var liveNowClock = {
206802
206897
  currentTimeMillis: () => Effect_exports.runSync(Clock_exports.currentTimeMillis)
206803
206898
  };
@@ -206834,7 +206929,7 @@ var invokeToolEditMode = (args2) => {
206834
206929
  const decoded = Schema_exports.decodeUnknownEither(InvokeToolParamsSchema)(args2);
206835
206930
  return decoded._tag === "Right" ? deriveEditMode(decoded.right.toolName, decoded.right.arguments) : void 0;
206836
206931
  };
206837
- var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyContext, clock3 = liveNowClock, fetchLatestVersion = fetchLatestNpmVersion, exposureOptions = {}) => {
206932
+ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyContext, clock3 = liveNowClock, fetchLatestVersion = fetchLatestNpmVersion, exposureOptions = {}, toolCallNoticeProvider = noToolCallNoticeProvider, serverInstructions) => {
206838
206933
  const registries = normalizeRegistries(registry2);
206839
206934
  const defaults = defaultExposureOptions();
206840
206935
  const protocolExposureOptions = {
@@ -206866,25 +206961,33 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
206866
206961
  };
206867
206962
  const callTool = async (request3) => {
206868
206963
  enter();
206964
+ const noticeClaim = toolCallNoticeProvider.claim();
206869
206965
  try {
206870
206966
  const { arguments: args2, name } = request3.params;
206871
206967
  const exposure = resolveProtocolExposure(registries, protocolExposureOptions);
206872
206968
  const start3 = clock3.currentTimeMillis();
206873
206969
  const inputBytes = JSON.stringify(args2 ?? {}).length;
206970
+ const withClaimedNotice = (response2) => {
206971
+ if (noticeClaim._tag === "None") return response2;
206972
+ const responseWithNotice2 = appendToolWarnings(response2, [noticeClaim.warning]);
206973
+ noticeClaim.delivered();
206974
+ return responseWithNotice2;
206975
+ };
206874
206976
  const returnError = (errorResponse, editMode2) => {
206977
+ const responseWithNotice2 = withClaimedNotice(errorResponse);
206875
206978
  const durationMs2 = clock3.currentTimeMillis() - start3;
206876
206979
  telemetry.toolCalled({
206877
206980
  toolName: name,
206878
206981
  status: "error",
206879
206982
  clientKind: exposure.context.clientKind,
206880
206983
  resolvedMode: exposure.context.resolvedMode,
206881
- errorTag: errorResponse._meta?.errorTag,
206984
+ errorTag: responseWithNotice2._meta?.errorTag,
206882
206985
  durationMs: durationMs2,
206883
206986
  inputBytes,
206884
- outputBytes: computeOutputBytes(errorResponse),
206987
+ outputBytes: computeOutputBytes(responseWithNotice2),
206885
206988
  editMode: editMode2
206886
206989
  });
206887
- return toMcpResponse(errorResponse);
206990
+ return toMcpResponse(responseWithNotice2);
206888
206991
  };
206889
206992
  if (name === VERSION_TOOL_NAME) {
206890
206993
  if (!isEmptyArgumentsObject(args2)) return returnError(createUnexpectedArgumentsError(VERSION_TOOL_NAME));
@@ -206895,7 +206998,7 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
206895
206998
  } catch {
206896
206999
  return returnError(mapDomainErrorToMcp(new HulyError({ message: "Failed to build version result" })));
206897
207000
  }
206898
- const versionResponse = createSuccessResponse(versionResult);
207001
+ const versionResponse = withClaimedNotice(createSuccessResponse(versionResult));
206899
207002
  const durationMs2 = clock3.currentTimeMillis() - start3;
206900
207003
  telemetry.toolCalled({
206901
207004
  toolName: name,
@@ -206918,7 +207021,7 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
206918
207021
  } catch {
206919
207022
  return returnError(mapDomainErrorToMcp(new HulyError({ message: "Failed to build Huly context" })));
206920
207023
  }
206921
- const contextResponse = createSuccessResponse(context6);
207024
+ const contextResponse = withClaimedNotice(createSuccessResponse(context6));
206922
207025
  const durationMs2 = clock3.currentTimeMillis() - start3;
206923
207026
  telemetry.toolCalled({
206924
207027
  toolName: name,
@@ -206955,19 +207058,20 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
206955
207058
  }
206956
207059
  }
206957
207060
  });
207061
+ const responseWithNotice2 = withClaimedNotice(response2);
206958
207062
  const durationMs2 = clock3.currentTimeMillis() - start3;
206959
207063
  telemetry.toolCalled({
206960
207064
  toolName: name,
206961
- status: response2.isError === true ? "error" : "success",
207065
+ status: responseWithNotice2.isError === true ? "error" : "success",
206962
207066
  clientKind: exposure.context.clientKind,
206963
207067
  resolvedMode: exposure.context.resolvedMode,
206964
- errorTag: response2._meta?.errorTag,
207068
+ errorTag: responseWithNotice2._meta?.errorTag,
206965
207069
  durationMs: durationMs2,
206966
207070
  inputBytes,
206967
- outputBytes: computeOutputBytes(response2),
207071
+ outputBytes: computeOutputBytes(responseWithNotice2),
206968
207072
  editMode: editMode2
206969
207073
  });
206970
- return toMcpResponse(response2);
207074
+ return toMcpResponse(responseWithNotice2);
206971
207075
  }
206972
207076
  const hulyToolName = parseToolName(name);
206973
207077
  if (hulyToolName === void 0) return returnError(createUnknownToolError(name));
@@ -206997,18 +207101,22 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
206997
207101
  );
206998
207102
  const durationMs = clock3.currentTimeMillis() - start3;
206999
207103
  if (response === null) return returnError(createUnknownToolError(name), editMode);
207104
+ const responseWithNotice = withClaimedNotice(response);
207000
207105
  telemetry.toolCalled({
207001
207106
  toolName: hulyToolName,
207002
- status: response.isError === true ? "error" : "success",
207107
+ status: responseWithNotice.isError === true ? "error" : "success",
207003
207108
  clientKind: exposure.context.clientKind,
207004
207109
  resolvedMode: exposure.context.resolvedMode,
207005
- errorTag: response._meta?.errorTag,
207110
+ errorTag: responseWithNotice._meta?.errorTag,
207006
207111
  durationMs,
207007
207112
  inputBytes,
207008
- outputBytes: computeOutputBytes(response),
207113
+ outputBytes: computeOutputBytes(responseWithNotice),
207009
207114
  editMode
207010
207115
  });
207011
- return toMcpResponse(response);
207116
+ return toMcpResponse(responseWithNotice);
207117
+ } catch (error2) {
207118
+ if (noticeClaim._tag === "Claimed") noticeClaim.release();
207119
+ throw error2;
207012
207120
  } finally {
207013
207121
  leave();
207014
207122
  }
@@ -207020,11 +207128,12 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
207020
207128
  listResources: resourceHandlers.listResources,
207021
207129
  listResourceTemplates,
207022
207130
  readResource: resourceHandlers.readResource,
207023
- serverDiscover: () => ({
207131
+ serverDiscover: () => parseServerDiscoverResult({
207024
207132
  resultType: "complete",
207025
207133
  supportedVersions: ["2026-07-28"],
207026
207134
  capabilities: { tools: {}, resources: {} },
207027
- serverInfo: { name: "huly-mcp", version: VERSION }
207135
+ serverInfo: { name: "huly-mcp", version: VERSION },
207136
+ ...serverInstructions === void 0 ? {} : { instructions: serverInstructions }
207028
207137
  }),
207029
207138
  drainInflight
207030
207139
  };
@@ -212649,7 +212758,7 @@ var Server = class extends Protocol {
212649
212758
  };
212650
212759
 
212651
212760
  // src/mcp/sdk-server.ts
212652
- var createDefaultMcpSdkServer = () => new Server(
212761
+ var createDefaultMcpSdkServer = (instructions) => new Server(
212653
212762
  {
212654
212763
  name: "huly-mcp",
212655
212764
  version: VERSION
@@ -212658,7 +212767,8 @@ var createDefaultMcpSdkServer = () => new Server(
212658
212767
  capabilities: {
212659
212768
  resources: {},
212660
212769
  tools: {}
212661
- }
212770
+ },
212771
+ ...instructions === void 0 ? {} : { instructions }
212662
212772
  }
212663
212773
  );
212664
212774
 
@@ -212667,8 +212777,8 @@ var currentClientInfoFromServer = (server) => {
212667
212777
  const maybeServer = server;
212668
212778
  return parseMcpClientInfo(maybeServer.getClientVersion?.());
212669
212779
  };
212670
- var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, createServer = createDefaultMcpSdkServer, exposureOptions = {}) => {
212671
- const server = createServer();
212780
+ var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, createServer = createDefaultMcpSdkServer, exposureOptions = {}, toolCallNoticeProvider = noToolCallNoticeProvider, serverInstructions) => {
212781
+ const server = createServer(serverInstructions);
212672
212782
  const currentClientInfo = () => exposureOptions.currentClientInfo?.() ?? currentClientInfoFromServer(server);
212673
212783
  const handlers = createMcpProtocolHandlers(
212674
212784
  resolveClients,
@@ -212680,7 +212790,9 @@ var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, cre
212680
212790
  {
212681
212791
  ...exposureOptions,
212682
212792
  currentClientInfo
212683
- }
212793
+ },
212794
+ toolCallNoticeProvider,
212795
+ serverInstructions
212684
212796
  );
212685
212797
  server.setRequestHandler(ListToolsRequestSchema, handlers.listTools);
212686
212798
  server.setRequestHandler(CallToolRequestSchema, handlers.callTool);
@@ -216743,13 +216855,19 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
216743
216855
  }
216744
216856
  yield* Ref_exports.set(isRunning2, true);
216745
216857
  if (config3.transport === "stdio") {
216858
+ const stdioRuntimeConfig = getRuntimeConfigContext();
216746
216859
  const [stdioServer, drainInflight] = createMcpServer(
216747
216860
  config3.resolveClients,
216748
216861
  telemetry,
216749
216862
  registries,
216750
- (toolExposure) => getHulyContext(getRuntimeConfigContext(), toolExposure),
216863
+ (toolExposure) => getHulyContext(stdioRuntimeConfig, toolExposure),
216751
216864
  config3.createServer,
216752
- sdkExposureOptions
216865
+ sdkExposureOptions,
216866
+ createHostedHulyMigrationNoticeProvider({
216867
+ delivery: "once",
216868
+ hulyOrigin: stdioRuntimeConfig.huly.url.origin
216869
+ }),
216870
+ hostedHulyMigrationInstructionsForOrigin(stdioRuntimeConfig.huly.url.origin)
216753
216871
  );
216754
216872
  yield* Ref_exports.set(serverRef, stdioServer);
216755
216873
  const transport = config3.createStdioTransport?.() ?? new StdioServerTransport();
@@ -216809,7 +216927,12 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
216809
216927
  registries,
216810
216928
  (toolExposure) => getHulyContext(requestRuntimeConfig, toolExposure),
216811
216929
  config3.createServer,
216812
- requestExposureOptions(() => clientInfoFromLegacyHttpRequest(req))
216930
+ requestExposureOptions(() => clientInfoFromLegacyHttpRequest(req)),
216931
+ createHostedHulyMigrationNoticeProvider({
216932
+ delivery: "always",
216933
+ hulyOrigin: requestRuntimeConfig.huly.url.origin
216934
+ }),
216935
+ hostedHulyMigrationInstructionsForOrigin(requestRuntimeConfig.huly.url.origin)
216813
216936
  )[0];
216814
216937
  },
216815
216938
  config3.httpTransportDependencies,
@@ -216822,7 +216945,12 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
216822
216945
  (toolExposure) => getHulyContext(requestRuntimeConfig, toolExposure),
216823
216946
  void 0,
216824
216947
  void 0,
216825
- requestExposureOptions(() => clientInfoFromMcp2026Request(req))
216948
+ requestExposureOptions(() => clientInfoFromMcp2026Request(req)),
216949
+ createHostedHulyMigrationNoticeProvider({
216950
+ delivery: "always",
216951
+ hulyOrigin: requestRuntimeConfig.huly.url.origin
216952
+ }),
216953
+ hostedHulyMigrationInstructionsForOrigin(requestRuntimeConfig.huly.url.origin)
216826
216954
  );
216827
216955
  }
216828
216956
  ).pipe(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firfi/huly-mcp",
3
- "version": "0.44.5",
3
+ "version": "0.44.7",
4
4
  "description": "Huly MCP: feature-complete MCP server for Huly integration",
5
5
  "mcpName": "io.github.dearlordylord/huly-mcp",
6
6
  "type": "module",