@cyanheads/cyanheads-mcp-server 0.3.4 → 0.4.1
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 +33 -19
- package/CLAUDE.md +33 -19
- package/Dockerfile +9 -9
- package/LICENSE +1 -1
- package/README.md +14 -14
- package/changelog/0.4.x/0.4.0.md +21 -0
- package/changelog/0.4.x/0.4.1.md +33 -0
- package/changelog/template.md +55 -16
- package/dist/config/server-config.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{describe.tool.d.ts → describe-entry.tool.d.ts} +5 -5
- package/dist/mcp-server/tools/definitions/describe-entry.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/{describe.tool.js → describe-entry.tool.js} +18 -10
- package/dist/mcp-server/tools/definitions/describe-entry.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/{search.tool.d.ts → search-catalog.tool.d.ts} +4 -4
- package/dist/mcp-server/tools/definitions/search-catalog.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/{search.tool.js → search-catalog.tool.js} +17 -9
- package/dist/mcp-server/tools/definitions/search-catalog.tool.js.map +1 -0
- package/dist/services/catalog/catalog-service.d.ts +14 -3
- package/dist/services/catalog/catalog-service.d.ts.map +1 -1
- package/dist/services/catalog/catalog-service.js +25 -21
- package/dist/services/catalog/catalog-service.js.map +1 -1
- package/dist/services/catalog/embeddings-runtime.d.ts.map +1 -1
- package/dist/services/catalog/embeddings-runtime.js +3 -3
- package/dist/services/catalog/embeddings-runtime.js.map +1 -1
- package/dist/services/catalog/remote-catalog-provider.d.ts +2 -2
- package/dist/services/catalog/remote-catalog-provider.d.ts.map +1 -1
- package/dist/services/catalog/remote-catalog-provider.js +15 -17
- package/dist/services/catalog/remote-catalog-provider.js.map +1 -1
- package/dist/services/catalog/self-record.d.ts +26 -0
- package/dist/services/catalog/self-record.d.ts.map +1 -0
- package/dist/services/catalog/self-record.js +88 -0
- package/dist/services/catalog/self-record.js.map +1 -0
- package/dist/services/catalog/service-instance.d.ts +17 -0
- package/dist/services/catalog/service-instance.d.ts.map +1 -0
- package/dist/services/catalog/service-instance.js +28 -0
- package/dist/services/catalog/service-instance.js.map +1 -0
- package/dist/services/catalog/snippets.js +1 -1
- package/dist/services/catalog/types.d.ts +2 -0
- package/dist/services/catalog/types.d.ts.map +1 -1
- package/manifest.json +32 -3
- package/package.json +12 -7
- package/server.json +19 -5
- package/dist/mcp-server/tools/definitions/describe.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/describe.tool.js.map +0 -1
- package/dist/mcp-server/tools/definitions/search.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/search.tool.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** cyanheads-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.4.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
A fleet discovery surface for the cyanheads MCP ecosystem. Two tools:
|
|
17
17
|
|
|
18
|
-
- **`
|
|
19
|
-
- **`
|
|
18
|
+
- **`cyanheads_search_catalog`** — semantic search across fleet tools and servers using cosine similarity over Matryoshka-truncated 256-dim embeddings from `Snowflake/snowflake-arctic-embed-m-v1.5`.
|
|
19
|
+
- **`cyanheads_describe_entry`** — returns the description, connection URL, and per-client install snippet for any named tool or server.
|
|
20
20
|
|
|
21
21
|
The catalog (`fleet.json`) is produced by `caseyjhand-portfolio/scripts/build-fleet-json.ts` at portfolio deploy time. Document vectors are baked into the JSON. The server only embeds the user's query at runtime via `@huggingface/transformers`. See `docs/design.md` for the full architecture.
|
|
22
22
|
|
|
23
|
+
The generated catalog does not include this server, so `src/services/catalog/self-record.ts` supplies a static `CatalogRecord` for `cyanheads-mcp-server` that `CatalogService.getServer()` / `getTool()` consult **only after** the remote index misses. A remote entry always wins, so the fallback self-heals to dead code if the generator ever starts emitting one. The record is never part of the vector index, so semantic search does not surface it — only exact-name resolution does.
|
|
24
|
+
|
|
23
25
|
---
|
|
24
26
|
|
|
25
27
|
## What's Next?
|
|
@@ -46,7 +48,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
46
48
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
47
49
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
48
50
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
49
|
-
- **
|
|
51
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
50
52
|
- **Secrets in env vars only** — never hardcoded.
|
|
51
53
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
52
54
|
|
|
@@ -102,7 +104,7 @@ export const itemData = resource('inventory://{itemId}', {
|
|
|
102
104
|
params: z.object({ itemId: z.string().describe('Item identifier') }),
|
|
103
105
|
auth: ['inventory:read'],
|
|
104
106
|
async handler(params, ctx) {
|
|
105
|
-
const item = await ctx.state.get(`item
|
|
107
|
+
const item = await ctx.state.get(`item/${params.itemId}`);
|
|
106
108
|
if (!item) throw notFound(`Item ${params.itemId} not found`, { itemId: params.itemId });
|
|
107
109
|
return item;
|
|
108
110
|
},
|
|
@@ -136,6 +138,7 @@ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
|
136
138
|
const ServerConfigSchema = z.object({
|
|
137
139
|
apiKey: z.string().describe('External API key'),
|
|
138
140
|
maxResults: z.coerce.number().default(100),
|
|
141
|
+
verboseLogging: z.stringbool().default(false).describe('Enable verbose logging'),
|
|
139
142
|
});
|
|
140
143
|
|
|
141
144
|
let _config: z.infer<typeof ServerConfigSchema> | undefined;
|
|
@@ -143,6 +146,7 @@ export function getServerConfig() {
|
|
|
143
146
|
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
144
147
|
apiKey: 'MY_API_KEY',
|
|
145
148
|
maxResults: 'MY_MAX_RESULTS',
|
|
149
|
+
verboseLogging: 'MY_VERBOSE_LOGGING',
|
|
146
150
|
});
|
|
147
151
|
return _config;
|
|
148
152
|
}
|
|
@@ -150,6 +154,12 @@ export function getServerConfig() {
|
|
|
150
154
|
|
|
151
155
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`MY_API_KEY`) not the path (`apiKey`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
152
156
|
|
|
157
|
+
For env booleans use `z.stringbool()`, never `z.coerce.boolean()` — `Boolean("false")` is `true`, so a coerced flag can't be disabled through the environment. `z.stringbool()` parses `true/false/1/0/yes/no/on/off` and rejects anything else, so `=false` actually disables.
|
|
158
|
+
|
|
159
|
+
### Server identity and instructions
|
|
160
|
+
|
|
161
|
+
The canonical `createApp()` identity in this project is `name` + `title` only, both exactly `cyanheads-mcp-server`. The description derives from `package.json`, and the website derives from package metadata, so neither is duplicated in the identity block. `instructions` carries the fleet-discovery workflow as session-level context.
|
|
162
|
+
|
|
153
163
|
---
|
|
154
164
|
|
|
155
165
|
## Context
|
|
@@ -158,13 +168,15 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
158
168
|
|
|
159
169
|
| Property | Description |
|
|
160
170
|
|:---------|:------------|
|
|
161
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
162
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
163
|
-
| `ctx.
|
|
171
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
172
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
173
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
174
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
175
|
+
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
176
|
+
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
164
177
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
165
|
-
| `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
|
|
166
178
|
| `ctx.requestId` | Unique request ID. |
|
|
167
|
-
| `ctx.tenantId` | Tenant ID from JWT
|
|
179
|
+
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
168
180
|
|
|
169
181
|
---
|
|
170
182
|
|
|
@@ -172,9 +184,11 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
172
184
|
|
|
173
185
|
Handlers throw — the framework catches, classifies, and formats.
|
|
174
186
|
|
|
175
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required
|
|
187
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
176
188
|
|
|
177
189
|
```ts
|
|
190
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
191
|
+
|
|
178
192
|
errors: [
|
|
179
193
|
{ reason: 'no_match', code: JsonRpcErrorCode.NotFound,
|
|
180
194
|
when: 'No item matched the query',
|
|
@@ -182,7 +196,7 @@ errors: [
|
|
|
182
196
|
],
|
|
183
197
|
async handler(input, ctx) {
|
|
184
198
|
const item = await db.find(input.id);
|
|
185
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
199
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
|
|
186
200
|
return item;
|
|
187
201
|
}
|
|
188
202
|
```
|
|
@@ -276,7 +290,7 @@ Available skills:
|
|
|
276
290
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
277
291
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
278
292
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
279
|
-
| `api-context` | Context interface, logger, state,
|
|
293
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
280
294
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
281
295
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
282
296
|
| `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
|
|
@@ -304,7 +318,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
304
318
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
305
319
|
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
306
320
|
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
307
|
-
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity
|
|
321
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
308
322
|
| `bun run list-skills` | Print the skill registry |
|
|
309
323
|
| `bun run tree` | Generate directory structure doc |
|
|
310
324
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
@@ -321,7 +335,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
321
335
|
|
|
322
336
|
## Bundling
|
|
323
337
|
|
|
324
|
-
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips dependency-shipped agent docs (`
|
|
338
|
+
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
325
339
|
|
|
326
340
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
327
341
|
|
|
@@ -339,14 +353,14 @@ Each per-version file opens with YAML frontmatter:
|
|
|
339
353
|
---
|
|
340
354
|
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
341
355
|
breaking: false # optional — true flags breaking changes
|
|
342
|
-
security: false # optional — true
|
|
356
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
343
357
|
---
|
|
344
358
|
|
|
345
359
|
# 0.1.0 — YYYY-MM-DD
|
|
346
360
|
...
|
|
347
361
|
```
|
|
348
362
|
|
|
349
|
-
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
363
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
350
364
|
|
|
351
365
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
352
366
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** cyanheads-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.4.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
A fleet discovery surface for the cyanheads MCP ecosystem. Two tools:
|
|
17
17
|
|
|
18
|
-
- **`
|
|
19
|
-
- **`
|
|
18
|
+
- **`cyanheads_search_catalog`** — semantic search across fleet tools and servers using cosine similarity over Matryoshka-truncated 256-dim embeddings from `Snowflake/snowflake-arctic-embed-m-v1.5`.
|
|
19
|
+
- **`cyanheads_describe_entry`** — returns the description, connection URL, and per-client install snippet for any named tool or server.
|
|
20
20
|
|
|
21
21
|
The catalog (`fleet.json`) is produced by `caseyjhand-portfolio/scripts/build-fleet-json.ts` at portfolio deploy time. Document vectors are baked into the JSON. The server only embeds the user's query at runtime via `@huggingface/transformers`. See `docs/design.md` for the full architecture.
|
|
22
22
|
|
|
23
|
+
The generated catalog does not include this server, so `src/services/catalog/self-record.ts` supplies a static `CatalogRecord` for `cyanheads-mcp-server` that `CatalogService.getServer()` / `getTool()` consult **only after** the remote index misses. A remote entry always wins, so the fallback self-heals to dead code if the generator ever starts emitting one. The record is never part of the vector index, so semantic search does not surface it — only exact-name resolution does.
|
|
24
|
+
|
|
23
25
|
---
|
|
24
26
|
|
|
25
27
|
## What's Next?
|
|
@@ -46,7 +48,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
46
48
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
47
49
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
48
50
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
49
|
-
- **
|
|
51
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
50
52
|
- **Secrets in env vars only** — never hardcoded.
|
|
51
53
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
52
54
|
|
|
@@ -102,7 +104,7 @@ export const itemData = resource('inventory://{itemId}', {
|
|
|
102
104
|
params: z.object({ itemId: z.string().describe('Item identifier') }),
|
|
103
105
|
auth: ['inventory:read'],
|
|
104
106
|
async handler(params, ctx) {
|
|
105
|
-
const item = await ctx.state.get(`item
|
|
107
|
+
const item = await ctx.state.get(`item/${params.itemId}`);
|
|
106
108
|
if (!item) throw notFound(`Item ${params.itemId} not found`, { itemId: params.itemId });
|
|
107
109
|
return item;
|
|
108
110
|
},
|
|
@@ -136,6 +138,7 @@ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
|
136
138
|
const ServerConfigSchema = z.object({
|
|
137
139
|
apiKey: z.string().describe('External API key'),
|
|
138
140
|
maxResults: z.coerce.number().default(100),
|
|
141
|
+
verboseLogging: z.stringbool().default(false).describe('Enable verbose logging'),
|
|
139
142
|
});
|
|
140
143
|
|
|
141
144
|
let _config: z.infer<typeof ServerConfigSchema> | undefined;
|
|
@@ -143,6 +146,7 @@ export function getServerConfig() {
|
|
|
143
146
|
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
144
147
|
apiKey: 'MY_API_KEY',
|
|
145
148
|
maxResults: 'MY_MAX_RESULTS',
|
|
149
|
+
verboseLogging: 'MY_VERBOSE_LOGGING',
|
|
146
150
|
});
|
|
147
151
|
return _config;
|
|
148
152
|
}
|
|
@@ -150,6 +154,12 @@ export function getServerConfig() {
|
|
|
150
154
|
|
|
151
155
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`MY_API_KEY`) not the path (`apiKey`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
152
156
|
|
|
157
|
+
For env booleans use `z.stringbool()`, never `z.coerce.boolean()` — `Boolean("false")` is `true`, so a coerced flag can't be disabled through the environment. `z.stringbool()` parses `true/false/1/0/yes/no/on/off` and rejects anything else, so `=false` actually disables.
|
|
158
|
+
|
|
159
|
+
### Server identity and instructions
|
|
160
|
+
|
|
161
|
+
The canonical `createApp()` identity in this project is `name` + `title` only, both exactly `cyanheads-mcp-server`. The description derives from `package.json`, and the website derives from package metadata, so neither is duplicated in the identity block. `instructions` carries the fleet-discovery workflow as session-level context.
|
|
162
|
+
|
|
153
163
|
---
|
|
154
164
|
|
|
155
165
|
## Context
|
|
@@ -158,13 +168,15 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
158
168
|
|
|
159
169
|
| Property | Description |
|
|
160
170
|
|:---------|:------------|
|
|
161
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
162
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
163
|
-
| `ctx.
|
|
171
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
172
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
173
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
174
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
175
|
+
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
176
|
+
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
164
177
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
165
|
-
| `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
|
|
166
178
|
| `ctx.requestId` | Unique request ID. |
|
|
167
|
-
| `ctx.tenantId` | Tenant ID from JWT
|
|
179
|
+
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
168
180
|
|
|
169
181
|
---
|
|
170
182
|
|
|
@@ -172,9 +184,11 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
172
184
|
|
|
173
185
|
Handlers throw — the framework catches, classifies, and formats.
|
|
174
186
|
|
|
175
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required
|
|
187
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
176
188
|
|
|
177
189
|
```ts
|
|
190
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
191
|
+
|
|
178
192
|
errors: [
|
|
179
193
|
{ reason: 'no_match', code: JsonRpcErrorCode.NotFound,
|
|
180
194
|
when: 'No item matched the query',
|
|
@@ -182,7 +196,7 @@ errors: [
|
|
|
182
196
|
],
|
|
183
197
|
async handler(input, ctx) {
|
|
184
198
|
const item = await db.find(input.id);
|
|
185
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
199
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
|
|
186
200
|
return item;
|
|
187
201
|
}
|
|
188
202
|
```
|
|
@@ -276,7 +290,7 @@ Available skills:
|
|
|
276
290
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
277
291
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
278
292
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
279
|
-
| `api-context` | Context interface, logger, state,
|
|
293
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
280
294
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
281
295
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
282
296
|
| `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
|
|
@@ -304,7 +318,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
304
318
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
305
319
|
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
306
320
|
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
307
|
-
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity
|
|
321
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
308
322
|
| `bun run list-skills` | Print the skill registry |
|
|
309
323
|
| `bun run tree` | Generate directory structure doc |
|
|
310
324
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
@@ -321,7 +335,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
321
335
|
|
|
322
336
|
## Bundling
|
|
323
337
|
|
|
324
|
-
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips dependency-shipped agent docs (`
|
|
338
|
+
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
325
339
|
|
|
326
340
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
327
341
|
|
|
@@ -339,14 +353,14 @@ Each per-version file opens with YAML frontmatter:
|
|
|
339
353
|
---
|
|
340
354
|
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
341
355
|
breaking: false # optional — true flags breaking changes
|
|
342
|
-
security: false # optional — true
|
|
356
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
343
357
|
---
|
|
344
358
|
|
|
345
359
|
# 0.1.0 — YYYY-MM-DD
|
|
346
360
|
...
|
|
347
361
|
```
|
|
348
362
|
|
|
349
|
-
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
363
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
350
364
|
|
|
351
365
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
352
366
|
|
package/Dockerfile
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.
|
|
7
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.0 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
@@ -19,9 +19,8 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
19
19
|
# Copy the rest of the source code
|
|
20
20
|
COPY . .
|
|
21
21
|
|
|
22
|
-
# Build the application
|
|
23
|
-
|
|
24
|
-
RUN bun scripts/build.ts
|
|
22
|
+
# Build the application
|
|
23
|
+
RUN bun run build
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
# ==============================================================================
|
|
@@ -31,7 +30,7 @@ RUN bun scripts/build.ts
|
|
|
31
30
|
# application. It uses a slim base image and only includes production
|
|
32
31
|
# dependencies and build artifacts.
|
|
33
32
|
# ==============================================================================
|
|
34
|
-
FROM oven/bun:1.
|
|
33
|
+
FROM oven/bun:1.4.0-slim AS production
|
|
35
34
|
|
|
36
35
|
WORKDIR /usr/src/app
|
|
37
36
|
|
|
@@ -42,7 +41,7 @@ ENV NODE_ENV=production
|
|
|
42
41
|
# OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
|
|
43
42
|
ARG APP_VERSION
|
|
44
43
|
LABEL org.opencontainers.image.title="cyanheads-mcp-server"
|
|
45
|
-
LABEL org.opencontainers.image.description="Fleet discovery
|
|
44
|
+
LABEL org.opencontainers.image.description="Fleet discovery for the cyanheads MCP ecosystem — semantic search + install snippets."
|
|
46
45
|
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
|
47
46
|
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
48
47
|
LABEL org.opencontainers.image.source="https://github.com/cyanheads/cyanheads-mcp-server"
|
|
@@ -51,9 +50,10 @@ LABEL org.opencontainers.image.source="https://github.com/cyanheads/cyanheads-mc
|
|
|
51
50
|
COPY package.json bun.lock ./
|
|
52
51
|
|
|
53
52
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
54
|
-
# that are not needed in the final production image.
|
|
53
|
+
# that are not needed in the final production image. `--omit=peer` excludes the
|
|
54
|
+
# framework's optional peer tiers; direct runtime imports remain in dependencies.
|
|
55
55
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
56
|
-
bun install --production --frozen-lockfile --ignore-scripts
|
|
56
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
57
57
|
|
|
58
58
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
59
59
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
@@ -61,7 +61,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
61
61
|
ARG OTEL_ENABLED=true
|
|
62
62
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
63
63
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
64
|
-
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
64
|
+
bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
|
|
65
65
|
@opentelemetry/instrumentation-http \
|
|
66
66
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
67
67
|
@opentelemetry/exporter-trace-otlp-http \
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@ Apache License
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Casey Hand @cyanheads
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/cyanheads-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/cyanheads-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -33,24 +33,25 @@ Two tools, semantic ranking, hosted catalog. The catalog itself lives at [`casey
|
|
|
33
33
|
|
|
34
34
|
| Tool | Description |
|
|
35
35
|
|:---|:---|
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
36
|
+
| `cyanheads_search_catalog` | Search fleet tools and servers by natural-language query. Returns ranked matches with brief summaries and the owning server. |
|
|
37
|
+
| `cyanheads_describe_entry` | Return the connection URL and per-client install snippets for a named tool or server. |
|
|
38
38
|
|
|
39
|
-
### `
|
|
39
|
+
### `cyanheads_search_catalog`
|
|
40
40
|
|
|
41
41
|
Semantic search across the fleet. Embeds the query with [Snowflake Arctic Embed M v1.5](https://huggingface.co/Snowflake/snowflake-arctic-embed-m-v1.5) (Matryoshka-truncated to 256 dimensions) and computes cosine similarity against the catalog's pre-computed document vectors.
|
|
42
42
|
|
|
43
|
+
- `query` accepts 1-500 characters
|
|
43
44
|
- `scope: "tools"` (default) returns individual tool matches; `scope: "servers"` returns server-level matches
|
|
44
45
|
- `category` filter narrows to one of `research`, `government`, `public-data`, `utility`
|
|
45
46
|
- Configurable `limit` (1-20, default 5) and a server-side `SIMILARITY_FLOOR` threshold drop low-confidence hits
|
|
46
47
|
- Returns `score` (cosine similarity in [0, 1]) on every result for trust calibration
|
|
47
|
-
- `
|
|
48
|
+
- `totalCount` reports the count above the floor before the limit was applied
|
|
48
49
|
|
|
49
50
|
---
|
|
50
51
|
|
|
51
|
-
### `
|
|
52
|
+
### `cyanheads_describe_entry`
|
|
52
53
|
|
|
53
|
-
Resolve a name to its install instructions. Accepts either a tool name (snake_case, e.g. `earthquake_search`) or a server name (kebab-case, e.g. `earthquake-mcp-server`) — auto-detected from the format, or pinned via the `kind` parameter.
|
|
54
|
+
Resolve a name to its install instructions. Accepts either a tool name (snake_case, e.g. `earthquake_search`) or a server name (kebab-case, e.g. `earthquake-mcp-server`), up to 64 characters — auto-detected from the format, or pinned via the `kind` parameter.
|
|
54
55
|
|
|
55
56
|
- For tools: returns the description and the owning server name
|
|
56
57
|
- For servers: returns description, version, npm package, GitHub URL, the full tool list (each tool's name and description), and per-client install snippets — **local (stdio, via `npx`) for every server, plus remote (Streamable HTTP) when a hosted endpoint exists**
|
|
@@ -66,7 +67,7 @@ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
|
|
|
66
67
|
- Unified error handling with typed error contracts and recovery hints
|
|
67
68
|
- Pluggable auth (`none`, `jwt`, `oauth`)
|
|
68
69
|
- Structured logging with optional OpenTelemetry tracing
|
|
69
|
-
- Runs locally
|
|
70
|
+
- Runs locally over stdio or HTTP, with a hosted Streamable HTTP endpoint
|
|
70
71
|
|
|
71
72
|
Fleet-specific:
|
|
72
73
|
|
|
@@ -77,7 +78,7 @@ Fleet-specific:
|
|
|
77
78
|
|
|
78
79
|
## What's in the fleet
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
100+ MCP servers spanning four categories. Each is open source and individually addressable — `cyanheads_describe_entry` returns its direct connection URL alongside the install snippet. It also describes this server: ask for `cyanheads-mcp-server` and you get the front door's own endpoint and install snippets.
|
|
81
82
|
|
|
82
83
|
| Category | Examples |
|
|
83
84
|
|:--|:--|
|
|
@@ -208,7 +209,7 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
|
|
|
208
209
|
| `CATALOG_FETCH_TIMEOUT_MS` | Per-request timeout for fleet.json fetches in ms. Must be > 0. | `10000` |
|
|
209
210
|
| `CATALOG_REFRESH_SECONDS` | Background poll interval for fleet.json refresh. `0` disables; otherwise must be > 0. | `3600` |
|
|
210
211
|
| `EMBEDDING_MODEL_ID` | Hugging Face model id for query embedding. Must match `fleet.json.embeddingModel`. | `Snowflake/snowflake-arctic-embed-m-v1.5` |
|
|
211
|
-
| `SIMILARITY_FLOOR` | Cosine similarity cutoff for `
|
|
212
|
+
| `SIMILARITY_FLOOR` | Cosine similarity cutoff for `cyanheads_search_catalog` results. Must be within `[0, 1]`. | `0.3` |
|
|
212
213
|
| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
|
|
213
214
|
|
|
214
215
|
To point at a different catalog, change `CATALOG_URL` to your own hosted JSON file. See [`docs/design.md`](./docs/design.md) for the producer-side script and schema.
|
|
@@ -239,9 +240,8 @@ To point at a different catalog, change `CATALOG_URL` to your own hosted JSON fi
|
|
|
239
240
|
|
|
240
241
|
| Directory | Purpose |
|
|
241
242
|
|:---|:---|
|
|
242
|
-
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Two tools — `
|
|
243
|
-
| `src/services/catalog` | Catalog service — remote fleet.json provider with atomic-swap refresh, vector index, snippet builders. |
|
|
244
|
-
| `src/services/embeddings` | Embedding runtime — query-time inference via `@huggingface/transformers`, with an injectable interface for deterministic tests. |
|
|
243
|
+
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Two tools — `cyanheads_search_catalog` and `cyanheads_describe_entry`. |
|
|
244
|
+
| `src/services/catalog` | Catalog service — remote fleet.json provider with atomic-swap refresh, vector index, snippet builders, the self-description fallback record, and the query-time embedding runtime (`@huggingface/transformers`, behind an injectable interface for deterministic tests). |
|
|
245
245
|
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
246
246
|
| `tests/` | Unit and integration tests, mirroring the `src/` structure. |
|
|
247
247
|
| `docs/` | Design doc and schema reference. |
|
|
@@ -252,7 +252,7 @@ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rule
|
|
|
252
252
|
|
|
253
253
|
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
254
254
|
- Use `ctx.log` for logging, `ctx.state` for storage
|
|
255
|
-
- Register new tools in `src/
|
|
255
|
+
- Register new tools in the `tools` array passed to `createApp()` in `src/index.ts`
|
|
256
256
|
|
|
257
257
|
## Contributing
|
|
258
258
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Breaking tool rename (cyanheads_search_catalog / cyanheads_describe_entry), input-length bounds, and a self-description fallback for the front door's own server entry"
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.0 — 2026-07-26
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **Self-description fallback.** `cyanheads_describe_entry` now resolves `cyanheads-mcp-server` and its own two tools even though the generated fleet catalog excludes the discovery front door. `src/services/catalog/self-record.ts` supplies a static `CatalogRecord` built from this package's own `package.json` (version, description) and its registered tool definitions; `CatalogService.getServer()` / `getTool()` consult it only after a remote-catalog lookup misses, so a future catalog entry for this server takes precedence automatically. The record is excluded from the vector index, so `cyanheads_search_catalog` does not surface it — only exact-name resolution does. ([#7](https://github.com/cyanheads/cyanheads-mcp-server/issues/7))
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- **Breaking: both public tools renamed.** `cyanheads_search` → `cyanheads_search_catalog`; `cyanheads_describe` → `cyanheads_describe_entry`. No compatibility aliases — the old names are gone from `tools/list`. Inputs, outputs, errors, and runtime behavior are unchanged. Clients that call either old name directly must switch to the new name; clients that discover tools dynamically pick up the new names automatically on next connect. ([#10](https://github.com/cyanheads/cyanheads-mcp-server/issues/10))
|
|
16
|
+
- **Input length bounds.** `cyanheads_search_catalog.query` is now capped at 500 characters; `cyanheads_describe_entry.name` at 64. Both previously accepted unbounded strings, letting oversized input reach the local embedding model before domain logic could reject it. ([#9](https://github.com/cyanheads/cyanheads-mcp-server/issues/9))
|
|
17
|
+
- **`CatalogService` accessor moved.** `getCatalogService()` now lives in the new leaf module `src/services/catalog/service-instance.ts` instead of `catalog-service.ts`, breaking an import cycle between the tool definitions and the self-record (which derives its tool list from those same definitions). `initCatalogService()` stays in `catalog-service.ts` and installs the instance via the new module's `setCatalogService()`. `shutdown()` is promoted from `CatalogService` onto the `ICatalogService` interface.
|
|
18
|
+
|
|
19
|
+
## Fixed
|
|
20
|
+
|
|
21
|
+
- **`docs/design.md` reconciled against current code.** The search-tool output schema, error contract, and `format()` parity note were stale from before the servers roll-up and enrichment-block rework; the `ICatalogService` sketch was missing `shutdown()`. All brought back in sync with the current definition files. ([#11](https://github.com/cyanheads/cyanheads-mcp-server/issues/11))
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "mcp-ts-core 0.12.3 adoption and expanded test coverage"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.1 — 2026-08-21
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **Test lanes** add smoke coverage for every definition, framework contract integration tests, property-based fuzzing, and Istanbul coverage reporting.
|
|
12
|
+
- **Repository guidance** adds contribution and conduct documents, plus a dedicated `security@caseyjhand.com` reporting contact with credential-redaction guidance.
|
|
13
|
+
|
|
14
|
+
## Changed
|
|
15
|
+
|
|
16
|
+
- **`@cyanheads/mcp-ts-core` ^0.11.0 → ^0.12.3** migrates catalog failures to framework error factories and remote catalog loading to `fetchWithTimeout`, including whole-exchange timeouts and redacted network errors.
|
|
17
|
+
- **MCP protocol metadata** now targets `@modelcontextprotocol/server` 2.0.0 and protocol revision `2026-07-28`; MCPB configuration exposes every catalog runtime setting.
|
|
18
|
+
- **Container builds** use Bun 1.4.0 for both stages, build through the package script, and omit optional peer tiers from the production install.
|
|
19
|
+
- **Framework skills** document multi-round-trip input, 2026-era caching and notifications, schema/linter additions, parser budgets, telemetry shutdown, and updated testing patterns.
|
|
20
|
+
- **Build tooling** type-checks source and tests together while emitting source only; the directory tree generator now honors directory-only ignore patterns.
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **`bun audit` classification** recognizes Bun 1.4 npm-spec package headers and `>` dependency paths so transitive advisories remain correctly classified.
|
|
25
|
+
- **Catalog response-body timeouts** preserve the framework's typed `Timeout` error instead of being relabeled as `InternalError` during JSON parsing.
|
|
26
|
+
|
|
27
|
+
## Dependencies
|
|
28
|
+
|
|
29
|
+
- `@biomejs/biome` ^2.5.5 → ^2.5.9
|
|
30
|
+
- `@types/node` ^26.1.1 → ^26.2.0
|
|
31
|
+
- `tsc-alias` ^1.9.1 → ^1.9.2
|
|
32
|
+
- `vitest` ^4.1.10 → ^4.1.11
|
|
33
|
+
- Added `@vitest/coverage-istanbul` 4.1.11 and `fast-check` 4.9.0.
|