@cyanheads/hn-mcp-server 0.5.20 → 0.5.22
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/AGENTS.md +19 -18
- package/CLAUDE.md +19 -18
- package/Dockerfile +93 -35
- package/README.md +19 -14
- package/changelog/0.5.x/0.5.21.md +38 -0
- package/changelog/0.5.x/0.5.22.md +45 -0
- package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-stories.tool.js +23 -12
- package/dist/mcp-server/tools/definitions/get-stories.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts +3 -2
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.js +194 -104
- package/dist/mcp-server/tools/definitions/get-thread.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.js +22 -9
- package/dist/mcp-server/tools/definitions/get-user.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts +93 -0
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.js +326 -63
- package/dist/mcp-server/tools/definitions/search-content.tool.js.map +1 -1
- package/dist/mcp-server/tools/served-at-cap.d.ts +14 -0
- package/dist/mcp-server/tools/served-at-cap.d.ts.map +1 -0
- package/dist/mcp-server/tools/served-at-cap.js +16 -0
- package/dist/mcp-server/tools/served-at-cap.js.map +1 -0
- package/dist/mcp-server/tools/thread-cursor.d.ts +68 -0
- package/dist/mcp-server/tools/thread-cursor.d.ts.map +1 -0
- package/dist/mcp-server/tools/thread-cursor.js +200 -0
- package/dist/mcp-server/tools/thread-cursor.js.map +1 -0
- package/dist/services/hn/hn-service.d.ts +29 -4
- package/dist/services/hn/hn-service.d.ts.map +1 -1
- package/dist/services/hn/hn-service.js +58 -25
- package/dist/services/hn/hn-service.js.map +1 -1
- package/dist/services/hn/types.d.ts +9 -0
- package/dist/services/hn/types.d.ts.map +1 -1
- package/package.json +13 -12
- package/server.json +10 -24
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "hn_get_thread returns live replies below dead and deleted comments, marks OP against the story's author on comment roots, and issues packed cursors; hn_search_content discloses estimated totals, echoes its criteria, and types its hits; an over-cap count is served at the cap."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.5.22 — 2026-10-18
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`hn_get_thread` adds `item.storyId`**: a comment root names the story or poll its discussion belongs to, rendered as `story:<id>` in `content[]`. Absent when the story could not be found; `notice` says why. (#42)
|
|
12
|
+
- **`hn_search_content` adds `criteria`**: the applied filters plus `sort`, `count`, and `view` with defaults filled, `author` trimmed and `dateRange` as the exclusive UTC bounds sent, echoed in `structuredContent` and as a `**criteria:**` line in `content[]`. (#35)
|
|
13
|
+
- **`hn_search_content` adds `totalHitsExact` and `reachableHits`**: `totalHitsExact: false` marks `totalHits` as an estimate, and `reachableHits: 1000` marks a search matching more than Algolia serves; the last reachable page's `notice` names the ceiling and narrower `dateRange` windows. (#34)
|
|
14
|
+
- **`hn_search_content` hits carry `type`**: `story`, `comment`, `poll`, `pollopt`, or `job`, when Algolia records one. A poll option renders as `Poll option by <author>` pointing to `hn_get_thread`. (#41)
|
|
15
|
+
- **Over-cap inputs are served at the cap instead of rejected**: `hn_get_stories` `count` up to 1,000 at 100, `hn_get_user` `submissionCount` up to 1,000 at 50, `hn_get_thread` `depth` up to 100 at 10 and `maxComments` up to 1,000 at 200, `hn_search_content` `count` up to 1,000 at 50. `cap` reports the value served and `notice` names the lever for the rest. Values above those ceilings are still rejected. (#45)
|
|
16
|
+
- **`hn_search_content` serves an over-cap `count` from the requested page's first hit**: the search runs as page `page × count / 50` at 50, and `page`, `totalPages`, and `criteria.count` describe that page of 50. (#45)
|
|
17
|
+
- **`hn_search_content` adds the error reason `count_page_unaligned`**: a `count` above 50 with a non-zero `page` whose first hit begins no page of 50 fails with it, naming a `count` and `page` that start at that hit. (#45)
|
|
18
|
+
- **`hn_get_thread` `nextCursor` is packed**: a base64url varint encoding that also carries the resolved story. Cursors issued by earlier releases still resume, and a cursor longer than 150,000 characters is rejected as `invalid_cursor`. (#43)
|
|
19
|
+
- **`hn_get_thread` rejects a cursor it did not issue** with the declared `invalid_cursor` reason, so the rejection logs at `notice` with the reason attached. (#36)
|
|
20
|
+
- **`hn_search_content` drops a leading `http://`, `https://`, or `www.` from a query that is a URL alone**, so submissions under either scheme, with or without `www.`, match. The output `query` and `notice` show what was searched. (#38)
|
|
21
|
+
- **`hn_search_content` job descriptions** (`job_text`) are returned as `text`; they are not keyword-searched or highlighted. (#41)
|
|
22
|
+
- **`hn_search_content` names the `author` casing rule** when an author-filtered first page is empty: `author` is an exact, case-sensitive match. (#39)
|
|
23
|
+
- **`hn_search_content` scopes `tags: "front_page"`** in the `notice` on an empty first page or whenever `dateRange` is set: it is the current front page only, with `tags: "story"` plus `dateRange` and `minPoints` as the alternative. (#40)
|
|
24
|
+
- **`hn_search_content` escapes the query** in the `content[]` heading and no-results line. (#35)
|
|
25
|
+
- **Framework sync**: `framework-skills/` synced to 0.13.15, `.env.example` lists `LOG_LLM_INTERACTIONS`, and the `check-framework-antipatterns.ts` patterns use POSIX space classes.
|
|
26
|
+
- **Tests**: worst-case timing checks measure the test thread's CPU time instead of wall clock. (#44)
|
|
27
|
+
|
|
28
|
+
## Fixed
|
|
29
|
+
|
|
30
|
+
- **`hn_get_thread` returns live replies below dead and deleted comments** at their true `depth`, with `parentId` naming the omitted comment. The comment stays out of `comments[]` and in the notice's counts; where the depth limit cuts its replies, `notice` names it by ID to pass as `itemId`. (#33)
|
|
31
|
+
- **`descendants` and `totalAvailable` are described as live-comment counts** in `hn_get_stories`, `hn_get_user`, and `hn_get_thread`. (#33)
|
|
32
|
+
- **`isOp` on a comment root marks replies by the story's author**, where it marked the root comment's author. The lookup follows at most 64 parent links and ends 20 seconds after the call starts. (#42)
|
|
33
|
+
- **A caller abort during a retry's backoff ends a `fetchItems` batch** instead of recording a failed slot. (#42)
|
|
34
|
+
|
|
35
|
+
## Dependencies
|
|
36
|
+
|
|
37
|
+
- `@cyanheads/mcp-ts-core` ^0.13.12 → ^0.13.15 (0.13.13: error envelopes drop `data.rootCause` and filesystem storage errors name the key, not the storage root; 0.13.14: tool-argument pre-validation repairs numeric and boolean strings, lone strings for arrays, and null optionals; 0.13.15: DuckDB canvases run with external access off and ZodError `data.issues` is bounded)
|
|
38
|
+
- `@modelcontextprotocol/server` 2.2.0 → 2.3.1 (transitive)
|
|
39
|
+
- `pino-pretty` ^13.1.3 → ^13.2.0
|
|
40
|
+
- `zod` ^4.6.5 → ^4.6.7
|
|
41
|
+
- Dev: `@types/node` ^26.6.4 → ^26.6.5
|
|
42
|
+
- Dev: `@vitest/coverage-istanbul` ^5.0.3 → ^5.0.5
|
|
43
|
+
- Dev: `ignore` ^7.0.11 → ^7.0.12
|
|
44
|
+
- Dev: `vitest` ^5.0.3 → ^5.0.5
|
|
45
|
+
- `packageManager` bun@1.4.2 → bun@1.4.3; Docker base images `oven/bun` 1.4.2 → 1.4.3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAkBjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4QrB,CAAC"}
|
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { escapeInline, quoteBody } from '../markdown-escape.js';
|
|
8
|
+
import { servedAtCap } from '../served-at-cap.js';
|
|
8
9
|
import { decodeHtmlEntities, extractDomain, getHnService, normalizeUrl, settlePage, stripHtml, } from '../../../services/hn/hn-service.js';
|
|
9
|
-
/**
|
|
10
|
-
const
|
|
10
|
+
/** Most stories one call serves; a larger `count` is served at this cap. */
|
|
11
|
+
const COUNT_CAP = 100;
|
|
12
|
+
/** Largest `count` accepted; anything above it is rejected. */
|
|
13
|
+
const COUNT_CEILING = 1000;
|
|
11
14
|
export const getStories = tool('hn_get_stories', {
|
|
12
15
|
description: 'Fetch stories from an HN feed (top, new, best, ask, show, jobs), with title, URL, score, author, and comment count for each story.',
|
|
13
16
|
annotations: { readOnlyHint: true },
|
|
@@ -60,9 +63,9 @@ export const getStories = tool('hn_get_stories', {
|
|
|
60
63
|
.number()
|
|
61
64
|
.int()
|
|
62
65
|
.min(1)
|
|
63
|
-
.max(
|
|
66
|
+
.max(COUNT_CEILING)
|
|
64
67
|
.default(30)
|
|
65
|
-
.describe(
|
|
68
|
+
.describe(`Number of stories to return, at most ${COUNT_CAP} per call. A larger value is served at ${COUNT_CAP}, and the notice names the offset for the next page. Larger counts take longer.`),
|
|
66
69
|
offset: z
|
|
67
70
|
.number()
|
|
68
71
|
.int()
|
|
@@ -100,7 +103,10 @@ export const getStories = tool('hn_get_stories', {
|
|
|
100
103
|
.number()
|
|
101
104
|
.optional()
|
|
102
105
|
.describe('Unix timestamp when provided by HN. Omitted when unknown.'),
|
|
103
|
-
descendants: z
|
|
106
|
+
descendants: z
|
|
107
|
+
.number()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("HN's count of live comments in the thread (descendants); dead and deleted comments are not counted. Absent for jobs."),
|
|
104
110
|
text: z
|
|
105
111
|
.string()
|
|
106
112
|
.optional()
|
|
@@ -121,7 +127,10 @@ export const getStories = tool('hn_get_stories', {
|
|
|
121
127
|
.optional()
|
|
122
128
|
.describe('True when more stories remain beyond this page (hasMore). Absent on the last page of the feed.'),
|
|
123
129
|
shown: z.number().optional().describe('Number of stories returned on this page.'),
|
|
124
|
-
cap: z
|
|
130
|
+
cap: z
|
|
131
|
+
.number()
|
|
132
|
+
.optional()
|
|
133
|
+
.describe(`The count value served: as passed, or ${COUNT_CAP} when count was above that cap.`),
|
|
125
134
|
failedIds: z
|
|
126
135
|
.array(z.number())
|
|
127
136
|
.optional()
|
|
@@ -129,7 +138,7 @@ export const getStories = tool('hn_get_stories', {
|
|
|
129
138
|
notice: z
|
|
130
139
|
.string()
|
|
131
140
|
.optional()
|
|
132
|
-
.describe('Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result with no failed IDs.'),
|
|
141
|
+
.describe('Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged — noting when count was served at its per-call cap. Absent on the last page of a non-empty result with no failed IDs.'),
|
|
133
142
|
},
|
|
134
143
|
enrichmentTrailer: {
|
|
135
144
|
failedIds: { render: (ids) => `**Failed to load:** ${(ids ?? []).join(', ')}` },
|
|
@@ -137,7 +146,8 @@ export const getStories = tool('hn_get_stories', {
|
|
|
137
146
|
async handler(input, ctx) {
|
|
138
147
|
const hn = getHnService();
|
|
139
148
|
const feedIds = await hn.fetchFeed(input.feed, ctx);
|
|
140
|
-
const
|
|
149
|
+
const count = Math.min(input.count, COUNT_CAP);
|
|
150
|
+
const sliced = feedIds.slice(input.offset, input.offset + count);
|
|
141
151
|
const { items, failedIds } = settlePage(await hn.fetchItems(sliced, ctx));
|
|
142
152
|
const stories = items.map((item) => {
|
|
143
153
|
const url = normalizeUrl(item.url);
|
|
@@ -161,7 +171,7 @@ export const getStories = tool('hn_get_stories', {
|
|
|
161
171
|
failed: failedIds.length,
|
|
162
172
|
});
|
|
163
173
|
const total = feedIds.length;
|
|
164
|
-
const nextOffset = input.offset +
|
|
174
|
+
const nextOffset = input.offset + count;
|
|
165
175
|
const hasMore = nextOffset < total;
|
|
166
176
|
ctx.enrich({
|
|
167
177
|
total,
|
|
@@ -174,15 +184,16 @@ export const getStories = tool('hn_get_stories', {
|
|
|
174
184
|
? `Could not fetch ${failedIds.length} of ${sliced.length} items on this page (id${failedIds.length === 1 ? '' : 's'} ${failedIds.join(', ')}). Retry with offset: ${input.offset}, or pass an id as itemId to hn_get_thread to fetch that story alone.`
|
|
175
185
|
: undefined;
|
|
176
186
|
if (hasMore) {
|
|
177
|
-
const raiseCount = input.count <
|
|
187
|
+
const raiseCount = input.count < COUNT_CAP ? `, or raise count (max ${COUNT_CAP})` : '';
|
|
178
188
|
const nextPage = `Pass offset: ${nextOffset} for the next page${raiseCount}.`;
|
|
179
189
|
const pageStatus = stories.length === 0 && !failureMessage
|
|
180
190
|
? deadPageMessage
|
|
181
191
|
: `Showing items ${input.offset + 1}–${nextOffset} of ${total} in the ${input.feed} feed.`;
|
|
192
|
+
const overCap = input.count > COUNT_CAP ? servedAtCap('count', input.count, COUNT_CAP) : '';
|
|
182
193
|
ctx.enrich.truncated({
|
|
183
194
|
shown: stories.length,
|
|
184
|
-
cap:
|
|
185
|
-
guidance: [pageStatus, failureMessage, nextPage].filter(Boolean).join(' '),
|
|
195
|
+
cap: count,
|
|
196
|
+
guidance: [pageStatus, overCap, failureMessage, nextPage].filter(Boolean).join(' '),
|
|
186
197
|
});
|
|
187
198
|
}
|
|
188
199
|
else if (stories.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,6BAA6B,CAAC;AAErC,
|
|
1
|
+
{"version":3,"file":"get-stories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,6BAA6B,CAAC;AAErC,4EAA4E;AAC5E,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,+DAA+D;AAC/D,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE;IAC/C,WAAW,EACT,oIAAoI;IACtI,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,MAAM,EAAE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|
parent: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
storyId: z.ZodOptional<z.ZodNumber>;
|
|
25
26
|
poll: z.ZodOptional<z.ZodNumber>;
|
|
26
27
|
parts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
27
28
|
deleted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -53,8 +54,8 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
53
54
|
}, {
|
|
54
55
|
readonly reason: "invalid_cursor";
|
|
55
56
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
56
|
-
readonly when: "The cursor was issued for a different itemId than the one passed with it.";
|
|
57
|
-
readonly recovery: "Pass
|
|
57
|
+
readonly when: "The cursor is not one this tool issued, was altered, or was issued for a different itemId than the one passed with it.";
|
|
58
|
+
readonly recovery: "Pass nextCursor unchanged, with the same itemId it was returned for, or omit cursor to start this item from the top.";
|
|
58
59
|
readonly severity: "notice";
|
|
59
60
|
}, {
|
|
60
61
|
readonly reason: "upstream_rejected";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAmfhF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsZpB,CAAC"}
|