huly-mcp-selfhost 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -27,6 +27,11 @@ HULY_PASSWORD=your-password
27
27
  # Host names clients use to reach the container (reverse proxy / public name),
28
28
  # comma-separated. Without it only localhost is accepted (421 "Invalid Host header").
29
29
  # MCP_ALLOWED_HOSTS=huly-mcp.example.com,huly-mcp.example.com:443
30
+ # Docker: the server's own HTTP endpoint (/mcp) instead of mcp-proxy — persistent sessions,
31
+ # one Huly login per person via X-Huly-Token or X-Huly-Email/X-Huly-Password headers.
32
+ # MCP_TRANSPORT=http
33
+ # Bearer token clients must send; required to use the HULY_* login above over HTTP.
34
+ # MCP_AUTH_TOKEN=
30
35
 
31
36
  # ─── Single workspace (optional) ─────────────────────────────────────────────
32
37
  # Pin this server to one workspace (slug, name or id). Tools then take no
@@ -46,6 +51,9 @@ HULY_PASSWORD=your-password
46
51
  # Tool annotations (title, read-only / destructive) for clients that use them; ~16% larger tool list.
47
52
  # HULY_ANNOTATIONS=1
48
53
 
54
+ # Connect at start-up so the first call is fast (default on); 0 = connect on the first call.
55
+ # HULY_PREWARM=0
56
+
49
57
  # ─── Guard rails for agents (optional) ───────────────────────────────────────
50
58
  # Only allow changes in these projects (reads are never blocked):
