@firfi/huly-mcp 0.44.5 → 0.44.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/dist/index.cjs +182 -59
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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/
|
|
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.
|
|
178487
|
+
var VERSION = true ? "0.44.6" : "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
|
|
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,60 @@ 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 alwaysNoticeProvider = () => ({
|
|
206833
|
+
claim: () => ({
|
|
206834
|
+
_tag: "Claimed",
|
|
206835
|
+
warning: HOSTED_HULY_MIGRATION_WARNING,
|
|
206836
|
+
delivered: () => {
|
|
206837
|
+
},
|
|
206838
|
+
release: () => {
|
|
206839
|
+
}
|
|
206840
|
+
})
|
|
206841
|
+
});
|
|
206842
|
+
var onceNoticeProvider = () => {
|
|
206843
|
+
let state = "pending";
|
|
206844
|
+
return {
|
|
206845
|
+
claim: () => {
|
|
206846
|
+
if (state !== "pending") return noNoticeClaim;
|
|
206847
|
+
state = "claimed";
|
|
206848
|
+
return {
|
|
206849
|
+
_tag: "Claimed",
|
|
206850
|
+
warning: HOSTED_HULY_MIGRATION_WARNING,
|
|
206851
|
+
delivered: () => {
|
|
206852
|
+
if (state === "claimed") state = "delivered";
|
|
206853
|
+
},
|
|
206854
|
+
release: () => {
|
|
206855
|
+
if (state === "claimed") state = "pending";
|
|
206856
|
+
}
|
|
206857
|
+
};
|
|
206858
|
+
}
|
|
206859
|
+
};
|
|
206860
|
+
};
|
|
206861
|
+
var createHostedHulyMigrationNoticeProvider = (config3) => {
|
|
206862
|
+
if (!isHostedHulyOrigin(config3.hulyOrigin)) return noToolCallNoticeProvider;
|
|
206863
|
+
return config3.delivery === "always" ? alwaysNoticeProvider() : onceNoticeProvider();
|
|
206864
|
+
};
|
|
206865
|
+
|
|
206786
206866
|
// src/mcp/protocol-handlers.ts
|
|
206867
|
+
var ServerDiscoverResultSchema = Schema_exports.Struct({
|
|
206868
|
+
resultType: Schema_exports.Literal("complete"),
|
|
206869
|
+
supportedVersions: Schema_exports.Tuple(Schema_exports.Literal("2026-07-28")),
|
|
206870
|
+
capabilities: Schema_exports.Struct({
|
|
206871
|
+
tools: Schema_exports.Struct({}),
|
|
206872
|
+
resources: Schema_exports.Struct({})
|
|
206873
|
+
}),
|
|
206874
|
+
serverInfo: Schema_exports.Struct({
|
|
206875
|
+
name: Schema_exports.Literal("huly-mcp"),
|
|
206876
|
+
version: Schema_exports.String
|
|
206877
|
+
}),
|
|
206878
|
+
instructions: Schema_exports.String
|
|
206879
|
+
});
|
|
206787
206880
|
var DRAIN_POLL_MS = 50;
|
|
206788
206881
|
var DRAIN_TIMEOUT_MS2 = 3e4;
|
|
206789
206882
|
var NPM_FETCH_TIMEOUT_MS = 5e3;
|
|
@@ -206798,6 +206891,7 @@ var deriveEditMode = (name, args2) => {
|
|
|
206798
206891
|
};
|
|
206799
206892
|
var validateHulyContextResult = (value3) => Schema_exports.decodeUnknownSync(GetHulyContextResultSchema)(value3);
|
|
206800
206893
|
var validateVersionToolResult = (value3) => Schema_exports.decodeUnknownSync(VersionToolResultSchema)(value3);
|
|
206894
|
+
var parseServerDiscoverResult = (value3) => Schema_exports.decodeUnknownSync(ServerDiscoverResultSchema)(value3);
|
|
206801
206895
|
var liveNowClock = {
|
|
206802
206896
|
currentTimeMillis: () => Effect_exports.runSync(Clock_exports.currentTimeMillis)
|
|
206803
206897
|
};
|
|
@@ -206834,7 +206928,7 @@ var invokeToolEditMode = (args2) => {
|
|
|
206834
206928
|
const decoded = Schema_exports.decodeUnknownEither(InvokeToolParamsSchema)(args2);
|
|
206835
206929
|
return decoded._tag === "Right" ? deriveEditMode(decoded.right.toolName, decoded.right.arguments) : void 0;
|
|
206836
206930
|
};
|
|
206837
|
-
var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyContext, clock3 = liveNowClock, fetchLatestVersion = fetchLatestNpmVersion, exposureOptions = {}) => {
|
|
206931
|
+
var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyContext, clock3 = liveNowClock, fetchLatestVersion = fetchLatestNpmVersion, exposureOptions = {}, toolCallNoticeProvider = noToolCallNoticeProvider) => {
|
|
206838
206932
|
const registries = normalizeRegistries(registry2);
|
|
206839
206933
|
const defaults = defaultExposureOptions();
|
|
206840
206934
|
const protocolExposureOptions = {
|
|
@@ -206866,25 +206960,33 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
206866
206960
|
};
|
|
206867
206961
|
const callTool = async (request3) => {
|
|
206868
206962
|
enter();
|
|
206963
|
+
const noticeClaim = toolCallNoticeProvider.claim();
|
|
206869
206964
|
try {
|
|
206870
206965
|
const { arguments: args2, name } = request3.params;
|
|
206871
206966
|
const exposure = resolveProtocolExposure(registries, protocolExposureOptions);
|
|
206872
206967
|
const start3 = clock3.currentTimeMillis();
|
|
206873
206968
|
const inputBytes = JSON.stringify(args2 ?? {}).length;
|
|
206969
|
+
const withClaimedNotice = (response2) => {
|
|
206970
|
+
if (noticeClaim._tag === "None") return response2;
|
|
206971
|
+
const responseWithNotice2 = appendToolWarnings(response2, [noticeClaim.warning]);
|
|
206972
|
+
noticeClaim.delivered();
|
|
206973
|
+
return responseWithNotice2;
|
|
206974
|
+
};
|
|
206874
206975
|
const returnError = (errorResponse, editMode2) => {
|
|
206976
|
+
const responseWithNotice2 = withClaimedNotice(errorResponse);
|
|
206875
206977
|
const durationMs2 = clock3.currentTimeMillis() - start3;
|
|
206876
206978
|
telemetry.toolCalled({
|
|
206877
206979
|
toolName: name,
|
|
206878
206980
|
status: "error",
|
|
206879
206981
|
clientKind: exposure.context.clientKind,
|
|
206880
206982
|
resolvedMode: exposure.context.resolvedMode,
|
|
206881
|
-
errorTag:
|
|
206983
|
+
errorTag: responseWithNotice2._meta?.errorTag,
|
|
206882
206984
|
durationMs: durationMs2,
|
|
206883
206985
|
inputBytes,
|
|
206884
|
-
outputBytes: computeOutputBytes(
|
|
206986
|
+
outputBytes: computeOutputBytes(responseWithNotice2),
|
|
206885
206987
|
editMode: editMode2
|
|
206886
206988
|
});
|
|
206887
|
-
return toMcpResponse(
|
|
206989
|
+
return toMcpResponse(responseWithNotice2);
|
|
206888
206990
|
};
|
|
206889
206991
|
if (name === VERSION_TOOL_NAME) {
|
|
206890
206992
|
if (!isEmptyArgumentsObject(args2)) return returnError(createUnexpectedArgumentsError(VERSION_TOOL_NAME));
|
|
@@ -206895,7 +206997,7 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
206895
206997
|
} catch {
|
|
206896
206998
|
return returnError(mapDomainErrorToMcp(new HulyError({ message: "Failed to build version result" })));
|
|
206897
206999
|
}
|
|
206898
|
-
const versionResponse = createSuccessResponse(versionResult);
|
|
207000
|
+
const versionResponse = withClaimedNotice(createSuccessResponse(versionResult));
|
|
206899
207001
|
const durationMs2 = clock3.currentTimeMillis() - start3;
|
|
206900
207002
|
telemetry.toolCalled({
|
|
206901
207003
|
toolName: name,
|
|
@@ -206918,7 +207020,7 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
206918
207020
|
} catch {
|
|
206919
207021
|
return returnError(mapDomainErrorToMcp(new HulyError({ message: "Failed to build Huly context" })));
|
|
206920
207022
|
}
|
|
206921
|
-
const contextResponse = createSuccessResponse(context6);
|
|
207023
|
+
const contextResponse = withClaimedNotice(createSuccessResponse(context6));
|
|
206922
207024
|
const durationMs2 = clock3.currentTimeMillis() - start3;
|
|
206923
207025
|
telemetry.toolCalled({
|
|
206924
207026
|
toolName: name,
|
|
@@ -206955,19 +207057,20 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
206955
207057
|
}
|
|
206956
207058
|
}
|
|
206957
207059
|
});
|
|
207060
|
+
const responseWithNotice2 = withClaimedNotice(response2);
|
|
206958
207061
|
const durationMs2 = clock3.currentTimeMillis() - start3;
|
|
206959
207062
|
telemetry.toolCalled({
|
|
206960
207063
|
toolName: name,
|
|
206961
|
-
status:
|
|
207064
|
+
status: responseWithNotice2.isError === true ? "error" : "success",
|
|
206962
207065
|
clientKind: exposure.context.clientKind,
|
|
206963
207066
|
resolvedMode: exposure.context.resolvedMode,
|
|
206964
|
-
errorTag:
|
|
207067
|
+
errorTag: responseWithNotice2._meta?.errorTag,
|
|
206965
207068
|
durationMs: durationMs2,
|
|
206966
207069
|
inputBytes,
|
|
206967
|
-
outputBytes: computeOutputBytes(
|
|
207070
|
+
outputBytes: computeOutputBytes(responseWithNotice2),
|
|
206968
207071
|
editMode: editMode2
|
|
206969
207072
|
});
|
|
206970
|
-
return toMcpResponse(
|
|
207073
|
+
return toMcpResponse(responseWithNotice2);
|
|
206971
207074
|
}
|
|
206972
207075
|
const hulyToolName = parseToolName(name);
|
|
206973
207076
|
if (hulyToolName === void 0) return returnError(createUnknownToolError(name));
|
|
@@ -206997,18 +207100,22 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
206997
207100
|
);
|
|
206998
207101
|
const durationMs = clock3.currentTimeMillis() - start3;
|
|
206999
207102
|
if (response === null) return returnError(createUnknownToolError(name), editMode);
|
|
207103
|
+
const responseWithNotice = withClaimedNotice(response);
|
|
207000
207104
|
telemetry.toolCalled({
|
|
207001
207105
|
toolName: hulyToolName,
|
|
207002
|
-
status:
|
|
207106
|
+
status: responseWithNotice.isError === true ? "error" : "success",
|
|
207003
207107
|
clientKind: exposure.context.clientKind,
|
|
207004
207108
|
resolvedMode: exposure.context.resolvedMode,
|
|
207005
|
-
errorTag:
|
|
207109
|
+
errorTag: responseWithNotice._meta?.errorTag,
|
|
207006
207110
|
durationMs,
|
|
207007
207111
|
inputBytes,
|
|
207008
|
-
outputBytes: computeOutputBytes(
|
|
207112
|
+
outputBytes: computeOutputBytes(responseWithNotice),
|
|
207009
207113
|
editMode
|
|
207010
207114
|
});
|
|
207011
|
-
return toMcpResponse(
|
|
207115
|
+
return toMcpResponse(responseWithNotice);
|
|
207116
|
+
} catch (error2) {
|
|
207117
|
+
if (noticeClaim._tag === "Claimed") noticeClaim.release();
|
|
207118
|
+
throw error2;
|
|
207012
207119
|
} finally {
|
|
207013
207120
|
leave();
|
|
207014
207121
|
}
|
|
@@ -207020,11 +207127,12 @@ var createMcpProtocolHandlers = (resolveClients, telemetry, registry2, getHulyCo
|
|
|
207020
207127
|
listResources: resourceHandlers.listResources,
|
|
207021
207128
|
listResourceTemplates,
|
|
207022
207129
|
readResource: resourceHandlers.readResource,
|
|
207023
|
-
serverDiscover: () => ({
|
|
207130
|
+
serverDiscover: () => parseServerDiscoverResult({
|
|
207024
207131
|
resultType: "complete",
|
|
207025
207132
|
supportedVersions: ["2026-07-28"],
|
|
207026
207133
|
capabilities: { tools: {}, resources: {} },
|
|
207027
|
-
serverInfo: { name: "huly-mcp", version: VERSION }
|
|
207134
|
+
serverInfo: { name: "huly-mcp", version: VERSION },
|
|
207135
|
+
instructions: HOSTED_HULY_MIGRATION_INSTRUCTIONS
|
|
207028
207136
|
}),
|
|
207029
207137
|
drainInflight
|
|
207030
207138
|
};
|
|
@@ -212658,7 +212766,8 @@ var createDefaultMcpSdkServer = () => new Server(
|
|
|
212658
212766
|
capabilities: {
|
|
212659
212767
|
resources: {},
|
|
212660
212768
|
tools: {}
|
|
212661
|
-
}
|
|
212769
|
+
},
|
|
212770
|
+
instructions: HOSTED_HULY_MIGRATION_INSTRUCTIONS
|
|
212662
212771
|
}
|
|
212663
212772
|
);
|
|
212664
212773
|
|
|
@@ -212667,7 +212776,7 @@ var currentClientInfoFromServer = (server) => {
|
|
|
212667
212776
|
const maybeServer = server;
|
|
212668
212777
|
return parseMcpClientInfo(maybeServer.getClientVersion?.());
|
|
212669
212778
|
};
|
|
212670
|
-
var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, createServer = createDefaultMcpSdkServer, exposureOptions = {}) => {
|
|
212779
|
+
var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, createServer = createDefaultMcpSdkServer, exposureOptions = {}, toolCallNoticeProvider = noToolCallNoticeProvider) => {
|
|
212671
212780
|
const server = createServer();
|
|
212672
212781
|
const currentClientInfo = () => exposureOptions.currentClientInfo?.() ?? currentClientInfoFromServer(server);
|
|
212673
212782
|
const handlers = createMcpProtocolHandlers(
|
|
@@ -212680,7 +212789,8 @@ var createMcpServer = (resolveClients, telemetry, registry2, getHulyContext, cre
|
|
|
212680
212789
|
{
|
|
212681
212790
|
...exposureOptions,
|
|
212682
212791
|
currentClientInfo
|
|
212683
|
-
}
|
|
212792
|
+
},
|
|
212793
|
+
toolCallNoticeProvider
|
|
212684
212794
|
);
|
|
212685
212795
|
server.setRequestHandler(ListToolsRequestSchema, handlers.listTools);
|
|
212686
212796
|
server.setRequestHandler(CallToolRequestSchema, handlers.callTool);
|
|
@@ -216743,13 +216853,18 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
|
|
|
216743
216853
|
}
|
|
216744
216854
|
yield* Ref_exports.set(isRunning2, true);
|
|
216745
216855
|
if (config3.transport === "stdio") {
|
|
216856
|
+
const stdioRuntimeConfig = getRuntimeConfigContext();
|
|
216746
216857
|
const [stdioServer, drainInflight] = createMcpServer(
|
|
216747
216858
|
config3.resolveClients,
|
|
216748
216859
|
telemetry,
|
|
216749
216860
|
registries,
|
|
216750
|
-
(toolExposure) => getHulyContext(
|
|
216861
|
+
(toolExposure) => getHulyContext(stdioRuntimeConfig, toolExposure),
|
|
216751
216862
|
config3.createServer,
|
|
216752
|
-
sdkExposureOptions
|
|
216863
|
+
sdkExposureOptions,
|
|
216864
|
+
createHostedHulyMigrationNoticeProvider({
|
|
216865
|
+
delivery: "once",
|
|
216866
|
+
hulyOrigin: stdioRuntimeConfig.huly.url.origin
|
|
216867
|
+
})
|
|
216753
216868
|
);
|
|
216754
216869
|
yield* Ref_exports.set(serverRef, stdioServer);
|
|
216755
216870
|
const transport = config3.createStdioTransport?.() ?? new StdioServerTransport();
|
|
@@ -216809,7 +216924,11 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
|
|
|
216809
216924
|
registries,
|
|
216810
216925
|
(toolExposure) => getHulyContext(requestRuntimeConfig, toolExposure),
|
|
216811
216926
|
config3.createServer,
|
|
216812
|
-
requestExposureOptions(() => clientInfoFromLegacyHttpRequest(req))
|
|
216927
|
+
requestExposureOptions(() => clientInfoFromLegacyHttpRequest(req)),
|
|
216928
|
+
createHostedHulyMigrationNoticeProvider({
|
|
216929
|
+
delivery: "always",
|
|
216930
|
+
hulyOrigin: requestRuntimeConfig.huly.url.origin
|
|
216931
|
+
})
|
|
216813
216932
|
)[0];
|
|
216814
216933
|
},
|
|
216815
216934
|
config3.httpTransportDependencies,
|
|
@@ -216822,7 +216941,11 @@ var McpServerService = class _McpServerService extends Context_exports.Tag("@hul
|
|
|
216822
216941
|
(toolExposure) => getHulyContext(requestRuntimeConfig, toolExposure),
|
|
216823
216942
|
void 0,
|
|
216824
216943
|
void 0,
|
|
216825
|
-
requestExposureOptions(() => clientInfoFromMcp2026Request(req))
|
|
216944
|
+
requestExposureOptions(() => clientInfoFromMcp2026Request(req)),
|
|
216945
|
+
createHostedHulyMigrationNoticeProvider({
|
|
216946
|
+
delivery: "always",
|
|
216947
|
+
hulyOrigin: requestRuntimeConfig.huly.url.origin
|
|
216948
|
+
})
|
|
216826
216949
|
);
|
|
216827
216950
|
}
|
|
216828
216951
|
).pipe(
|