51
59
  # HULY_WRITE_PROJECTS=TSK,WEB
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to [huly-mcp-selfhost](https://www.npmjs.com/package/huly-mcp-selfhost). Versions follow [semver](https://semver.org).
4
4
 
5
+ ### 3.4.0 — 2026-11-11
6
+
7
+ - **New: team server over HTTP** — `huly-mcp-selfhost http` (Docker: `MCP_TRANSPORT=http`) serves MCP at `/mcp` with persistent sessions instead of a proxy. Every client can bring its own Huly login (`X-Huly-Token` or `X-Huly-Email`/`X-Huly-Password`, optional `X-Huly-Workspace`), so one server works for a whole team and each person acts as themselves. The server's own login is only used behind `MCP_AUTH_TOKEN`. Measured: first call of a session ~0.2 s.
8
+ - **New: `check_setup`** — one call that diagnoses the setup: version and newer releases, login (incl. API-token expiry), workspaces, front URL, active settings; never prints secrets.
9
+ - **New: `manage_notifications`** — for one object: pin/unpin, hide/unhide, mark unread, unarchive, follow/unfollow. Verified live.
10
+ - **Huly API tokens** (Settings → API tokens) work as `HULY_TOKEN`: the server stays in the token's workspace, checks the expiry before connecting and explains expired or revoked tokens. Built from Huly's source; not yet tested against a live server that issues such tokens.
11
+ - **`list_issues`: two new filters** — `title` (title contains text, case-insensitive) and `due` (`overdue`, `set`, `none`). Both run as one query on the server and combine with all other filters. Verified live on a self-hosted instance.
12
+ - **Faster first call:** the server logs in and opens the workspace (when there is only one, e.g. pinned with `HULY_WORKSPACE`) in the background right after start-up. Measured on a self-hosted instance: first `list_issues` 4.4 s → 0.17 s; start-up itself unchanged. `HULY_PREWARM=0` turns it off; a failed login is reported by the first real call as before.
13
+ - **Fixed: MCP registry entry.** The `server.json` description was longer than the registry's 100 characters, so 3.3.0 was refused there; a test now checks the length and the release workflow warns when the registry refuses an entry.
14
+ - **Docs:** clearer positioning ("Huly for AI agents"), a table of measured token costs and a measured comparison with another popular Huly MCP server (2.9× less text per answer, 14× smaller tool definitions) in the README.
15
+
5
16
  ### 3.3.0 — 2026-11-11
6
17
 
7
18
  - **Claude Code plugin: `/huly:setup`** — the agent asks once per repo how Huly is used there (role, where new issues go, initiative, how token-saving) and writes the answers as a `## Huly` section; every later session follows it. You choose where: `CLAUDE.md` (shared), `CLAUDE.local.md` (only you; added to `.gitignore` if needed) or split — shared rules in `CLAUDE.md`, initiative and efficiency in `CLAUDE.local.md`. The project and its GitHub sync are detected first, so only the questions that matter are asked; "Not now" writes nothing. Optional import: status set, components, milestones, TODO/FIXME proposals, architecture document. The session-start hook reads the rules from all three files and offers `/huly:setup` while a repo has none.
package/README.md CHANGED
@@ -6,19 +6,61 @@
6
6
  [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.jokeks2023%2Fhuly--mcp--selfhost-blue)](https://registry.modelcontextprotocol.io)
7
7
  [![License: EPL-2.0](https://img.shields.io/badge/license-EPL--2.0-blue)](https://github.com/JoKeks2023/huly-mcp/blob/main/LICENSE)
8
8
 
9
- **The MCP server for [Huly](https://huly.io) — self-hosted or Huly Cloud.** Let Claude and other AI agents work in your Huly workspaces: issues, epics, milestones, documents, chat, inbox, planner, test management and more — 224 tools, built to spend as few tokens as possible.
9
+ **Huly for AI agents.** An MCP server for [Huly](https://huly.io) — self-hosted or Huly Cloud — that lets Claude and other agents work in your workspaces: issues, epics, milestones, documents, chat, inbox, planner, test management and more. 226 tools, built for agent workflows and to spend as few tokens as possible.
10
10
 
11
- [Website](https://jokeks2023.github.io/huly-mcp/) · [Quick start](#quick-start) · [Tools](#tools-224-total-grouped-in-toolsets) · [Claude Code plugin](#claude-code-plugin) · [Changelog](https://github.com/JoKeks2023/huly-mcp/blob/main/CHANGELOG.md)
11
+ [Website](https://jokeks2023.github.io/huly-mcp/) · [Quick start](#quick-start) · [Tools](#tools-226-total-grouped-in-toolsets) · [Claude Code plugin](#claude-code-plugin) · [Changelog](https://github.com/JoKeks2023/huly-mcp/blob/main/CHANGELOG.md)
12
12
 
13
13
  ## Highlights
14
14
 
15
15
  - **Everything in Huly:** tracker, documents, chat, inbox, activity, planner, calendar, GitHub PRs, contacts, drive, cards, templates, test management, recruiting, CRM, HR and more — plus read access to *any* Huly class.
16
16
  - **Made for agents:** one-call overviews (`my_day`, `standup`, `project_report`, `get_issue_context`), `start_work` → `finish_work`, plans → epics with sub-issues, specs and meeting notes → issues, claims for parallel agents, and `huly-mcp watch` to hand issues to Claude from Huly.
17
- - **Few tokens:** tools come in toolsets (default ≈10k tokens, everything ≈23k), optionally loaded on demand; pin a workspace for −10 %; compact outputs; wrong parameters are rejected with the valid list instead of silently ignored.
17
+ - **Few tokens:** tools come in toolsets (default ≈11k tokens, everything ≈24k), optionally loaded on demand; pin a workspace for −10 %; compact outputs; wrong parameters are rejected with the valid list instead of silently ignored.
18
18
  - **Safe by default:** every change names its workspace, risky tools ask first, writes can be limited to projects, optional audit log.
19
19
  - **Claude Code plugin:** `/huly:setup` asks once per repo how Huly is used there and writes the rules; skill, hooks and `/huly:*` commands. Guides and a `setup` prompt for every other MCP client too.
20
20
  - **Self-hosted first:** document and description content, file uploads and internal URLs work on `huly-selfhost`; one account, all its workspaces.
21
21
 
22
+ ## Tokens, measured
23
+
24
+ What the model reads — measured on a real self-hosted project (≈60 issues):
25
+
26
+ | | Characters | ≈ Tokens |
27
+ |---|--:|--:|
28
+ | Tool list, default toolsets (98 tools, each callable directly) | 37,435 | 10.7k |
29
+ | Tool list, pinned workspace | 33,798 | 9.7k |
30
+ | Open issues of a project (one call, ≈30 issues) | 2,768 | 0.8k |
31
+ | One issue with description | 318 | 0.1k |
32
+ | Project report (done, in progress, blocked, milestones, PRs, time) | ~2,700 | 0.8k |
33
+ | My day (calendar, to-dos, my issues, PRs, inbox) | ~1,200 | 0.3k |
34
+
35
+ Lists default to open items, empty fields are left out, and one call answers what would otherwise take four or five. Per call and question: [`costs.md`](https://github.com/JoKeks2023/huly-mcp/blob/main/plugin/skills/huly/costs.md).
36
+
37
+ ### Compared with another popular Huly MCP server
38
+
39
+ <picture>
40
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JoKeks2023/huly-mcp/main/docs/assets/benchmark-dark.svg">
41
+ <img alt="Characters per answer: huly-mcp-selfhost needs 2.9× less text per answer (median), 14× smaller tool definitions, one call instead of up to four" src="https://raw.githubusercontent.com/JoKeks2023/huly-mcp/main/docs/assets/benchmark-light.svg" width="900">
42
+ </picture>
43
+
44
+ Same self-hosted Huly, same questions, the best parameters on both sides, measured 2026-11-11. For the other server only the text content is counted, not the duplicate JSON copy it also returns. Where we return more (components), it is because we include each component's description and code paths.
45
+
46
+ <details>
47
+ <summary>All numbers (characters)</summary>
48
+
49
+ | Question | huly-mcp-selfhost | Other server | Ratio |
50
+ |---|--:|--:|--:|
51
+ | Open issues of a project | 2,768 (1 call) | 11,601 (3 calls) | 4.2× less |
52
+ | Issues in progress | 211 (1 call) | 790 (1 call) | 3.7× less |
53
+ | One issue | 318 (1 call) | 585 (1 call) | 1.8× less |
54
+ | Everything about an issue (fields, sub-issues, comments, relations) | 1,246 (1 call) | 3,585 (4 calls) | 2.9× less |
55
+ | Search | 406 (1 call) | 1,405 (1 call) | 3.5× less |
56
+ | Projects | 550 (1 call) | 1,041 (1 call) | 1.9× less |
57
+ | Milestones | 208 (1 call) | 503 (1 call) | 2.4× less |
58
+ | Components | 1,302 (1 call) | 692 (1 call) | 2.0× more |
59
+ | Documents of a teamspace | 106 (1 call) | 305 (1 call) | 2.9× less |
60
+ | Tool definitions (49 tools with the same name) | 15,728 | 216,890 | 13.8× less |
61
+
62
+ </details>
63
+
22
64
  ## Quick start
23
65
 
24
66
  You need Node.js 20+ and a Huly account — [Huly Cloud](https://huly.app) or self-hosted.
@@ -55,7 +97,7 @@ Then run `/huly:setup` in a repository. Details: [Claude Code plugin](#claude-co
55
97
 
56
98
  Config file locations and examples for each client: [Compatible clients](#compatible-clients).
57
99
 
58
- **Server for a team or remote clients** — run the Docker image (HTTP/SSE on port 8000): see [Docker](#docker).
100
+ **Server for a team or remote clients** — `huly-mcp-selfhost http` or the Docker image, with one Huly login per person: see [Team server over HTTP](#team-server-over-http).
59
101
 
60
102
  Then ask: *"What's on my plate today?"*, *"Plan the login redesign as an epic in WEB"*, *"Write release notes for v1.2"*. More in [Example prompts](#example-prompts).
61
103
 
@@ -70,7 +112,7 @@ The repo is also a Claude Code plugin marketplace. The plugin bundles the MCP se
70
112
  /plugin install huly@huly-mcp
71
113
  ```
72
114
 
73
- > **Note:** the plugin starts the npm package at exactly its own version (e.g. `huly-mcp-selfhost@3.3.0`; the plugin directory does not accept version ranges), so a plugin update brings the matching server. To try a local checkout instead: `npm run build`, then point `plugin/.mcp.json` at `dist/index.js` and start `claude --plugin-dir ./plugin`.
115
+ > **Note:** the plugin starts the npm package at exactly its own version (e.g. `huly-mcp-selfhost@3.4.0`; the plugin directory does not accept version ranges), so a plugin update brings the matching server. To try a local checkout instead: `npm run build`, then point `plugin/.mcp.json` at `dist/index.js` and start `claude --plugin-dir ./plugin`.
74
116
 
75
117
  Claude Code then asks for your Huly settings (e-mail + password or token, and for self-hosted Huly the accounts and front URL; passwords and tokens go to the OS keychain).
76
118
 
@@ -91,7 +133,7 @@ Without the plugin, the same server works in Claude Code as a plain MCP server (
91
133
 
92
134
  ---
93
135
 
94
- ## Tools (224 total, grouped in toolsets)
136
+ ## Tools (226 total, grouped in toolsets)
95
137
 
96
138
  All tools except `list_workspaces` take a `workspace` argument — required for every change, optional for reads when only one workspace is available.
97
139
 
@@ -101,7 +143,7 @@ Every tool schema is sent to the model in each session (Claude Desktop loads all
101
143
 
102
144
  ```bash
103
145
  HULY_TOOLSETS=all # everything
104
- HULY_TOOLSETS=tracker,documents,planner # just these ('core' = list_workspaces is always on)
146
+ HULY_TOOLSETS=tracker,documents,planner # just these ('core' = list_workspaces and check_setup, always on)
105
147
  ```
106
148
 
107
149
  **Load on demand** (`HULY_DYNAMIC_TOOLSETS=1`): `HULY_TOOLSETS` becomes the starting set, and Claude loads more toolsets itself via `enable_toolsets`. Called without arguments, it lists every toolset with its tools; called with names, it loads them and tells the client that the tool list changed. With `HULY_TOOLSETS=agent,inbox` a session starts at ≈1.8k tokens instead of ≈9–11k. This needs a client that reloads the tool list on `notifications/tools/list_changed`: it is tested with the MCP SDK client, but **not yet verified in Claude Desktop**. Without the variable, nothing changes.
@@ -113,7 +155,7 @@ HULY_TOOLSETS=tracker,documents,planner # just these ('core' = list_workspaces i
113
155
  | `documents` | ✓ | 8 | teamspaces and documents (tree, move, rename) |
114
156
  | `chat` | ✓ | 12 | channels, DMs, threads, edit/delete, reactions, pins |
115
157
  | `contacts` | ✓ | 11 | members, organizations, persons, contact channels |
116
- | `inbox` | ✓ | 3 | notifications, triage (what changed since last read), mark read/archive |
158
+ | `inbox` | ✓ | 4 | notifications, triage (what changed since last read), mark read/archive; pin, hide, mark unread, follow/unfollow per object |
117
159
  | `activity` | ✓ | 1 | change history of an issue/object |
118
160
  | `planner` | ✓ | 5 | to-dos, time blocking |
119
161
  | `generic` | ✓ | 4 | fulltext search across everything, read any Huly class |
@@ -140,10 +182,10 @@ HULY_TOOLSETS=tracker,documents,planner # just these ('core' = list_workspaces i
140
182
 
141
183
  Context cost of `tools/list` (≈3.5 chars/token):
142
184
 
143
- | | default (96 tools) | `all` (224 tools) |
185
+ | | default (98 tools) | `all` (226 tools) |
144
186
  |---|--:|--:|
145
- | several workspaces | ~36.5k chars ≈ **10.4k tokens** | ~81.6k chars ≈ **23.3k tokens** |
146
- | pinned with `HULY_WORKSPACE` | ~33k chars ≈ **9.4k tokens** | ~73.3k chars ≈ **20.9k tokens** |
187
+ | several workspaces | ~37.4k chars ≈ **10.7k tokens** | ~82.5k chars ≈ **23.6k tokens** |
188
+ | pinned with `HULY_WORKSPACE` | ~33.8k chars ≈ **9.7k tokens** | ~74.1k chars ≈ **21.2k tokens** |
147
189
 
148
190
  For comparison, 2.2.0 needed ≈12.8k tokens for 64 tools. **Using one workspace? Set `HULY_WORKSPACE`** — the `workspace` argument then disappears from every tool (−10%). **Claude Code** loads MCP tools on demand, so there even `HULY_TOOLSETS=all` costs little up front.
149
191
 
@@ -223,11 +265,12 @@ Options: `--run <name>`, `--parent-suite <suite>`, `--no-create` (only existing
223
265
  | Category | Tool | Description |
224
266
  |----------|------|-------------|
225
267
  | **Workspaces** | `list_workspaces` | List the workspaces this account can access (name, slug, id) |
268
+ | | `check_setup` | Diagnose the setup in one call: version and whether a newer one exists, login (incl. API-token expiry), workspaces, front URL reachable, active settings — never prints secrets |
226
269
  | **Projects** | `list_projects` | List all projects in a workspace |
227
270
  | | `get_project` | Get project details + available statuses |
228
271
  | | `create_project` | Create a new tracker project with a unique identifier *(tracker-admin)* |
229
272
  | | `update_project` | Change name, description, default assignee or default status *(tracker-admin)* |
230
- | **Issues** | `list_issues` | List issues — open ones by default (`status: "all"` or a status name for others), filterable by priority, milestone, component, label, assignee, parent; `offset` pages through long lists ("51–100 of 118") |
273
+ | **Issues** | `list_issues` | List issues — open ones by default (`status: "all"` or a status name for others), filterable by priority, milestone, component, label, assignee, parent (`null` = none for each), text in the title and due date (`overdue`, `set`, `none`); `offset` pages through long lists ("51–100 of 118") |
231
274
  | | `get_issue` | Full details of an issue (e.g. `PROJ-42`): assignee, milestone, component, labels, parent, links |
232
275
  | | `create_issue` | Create a new issue (with optional Markdown description) |
233
276
  | | `update_issue` | Update title, description, status, priority, assignee, due date, component, milestone |
@@ -303,6 +346,7 @@ Options: `--run <name>`, `--parent-suite <suite>`, `--no-create` (only existing
303
346
  | **Inbox** (`inbox`) | `list_notifications` | Your notifications, grouped by issue/PR/document |
304
347
  | | `triage_inbox` | Work through the inbox in one call: per unread item its status and assignee, which fields changed and the new comments (plain text, shortened) since you last read it |
305
348
  | | `mark_notifications_read` | Mark read by object, ids or all; optionally archive |
349
+ | | `manage_notifications` | For one object: `pin`/`unpin`, `hide`/`unhide`, `unread`, `unarchive`, `follow`/`unfollow` (follow = its changes reach your inbox) |
306
350
  | **Activity** (`activity`) | `get_activity` | Who changed what, plus comments, for an issue or object |
307
351
  | **Planner** (`planner`) | `list_todos` | Your to-dos (open/done, due date filter) |
308
352
  | | `create_todo` | Create a to-do, optionally attached to an issue |
@@ -399,6 +443,9 @@ A single Huly account can belong to several workspaces — e.g. a personal one a
399
443
  | `HULY_AGENT_NAME` | no | Default agent name for `claim_issue` (default `claude`) |
400
444
  | `HULY_CONFIRM` | no | `auto` (default), `strict` or `off` — ask before deletes and other risky tools (see [Agent workflow](#agent-workflow)) |
401
445
  | `HULY_FILE_ROOT` | no | Directory for local files: `upload_file` (`localPath`) and `download_file` (`savePath`) only work inside it. Off when unset — the server may run remotely |
446
+ | `MCP_TRANSPORT` | no | Docker only: `http` = the server's own HTTP endpoint (`/mcp`, per-user logins) instead of mcp-proxy (see [Team server over HTTP](#team-server-over-http)) |
447
+ | `MCP_AUTH_TOKEN` | no | HTTP mode: bearer token every client must send; required before the server's own `HULY_*` login is used over HTTP |
448
+ | `HULY_PREWARM` | no | `0` turns off connecting at start-up. By default the server logs in (and opens the workspace when there is only one) right after it starts, so the first tool call answers in well under a second instead of 4–12 s |
402
449
  | `HULY_SUBSCRIBE_POLL_MS` | no | How often subscribed `huly://` resources are checked for changes (default 30000, minimum 5000) |
403
450
 
404
451
  ---
@@ -433,6 +480,10 @@ A token copied from the browser (DevTools → Application → Local Storage →
433
480
 
434
481
  > Tokens expire after some time. If you get an auth error, run `npx huly-mcp-selfhost setup` again or switch to email + password.
435
482
 
483
+ **Option C — API token (Huly → Settings → API tokens; in Huly's development branch since 2026-08, not yet in every release or self-hosted install):** bound to one workspace, with an expiry date, revocable without changing your password — the best choice for agents and CI. Use it as `HULY_TOKEN`. The server keeps it to its own workspace (even where Huly itself would allow switching), checks the expiry up front, and `check_setup` warns two weeks before it runs out. Tested against Huly's token format, not yet against a live server that issues such tokens.
484
+
485
+ **Something not working?** Ask Claude to run `check_setup`: version (and whether a newer one exists), login, workspaces, whether the front URL is reachable and which settings are active — without printing secrets.
486
+
436
487
  **Self-hosted Huly:**
437
488
 
438
489
  ```bash
@@ -627,7 +678,7 @@ For network access (HTTP/SSE) use the [Docker image](#docker).
627
678
 
628
679
  ### npx (recommended)
629
680
 
630
- Every client example uses `"command": "npx", "args": ["-y", "huly-mcp-selfhost"]`. Pin a version (`huly-mcp-selfhost@3.3.0`) if you want updates only when you choose.
681
+ Every client example uses `"command": "npx", "args": ["-y", "huly-mcp-selfhost"]`. Pin a version (`huly-mcp-selfhost@3.4.0`) if you want updates only when you choose.
631
682
 
632
683
  ### From source
633
684
 
@@ -657,6 +708,26 @@ docker compose up -d
657
708
 
658
709
  The container wraps the server with [`mcp-proxy`](https://github.com/sparfenyuk/mcp-proxy) to expose it over HTTP/SSE at `:8000/sse`, since standard MCP stdio transport can't be reached over a network directly. **Behind a reverse proxy or on a public hostname, set `MCP_ALLOWED_HOSTS`** to the host name(s) clients use, e.g. `MCP_ALLOWED_HOSTS=huly-mcp.example.com`. Otherwise mcp-proxy only accepts `localhost` and answers `421 Invalid Host header`. See [`Dockerfile`](https://github.com/JoKeks2023/huly-mcp/blob/main/Dockerfile) / [`docker-compose.yml`](https://github.com/JoKeks2023/huly-mcp/blob/main/docker-compose.yml).
659
710
 
711
+ ### Team server over HTTP
712
+
713
+ `huly-mcp-selfhost http` serves MCP over Streamable HTTP at `/mcp` (health check `/healthz`) — no proxy, one long-lived session per client, so logins and connections are reused (the first call of a session takes ~0.2 s). In Docker: `MCP_TRANSPORT=http`.
714
+
715
+ ```bash
716
+ npx huly-mcp-selfhost http --host 0.0.0.0 --port 8000
717
+ ```
718
+
719
+ **Everyone with their own Huly account.** A client sends its own login as headers; the session then acts as that person:
720
+
721
+ ```bash
722
+ claude mcp add --transport http huly https://huly-mcp.example.com/mcp \
723
+ --header "X-Huly-Token: <your token>" # or X-Huly-Email + X-Huly-Password
724
+ # optional: --header "X-Huly-Workspace: acme" # pin one workspace (fewer tokens)
725
+ ```
726
+
727
+ **One shared account.** The server's own `HULY_*` login is only used behind a bearer token — set `MCP_AUTH_TOKEN` and give clients `Authorization: Bearer <token>`. Without it an open port would act as that account, so the server refuses and asks for per-user headers instead. With `MCP_AUTH_TOKEN` set, every request needs the bearer token, also when it brings its own login.
728
+
729
+ Set `MCP_ALLOWED_HOSTS` to the host names clients use (DNS-rebinding protection). Use HTTPS (reverse proxy) as soon as logins travel over a network. Idle sessions close after 30 minutes.
730
+
660
731
  ---
661
732
 
662
733
  ## Example prompts
@@ -878,7 +949,7 @@ See [CHANGELOG.md](https://github.com/JoKeks2023/huly-mcp/blob/main/CHANGELOG.md
878
949
 
879
950
  ## Credits
880
951
 
881
- Started as a fork of [varaprasadreddy9676/huly-mcp](https://github.com/varaprasadreddy9676/huly-mcp) (npm `huly-mcp-sdk`) by SaiVaraprasad Medapati and grown from its 33 tools to 224, with self-hosted support, toolsets, agent workflow and the Claude Code plugin. Published separately as `huly-mcp-selfhost`. Not affiliated with Huly Labs.
952
+ Started as a fork of [varaprasadreddy9676/huly-mcp](https://github.com/varaprasadreddy9676/huly-mcp) (npm `huly-mcp-sdk`) by SaiVaraprasad Medapati and grown from its 33 tools to 226, with self-hosted support, toolsets, agent workflow and the Claude Code plugin. Published separately as `huly-mcp-selfhost`. Not affiliated with Huly Labs.
882
953
 
883
954
  ## Links
884
955
 
@@ -16,6 +16,12 @@ export interface WorkspaceConnection {
16
16
  wsToken: string;
17
17
  workspaceUuid: string;
18
18
  }
19
+ /** Claims of a Huly JWT, read without verifying it (the account service verifies). */
20
+ export declare function tokenClaims(token: string | undefined): {
21
+ workspace?: string;
22
+ exp?: number;
23
+ apiTokenId?: string;
24
+ } | undefined;
19
25
  interface OpenConnection {
20
26
  client: TxOperations;
21
27
  close: () => Promise<void>;
@@ -63,6 +69,15 @@ export declare class WorkspaceConnectionManager {
63
69
  * HULY_TRANSACTOR_URL replaces it, e.g. ws://huly/_transactor or ws://transactor:3333.
64
70
  */
65
71
  export declare function transactorEndpoint(endpoint: string, override: string | undefined): string;
72
+ /** Runs fn (and everything it starts) with this manager instead of the process-wide one. */
73
+ export declare function withConnectionManager<T>(m: WorkspaceConnectionManager, fn: () => T): T;
74
+ /** A manager for one set of credentials; URLs and the transactor override come from the environment. */
75
+ export declare function createConnectionManager(creds: {
76
+ email?: string;
77
+ password?: string;
78
+ token?: string;
79
+ workspace?: string;
80
+ }, env?: NodeJS.ProcessEnv): WorkspaceConnectionManager;
66
81
  export declare function getConnectionManager(): WorkspaceConnectionManager;
67
82
  /** Replace the process-wide manager (tests). */
68
83
  export declare function setConnectionManager(next: WorkspaceConnectionManager | null): void;
@@ -74,5 +89,12 @@ export declare function getWorkspaceInfo(workspace?: string): Promise<{
74
89
  wsToken: string;
75
90
  workspaceUuid: string;
76
91
  }>;
92
+ /**
93
+ * Connect in the background right after start-up, so the first tool call does not pay for the
94
+ * account login, workspace discovery and the workspace model load (measured 4–12 s on a
95
+ * self-hosted instance). With one workspace (pinned or the only one) its connection is opened
96
+ * too. Never throws: a failure here is reported by the first real call. HULY_PREWARM=0 turns it off.
97
+ */
98
+ export declare function prewarm(env?: NodeJS.ProcessEnv): Promise<'off' | 'no-credentials' | 'account' | 'workspace' | 'failed'>;
77
99
  export declare function closeConnection(): Promise<void>;
78
100
  export {};
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkspaceConnectionManager = void 0;
4
+ exports.tokenClaims = tokenClaims;
4
5
  exports.transactorEndpoint = transactorEndpoint;
6
+ exports.withConnectionManager = withConnectionManager;
7
+ exports.createConnectionManager = createConnectionManager;
5
8
  exports.getConnectionManager = getConnectionManager;
6
9
  exports.setConnectionManager = setConnectionManager;
7
10
  exports.listWorkspaces = listWorkspaces;
@@ -9,10 +12,26 @@ exports.getWorkspace = getWorkspace;
9
12
  exports.getConnection = getConnection;
10
13
  exports.getAccountClient = getAccountClient;
11
14
  exports.getWorkspaceInfo = getWorkspaceInfo;
15
+ exports.prewarm = prewarm;
12
16
  exports.closeConnection = closeConnection;
17
+ const node_async_hooks_1 = require("node:async_hooks");
13
18
  const account_client_1 = require("@hcengineering/account-client");
14
19
  const core_1 = require("@hcengineering/core");
15
20
  const server_client_1 = require("@hcengineering/server-client");
21
+ /** Claims of a Huly JWT, read without verifying it (the account service verifies). */
22
+ function tokenClaims(token) {
23
+ const part = token?.split('.')[1];
24
+ if (part == null)
25
+ return undefined;
26
+ try {
27
+ const claims = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));
28
+ return { workspace: claims.workspace, exp: typeof claims.exp === 'number' ? claims.exp : undefined, apiTokenId: claims.extra?.apiTokenId };
29
+ }
30
+ catch {
31
+ return undefined;
32
+ }
33
+ }
34
+ const TOKEN_HELP = 'API token: create a new one in Huly → Settings → API tokens. Account token: npx huly-mcp-selfhost setup.';
16
35
  async function defaultOpenConnection(endpoint, token, socialId) {
17
36
  const raw = await (0, server_client_1.createClient)(endpoint, token);
18
37
  return { client: new core_1.TxOperations(raw, socialId), close: async () => await raw.close() };
@@ -135,16 +154,22 @@ class WorkspaceConnectionManager {
135
154
  async login() {
136
155
  const { accountsUrl, email, password, token } = this.opts;
137
156
  if (token != null && token !== '') {
138
- // Token auth — for SSO accounts (Google/GitHub login on huly.app).
157
+ // Token auth — SSO accounts (Google/GitHub) and managed API tokens.
158
+ const claims = tokenClaims(token);
159
+ if (claims?.exp != null && claims.exp * 1000 <= Date.now()) {
160
+ throw new Error(`HULY_TOKEN expired on ${new Date(claims.exp * 1000).toISOString().slice(0, 10)}. ${TOKEN_HELP}`);
161
+ }
139
162
  const accountClient = this.createAccountClient(accountsUrl, token);
140
- const info = await accountClient.getLoginInfoByToken();
163
+ const info = await accountClient.getLoginInfoByToken().catch((e) => {
164
+ throw new Error(`HULY_TOKEN was refused (${e.message}) — invalid, expired or revoked. ${TOKEN_HELP}`);
165
+ });
141
166
  if (info == null) {
142
- throw new Error('HULY_TOKEN is invalid or expired. Please get a fresh token (npm run setup).');
167
+ throw new Error(`HULY_TOKEN is invalid, expired or revoked. ${TOKEN_HELP}`);
143
168
  }
144
169
  if (!('socialId' in info) || info.socialId == null) {
145
170
  throw new Error('Token auth: no socialId returned for HULY_TOKEN.');
146
171
  }
147
- const session = { accountClient, socialId: info.socialId };
172
+ const session = { accountClient, socialId: info.socialId, apiToken: claims?.apiTokenId != null };
148
173
  if ('endpoint' in info && info.endpoint != null && info.token != null) {
149
174
  // Workspace-scoped token: its own workspace is usable directly.
150
175
  session.preselected = {
@@ -169,7 +194,12 @@ class WorkspaceConnectionManager {
169
194
  const session = await this.getSession();
170
195
  let all;
171
196
  try {
172
- all = (await session.accountClient.getUserWorkspaces()).map(toRef);
197
+ // A managed API token is created for one workspace. The account service would hand out
198
+ // tokens for the account's other workspaces too; this server keeps the promise instead.
199
+ if (session.apiToken === true && session.preselected !== undefined)
200
+ all = [session.preselected.workspace];
201
+ else
202
+ all = (await session.accountClient.getUserWorkspaces()).map(toRef);
173
203
  }
174
204
  catch (err) {
175
205
  // A workspace-scoped HULY_TOKEN may not be allowed to enumerate — fall back to its own workspace.
@@ -231,7 +261,27 @@ function transactorEndpoint(endpoint, override) {
231
261
  }
232
262
  // ── Process-wide manager (configured from env) ──────────────────────────────
233
263
  let manager = null;
264
+ // HTTP mode: every session can bring its own Huly login; its tool calls run inside this scope.
265
+ const scoped = new node_async_hooks_1.AsyncLocalStorage();
266
+ /** Runs fn (and everything it starts) with this manager instead of the process-wide one. */
267
+ function withConnectionManager(m, fn) {
268
+ return scoped.run(m, fn);
269
+ }
270
+ /** A manager for one set of credentials; URLs and the transactor override come from the environment. */
271
+ function createConnectionManager(creds, env = process.env) {
272
+ return new WorkspaceConnectionManager({
273
+ accountsUrl: env.HULY_ACCOUNTS_URL ?? 'https://account.huly.app',
274
+ email: creds.email,
275
+ password: creds.password,
276
+ token: creds.token,
277
+ restrictTo: creds.workspace,
278
+ transactorUrl: env.HULY_TRANSACTOR_URL
279
+ });
280
+ }
234
281
  function getConnectionManager() {
282
+ const own = scoped.getStore();
283
+ if (own != null)
284
+ return own;
235
285
  if (manager === null) {
236
286
  manager = new WorkspaceConnectionManager({
237
287
  accountsUrl: process.env.HULY_ACCOUNTS_URL ?? 'https://account.huly.app',
@@ -264,6 +314,29 @@ async function getWorkspaceInfo(workspace) {
264
314
  const { wsToken, workspaceUuid } = await getWorkspace(workspace);
265
315
  return { wsToken, workspaceUuid };
266
316
  }
317
+ /**
318
+ * Connect in the background right after start-up, so the first tool call does not pay for the
319
+ * account login, workspace discovery and the workspace model load (measured 4–12 s on a
320
+ * self-hosted instance). With one workspace (pinned or the only one) its connection is opened
321
+ * too. Never throws: a failure here is reported by the first real call. HULY_PREWARM=0 turns it off.
322
+ */
323
+ async function prewarm(env = process.env) {
324
+ if (['0', 'false', 'no', 'off'].includes(String(env.HULY_PREWARM ?? '').trim().toLowerCase()))
325
+ return 'off';
326
+ const set = (v) => (v ?? '').trim() !== '';
327
+ if (!set(env.HULY_TOKEN) && !(set(env.HULY_EMAIL) && set(env.HULY_PASSWORD)))
328
+ return 'no-credentials';
329
+ try {
330
+ const workspaces = await listWorkspaces();
331
+ if (workspaces.length !== 1)
332
+ return 'account';
333
+ await getWorkspace();
334
+ return 'workspace';
335
+ }
336
+ catch {
337
+ return 'failed';
338
+ }
339
+ }
267
340
  async function closeConnection() {
268
341
  if (manager !== null)
269
342
  await manager.closeAll();
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAoG;AACpG,8CAA4G;AAC5G,gEAA2D;AA2D3D,KAAK,UAAU,qBAAqB,CAAE,QAAgB,EAAE,KAAa,EAAE,QAAkB;IACvF,MAAM,GAAG,GAAW,MAAM,IAAA,4BAAY,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IACvD,OAAO,EAAE,MAAM,EAAE,IAAI,mBAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAA;AAC1F,CAAC;AAED,SAAS,KAAK,CAAE,EAA2B;IACzC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACrB,GAAG,EAAE,EAAE,CAAC,GAAG;QACX,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG;QACvB,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACnD,UAAU,EAAE,EAAE,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,SAAS,QAAQ,CAAE,EAAgB;IACjC,OAAO,EAAE,CAAC,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AAC;AAEM,KAAK,2BAA4B,SAAkB;IACxD,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAA;IAChE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;AACnC,CAAC;AAED;;;;;GAKG;AACI,KAAK,kBAAmB,GAAG,GAAsB,OAAO,CAAC,GAAG;IACjE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAAE,OAAO,KAAK,CAAA;IAC3G,MAAM,GAAG,GAAG,CAAC,CAAqB,EAAW,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;IACvE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAAE,OAAO,gBAAgB,CAAA;IACrG,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,cAAc,EAAE,CAAA;QACzC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAA;QAC7C,MAAM,YAAY,EAAE,CAAA;QACpB,OAAO,WAAW,CAAA;IACpB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAA;IACjB,CAAC;AACH,CAAC;AAEM,KAAK;IACV,IAAI,OAAO,KAAK,IAAI;QAAE,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;AAChD,CAAC"}
@@ -12,12 +12,13 @@ Every Huly call costs a round trip and its output stays in context. Aim for **on
12
12
  | Everything about PROJ-12 before working on it | `get_issue_context` | ~1.3k | `get_issue` + `list_sub_issues` + `list_comments` + relations (4+ calls) |
13
13
  | Status/assignee of PROJ-12 | `get_issue` | ~0.4k | `get_issue_context` |
14
14
  | What changed? | `changes_since` with `projectIdentifiers` and a short `since` | — | whole workspace for 7d: ~8k |
15
+ | Inbox housekeeping for one object (pin, hide, unread, follow) | `manage_notifications` | small | several updates |
15
16
  | What needs my attention? | `triage_inbox` with a small `limit` | ~4k at 10 | `list_notifications` + `get_issue` per item |
16
17
  | What's in release v1.2? | `release_notes` | ~2k | `list_issues milestoneLabel=…` + reading every issue |
17
18
  | Find issues about X | `search_issues` | ~2k | `list_issues status=all` and scanning |
18
19
  | Find anything (docs, chat, issues) | `search` | ~2.5k | several list calls |
19
20
 
20
- **Narrow lists with filters, not by reading them:** `list_issues` takes `status` (`open` default, `all`, or a name), `assignee` (`null` = unassigned), `milestoneLabel`, `componentLabel`, `labelName`, `parentIdentifier` (`null` = top level) and `limit`.
21
+ **Narrow lists with filters, not by reading them:** `list_issues` takes `status` (`open` default, `all`, or a name), `assignee` (`null` = unassigned), `milestoneLabel`, `componentLabel`, `labelName`, `parentIdentifier` (`null` = top level), `title` (contains text), `due` (`overdue`, `set`, `none`) and `limit`.
21
22
 
22
23
  **Avoid** `query_documents` / generic tools when a specific tool exists: one issue there is ~1.8k raw fields vs ~0.4k from `get_issue`. Use them only for classes without a tool.
23
24
 
@@ -19,7 +19,7 @@ Keep Huly current as you work, in the same turn as the action. Every call costs
19
19
  | Everything about PROJ-12 | `get_issue_context` (just status/assignee: `get_issue`) |
20
20
  | Find something | `search_issues`, `search` — not `list_issues status=all` |
21
21
 
22
- Narrow lists with filters (`status`, `assignee`, `milestoneLabel`, `componentLabel`, `parentIdentifier`, `limit`). More questions with measured sizes: [costs.md](costs.md).
22
+ Narrow lists with filters (`status`, `assignee`, `milestoneLabel`, `componentLabel`, `parentIdentifier`, `title`, `due: overdue`, `limit`). More questions with measured sizes: [costs.md](costs.md).
23
23
 
24
24
  ## 2. Pick up and hand back
25
25
 
@@ -54,4 +54,5 @@ Narrow lists with filters (`status`, `assignee`, `milestoneLabel`, `componentLab
54
54
  - Bulk changes, `move_issue`, deletes: show what will change first.
55
55
  - GitHub-synced projects: every change appears on GitHub too; don't cross-post.
56
56
  - `HULY_WRITE_PROJECTS` refusals: tell the user, don't work around them.
57
+ - Huly calls fail with login/connection errors: run `check_setup` and show the user what it says.
57
58
  - A tool you need is missing: it is in a disabled toolset — `enable_toolsets` if available, otherwise tell the user which toolset to enable ([features.md](features.md)).
package/dist/http.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import http from 'node:http';
2
+ import { type WorkspaceConnectionManager } from './connection';
3
+ export interface HttpOptions {
4
+ port: number;
5
+ host: string;
6
+ env: NodeJS.ProcessEnv;
7
+ /** Tests: build the manager for a set of credentials. */
8
+ createManager?: (creds: Credentials) => WorkspaceConnectionManager;
9
+ idleMs?: number;
10
+ log?: (line: string) => void;
11
+ }
12
+ export interface Credentials {
13
+ email?: string;
14
+ password?: string;
15
+ token?: string;
16
+ workspace?: string;
17
+ }
18
+ /** Credentials sent by the client, if any. */
19
+ export declare function headerCredentials(req: http.IncomingMessage): Credentials | undefined;
20
+ export declare function allowedHosts(value: string | undefined, port: number): string[] | undefined;
21
+ export declare function startHttpServer(opts: HttpOptions): http.Server;
22
+ export declare function runHttp(argv: string[]): Promise<void>;