@cyanheads/orcid-mcp-server 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CLAUDE.md +49 -42
  2. package/Dockerfile +10 -6
  3. package/LICENSE +201 -0
  4. package/README.md +5 -3
  5. package/changelog/0.2.x/0.2.6.md +19 -0
  6. package/changelog/0.2.x/0.2.7.md +34 -0
  7. package/changelog/template.md +5 -3
  8. package/dist/mcp-server/resources/definitions/researcher-profile.resource.d.ts.map +1 -1
  9. package/dist/mcp-server/resources/definitions/researcher-profile.resource.js +9 -5
  10. package/dist/mcp-server/resources/definitions/researcher-profile.resource.js.map +1 -1
  11. package/dist/mcp-server/resources/definitions/researcher-works.resource.d.ts +3 -1
  12. package/dist/mcp-server/resources/definitions/researcher-works.resource.d.ts.map +1 -1
  13. package/dist/mcp-server/resources/definitions/researcher-works.resource.js +27 -10
  14. package/dist/mcp-server/resources/definitions/researcher-works.resource.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-affiliations.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-affiliations.tool.js +2 -4
  17. package/dist/mcp-server/tools/definitions/get-affiliations.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-funding.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-funding.tool.js +2 -4
  20. package/dist/mcp-server/tools/definitions/get-funding.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.js +2 -4
  23. package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/get-profile.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-profile.tool.js +2 -4
  26. package/dist/mcp-server/tools/definitions/get-profile.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-research-resources.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-research-resources.tool.js +2 -4
  29. package/dist/mcp-server/tools/definitions/get-research-resources.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/get-work-detail.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/get-work-detail.tool.js +2 -4
  32. package/dist/mcp-server/tools/definitions/get-work-detail.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/get-works.tool.d.ts +11 -3
  34. package/dist/mcp-server/tools/definitions/get-works.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/get-works.tool.js +73 -16
  36. package/dist/mcp-server/tools/definitions/get-works.tool.js.map +1 -1
  37. package/dist/services/orcid/orcid-id.d.ts +33 -0
  38. package/dist/services/orcid/orcid-id.d.ts.map +1 -0
  39. package/dist/services/orcid/orcid-id.js +64 -0
  40. package/dist/services/orcid/orcid-id.js.map +1 -0
  41. package/dist/services/orcid/orcid-service.d.ts +3 -2
  42. package/dist/services/orcid/orcid-service.d.ts.map +1 -1
  43. package/dist/services/orcid/orcid-service.js +3 -4
  44. package/dist/services/orcid/orcid-service.js.map +1 -1
  45. package/package.json +11 -9
  46. package/server.json +3 -3
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** orcid-mcp-server
4
- **Version:** 0.2.5
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.8`
4
+ **Version:** 0.2.7
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
8
8
  **Zod:** ^4.4.3
@@ -11,19 +11,6 @@
11
11
 
12
12
  ---
13
13
 
14
- ## First Session
15
-
16
- This project was just scaffolded with `bunx @cyanheads/mcp-ts-core init`. The framework, skills, and example definitions are in place — the domain isn't. The user's first messages will set direction; wait for them before proceeding.
17
-
18
- > **Remove this section** from CLAUDE.md / AGENTS.md after completing these steps. The skills and conventions below remain — this block is one-time onboarding only.
19
-
20
- 1. **Get your bearings.** Take stock of the project tree, the skills in `skills/`, and the tools/MCP servers available. Light tool use is fine for context-building — you're mapping the territory, not committing yet.
21
- 2. **Read the framework docs** — `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` (builders, Context, errors, exports, conventions)
22
- 3. **Run the `setup` skill** — read `skills/setup/SKILL.md` and follow its checklist (project orientation, agent protocol file selection, echo definition cleanup, skill sync)
23
- 4. **Design the server** — read `skills/design-mcp-server/SKILL.md` and work through it with the user to map the domain into tools, resources, and services before scaffolding
24
-
25
- ---
26
-
27
14
  ## What's Next?
28
15
 
29
16
  When the user asks what's next or needs direction, suggest options based on the current project state. Common next steps:
@@ -138,6 +125,7 @@ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
138
125
  const ServerConfigSchema = z.object({
139
126
  apiKey: z.string().describe('External API key'),
140
127
  maxResults: z.coerce.number().default(100),
128
+ verboseLogging: z.stringbool().default(false).describe('Enable verbose logging'),
141
129
  });
142
130
 
143
131
  let _config: z.infer<typeof ServerConfigSchema> | undefined;
@@ -145,6 +133,7 @@ export function getServerConfig() {
145
133
  _config ??= parseEnvConfig(ServerConfigSchema, {
146
134
  apiKey: 'MY_API_KEY',
147
135
  maxResults: 'MY_MAX_RESULTS',
136
+ verboseLogging: 'MY_VERBOSE_LOGGING',
148
137
  });
149
138
  return _config;
150
139
  }
@@ -152,9 +141,24 @@ export function getServerConfig() {
152
141
 
153
142
  `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.
154
143
 
155
- ### Server instructions
144
+ 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.
145
+
146
+ ### Server identity and instructions
147
+
148
+ `createApp()` accepts optional identity fields forwarded to the SDK's `initialize` response and the server manifest (`/.well-known/mcp.json`):
149
+
150
+ ```ts
151
+ await createApp({
152
+ name: 'my-mcp-server',
153
+ title: 'My Server', // human-readable display name
154
+ websiteUrl: 'https://github.com/owner/repo', // canonical homepage URL
155
+ description: 'One-line description.', // wins over MCP_SERVER_DESCRIPTION
156
+ icons: [{ src: 'https://example.com/icon.png', sizes: ['48x48'], mimeType: 'image/png' }],
157
+ instructions: 'Use shortcut alpha for the most common case.', // session-level context
158
+ });
159
+ ```
156
160
 
157
- `createApp({ instructions })` optional server-level orientation, sent to clients on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
161
+ `instructions` is optional server-level orientation, sent on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
158
162
 
159
163
  ---
160
164
 
@@ -165,12 +169,14 @@ Handlers receive a unified `ctx` object. Key properties:
165
169
  | Property | Description |
166
170
  |:---------|:------------|
167
171
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
168
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
172
+ | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
169
173
  | `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
174
+ | `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). |
175
+ | `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`. |
170
176
  | `ctx.signal` | `AbortSignal` for cancellation. |
171
177
  | `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
172
178
  | `ctx.requestId` | Unique request ID. |
173
- | `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
179
+ | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
174
180
 
175
181
  ---
176
182
 
@@ -178,7 +184,7 @@ Handlers receive a unified `ctx` object. Key properties:
178
184
 
179
185
  Handlers throw — the framework catches, classifies, and formats.
180
186
 
181
- **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 descriptive metadata for the agent's next move ( 5 words, lint-validated); for the wire `data.recovery.hint` (mirrored into `content[]` text), pass explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
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, 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.
182
188
 
183
189
  ```ts
184
190
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -190,7 +196,7 @@ errors: [
190
196
  ],
191
197
  async handler(input, ctx) {
192
198
  const item = await db.find(input.id);
193
- 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'));
194
200
  return item;
195
201
  }
196
202
  ```
@@ -253,7 +259,7 @@ src/
253
259
 
254
260
  ## Skills
255
261
 
256
- Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
262
+ Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
257
263
 
258
264
  **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
259
265
 
@@ -273,7 +279,6 @@ Available skills:
273
279
  | `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
274
280
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
275
281
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
276
- | `devcheck` | Lint, format, typecheck, audit |
277
282
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
278
283
  | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
279
284
  | `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
@@ -281,19 +286,19 @@ Available skills:
281
286
  | `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
282
287
  | `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
283
288
  | `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
289
+ | `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
284
290
  | `api-auth` | Auth modes, scopes, JWT/OAuth |
285
291
  | `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
286
292
  | `api-config` | AppConfig, parseConfig, env vars |
287
293
  | `api-context` | Context interface, logger, state, progress |
288
294
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
289
295
  | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
296
+ | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
290
297
  | `api-services` | LLM, Speech, Graph services |
291
298
  | `api-testing` | createMockContext, test patterns |
292
299
  | `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
293
300
  | `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
294
- | `api-mirror` | MirrorService: local SQLite index for large/slow upstream APIs |
295
301
  | `api-workers` | Cloudflare Workers runtime |
296
- | `techniques` | Reusable response/data-shaping patterns (e.g. outline-on-overflow) |
297
302
 
298
303
  **Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
299
304
 
@@ -303,25 +308,27 @@ When you complete a skill's checklist, check the boxes and add a completion time
303
308
 
304
309
  ## Commands
305
310
 
306
- **Runtime:** Scripts use `tsx`both `npm run <cmd>` and `bun run <cmd>` work. `bun` is slightly faster for script invocation but not required.
311
+ **Runtime:** Scripts use Bun's native TypeScript execution — `bun run <cmd>` is the standard invocation. `npm run <cmd>` also works (npm delegates to bun).
307
312
 
308
313
  | Command | Purpose |
309
314
  |:--------|:--------|
310
- | `npm run build` | Compile TypeScript |
311
- | `npm run rebuild` | Clean + build |
312
- | `npm run clean` | Remove build artifacts |
313
- | `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
315
+ | `bun run build` | Compile TypeScript |
316
+ | `bun run rebuild` | Clean + build |
317
+ | `bun run clean` | Remove build artifacts |
318
+ | `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
314
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. |
315
- | `npm run tree` | Generate directory structure doc |
316
- | `npm run format` | Auto-fix formatting (safe fixes only) |
317
- | `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
318
- | `npm test` | Run tests |
319
- | `npm run start:stdio` | Production mode (stdio) |
320
- | `npm run start:http` | Production mode (HTTP) |
321
- | `npm run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
322
- | `npm run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
323
- | `npm run release:github` | Create GitHub Release from the current annotated tag |
324
- | `npm run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
320
+ | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
321
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
322
+ | `bun run list-skills` | Print the skill registry |
323
+ | `bun run tree` | Generate directory structure doc |
324
+ | `bun run format` | Auto-fix formatting (safe fixes only) |
325
+ | `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
326
+ | `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
327
+ | `bun run start:stdio` | Production mode (stdio) |
328
+ | `bun run start:http` | Production mode (HTTP) |
329
+ | `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
330
+ | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
331
+ | `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
325
332
 
326
333
  ---
327
334
 
@@ -345,14 +352,14 @@ Each per-version file opens with YAML frontmatter:
345
352
  ---
346
353
  summary: "One-line headline, ≤350 chars" # required — powers the rollup index
347
354
  breaking: false # optional — true flags breaking changes
348
- security: false # optional — true flags security fixes
355
+ security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
349
356
  ---
350
357
 
351
358
  # 0.1.0 — YYYY-MM-DD
352
359
  ...
353
360
  ```
354
361
 
355
- `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`.
362
+ `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`.
356
363
 
357
364
  `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.
358
365
 
package/Dockerfile CHANGED
@@ -4,15 +4,17 @@
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.3 AS build
7
+ FROM oven/bun:1.3.14 AS build
8
8
 
9
9
  WORKDIR /usr/src/app
10
10
 
11
11
  # Copy dependency manifests for optimized layer caching
12
12
  COPY package.json bun.lock ./
13
13
 
14
- # Install all dependencies (including dev dependencies for building)
15
- RUN bun install --frozen-lockfile
14
+ # Install all dependencies (including dev dependencies for building).
15
+ # The BuildKit cache mount persists Bun's global package cache across builds.
16
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
17
+ bun install --frozen-lockfile --ignore-scripts
16
18
 
17
19
  # Copy the rest of the source code
18
20
  COPY . .
@@ -28,7 +30,7 @@ RUN bun run build
28
30
  # application. It uses a slim base image and only includes production
29
31
  # dependencies and build artifacts.
30
32
  # ==============================================================================
31
- FROM oven/bun:1.3-slim AS production
33
+ FROM oven/bun:1.3.14-slim AS production
32
34
 
33
35
  WORKDIR /usr/src/app
34
36
 
@@ -49,13 +51,15 @@ COPY package.json bun.lock ./
49
51
 
50
52
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
51
53
  # that are not needed in the final production image.
52
- RUN bun install --production --frozen-lockfile --ignore-scripts
54
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
55
+ bun install --production --frozen-lockfile --ignore-scripts
53
56
 
54
57
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
55
58
  # These are not bundled by default to keep the base image lean. Enable at build time
56
59
  # with: docker build --build-arg OTEL_ENABLED=true
57
60
  ARG OTEL_ENABLED=true
58
- RUN if [ "$OTEL_ENABLED" = "true" ]; then \
61
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
62
+ if [ "$OTEL_ENABLED" = "true" ]; then \
59
63
  bun add @hono/otel \
60
64
  @opentelemetry/instrumentation-http \
61
65
  @opentelemetry/exporter-metrics-otlp-http \
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.2.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/orcid-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/orcid-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/orcid-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.2.7-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/orcid-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/orcid-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/orcid-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -35,7 +35,7 @@ Nine tools organized around three workflows — author disambiguation, researche
35
35
  |:-----|:------------|
36
36
  | `orcid_search_researchers` | Search the ORCID registry using structured field params (name, affiliation, keyword, ROR ID, DOI, PMID). All params are ANDed into a Solr query against the expanded-search endpoint, returning ORCID iDs with inline name and institution data. |
37
37
  | `orcid_get_profile` | Fetch a researcher's public profile: name, biography, keywords, researcher URLs, and external identifiers (Scopus Author ID, ResearcherID, Loop, etc.). |
38
- | `orcid_get_works` | Retrieve works (publications, datasets, software, preprints) for a researcher. Returns summaries with put-codes, titles, types, dates, journal names, and external identifiers. Pass put-codes to `orcid_get_work_detail` for abstracts and full contributor lists. |
38
+ | `orcid_get_works` | Retrieve works (publications, datasets, software, preprints) for a researcher. Returns summaries with put-codes, titles, types, dates, journal names, and external identifiers. Returns the first 50 by default with `workCount` and paging via `offset`/`nextOffset` (or `limit`); set `include_external_ids` false for a lighter payload. Pass put-codes to `orcid_get_work_detail` for abstracts and full contributor lists. |
39
39
  | `orcid_get_work_detail` | Fetch full detail records for 1–100 works by their put-codes in a single bulk request (from `orcid_get_works`). Returns abstracts, all contributors with CRediT roles, complete external IDs, citation metadata, journal title, and URL. Per-record errors are surfaced without failing the whole call. |
40
40
  | `orcid_get_affiliations` | Fetch affiliation records for a researcher. Accepts a `types` list to filter which sections to return: `employment`, `education`, `invited-positions`, `distinctions`, `memberships`, `qualifications`, `services`, or `all`. |
41
41
  | `orcid_get_funding` | Fetch funding records: grants, contracts, awards, and salary awards, with funder names, grant numbers, and funding periods. |
@@ -72,6 +72,8 @@ Fetch a researcher's public person section by ORCID iD.
72
72
  Retrieve the works list for a researcher.
73
73
 
74
74
  - Returns work summaries: title, type, publication date, journal name, and all external identifiers (DOI, PMID, arXiv ID, ISBN, etc.)
75
+ - Returns the first 50 works by default; `workCount` reports the total available, and prolific records are paged with `offset` plus the returned `nextOffset` (or raise `limit`, max 1000). `truncated` flags when more works remain
76
+ - Set `include_external_ids` to `false` to drop identifier lists when only titles, types, and dates are needed
75
77
  - External IDs are returned in formats consumable by downstream servers (Crossref, PubMed, arXiv)
76
78
  - Works list is summaries only — chain to the relevant server for full metadata or abstracts
77
79
 
@@ -143,7 +145,7 @@ Disambiguate an author name to a verified ORCID iD.
143
145
  | Type | Name | Description |
144
146
  |:-----|:-----|:------------|
145
147
  | Resource | `orcid://researcher/{orcid_id}/profile` | Researcher profile (person section: name, bio, keywords, external IDs). Prefer the tool when the response needs to flow into conditional logic. |
146
- | Resource | `orcid://researcher/{orcid_id}/works` | Works list for a researcher. DOIs and PMIDs in the response are ready for Crossref/PubMed chaining. |
148
+ | Resource | `orcid://researcher/{orcid_id}/works` | Works list for a researcher — the first 25 works plus `workCount` (the total available). Use the `orcid_get_works` tool to page the full list. DOIs and PMIDs in the response are ready for Crossref/PubMed chaining. |
147
149
 
148
150
  All resource data is also reachable via tools. Use resources when injecting stable researcher context into a prompt; use tools when filtering or processing results is needed.
149
151
 
@@ -0,0 +1,19 @@
1
+ ---
2
+ summary: "Adopt @cyanheads/mcp-ts-core ^0.10.9 — devcheck gains two static guards (floating dependency specifiers, plugin marketplace manifest correctness); synced framework scripts, skills, and devcheck config. No tool, resource, or server source changed."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.6 — 2026-06-20
8
+
9
+ Maintenance release: framework adoption only. No tool, resource, or server source changed.
10
+
11
+ ## Changed
12
+
13
+ - **`@cyanheads/mcp-ts-core`** `^0.10.8` → `^0.10.9`. Notable framework changes inherited:
14
+ - **`check-dependency-specifiers` devcheck step** — new `scripts/check-dependency-specifiers.ts`, hard-fails on floating specifiers (`latest`, `*`, pre-release dist-tags) in `package.json`'s dependency sections and `bun.lock`'s `workspaces` specifier maps. Catches `bun update --latest` writing a literal `latest` dist-tag into the lock's workspace map, which would otherwise re-resolve a dep past its `package.json` range on the next install. Static and local — runs in the default and `--fast` passes. ([mcp-ts-core#246](https://github.com/cyanheads/mcp-ts-core/issues/246))
15
+ - **Plugin marketplace manifest checks in `lint:packaging`** — `scripts/lint-packaging.ts` validates `.claude-plugin/plugin.json` and `.codex-plugin/plugin.json`/`mcp.json`: non-empty descriptions, display fields carrying the unscoped machine name, and the `npx -y` install arg carrying the full `package.json` name. Gated by the new `devcheck.config.json` `packaging.pluginManifests` flag. ([mcp-ts-core#240](https://github.com/cyanheads/mcp-ts-core/issues/240))
16
+ - **`@cloudflare/workers-types`** `4.20260619.1` → `4.20260620.1` (transitive, via the framework).
17
+ - **`scripts/`** — synced the framework's `devcheck.ts` (registers the `Dependency Specifiers` check) and `lint-packaging.ts` (plugin-manifest validation); added `check-dependency-specifiers.ts`.
18
+ - **`devcheck.config.json`** — added `packaging.pluginManifests: true` to enable the plugin-manifest packaging checks.
19
+ - **`skills/polish-docs-meta`** — re-synced from the framework (step 10 documents the automated plugin-manifest subset).
@@ -0,0 +1,34 @@
1
+ ---
2
+ summary: "Local ISO 7064 checksum validation rejects invalid ORCID iDs before upstream calls (#14); orcid_get_works gains limit/offset/include_external_ids pagination, the works resource caps to a compact first-25 page (#16); adopts mcp-ts-core ^0.10.14 and Bun/Socket supply-chain hardening."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.7 — 2026-07-13
8
+
9
+ ## Fixed
10
+
11
+ - **ORCID iD checksum validation** (#14) — `orcid_id` schemas now verify the ISO/IEC 7064:2003 MOD 11-2 check digit, not just the visible shape. A checksum-invalid but well-shaped iD (e.g. `0000-0000-0000-0000`) previously passed local validation and triggered an upstream request that failed with `profile_not_found`; it now fails locally with `InvalidParams` before any ORCID call. New shared validator `src/services/orcid/orcid-id.ts` (`isValidOrcidId`, `normalizeOrcidId`, `orcidIdSchema`, `orcidIdParamSchema`) applied across all 9 definitions that accept `orcid_id`: the `get-profile`, `get-works`, `get-affiliations`, `get-funding`, `get-peer-reviews`, `get-work-detail`, `get-research-resources` tools and the `researcher-profile` / `researcher-works` resources.
12
+
13
+ ## Added
14
+
15
+ - **`orcid_get_works` pagination** (#16) — new `limit` (default 50, max 1000), `offset` (default 0), and `include_external_ids` (default true) inputs. New `returnedCount`, `offset`, `nextOffset`, `truncated` outputs alongside `workCount` (now the pre-slice total available). The normalized works array is sliced locally over ORCID's single grouped `/works` response; `include_external_ids: false` drops each work's identifier list for a lighter payload.
16
+ - **`.github/SECURITY.md`**, **`LICENSE`**, **`.gitattributes`** — vulnerability-disclosure policy, Apache-2.0 license file, and line-ending/binary/generated-file rules.
17
+
18
+ ## Changed
19
+
20
+ - **`orcid://researcher/{orcid_id}/works` resource** (#16) — caps its inline `works` array to the first 25 records; `workCount` continues to report the full total available. Cursor-based pagination was evaluated but is infeasible here: the MCP SDK's URI-template matcher compiles a `{?cursor}` query expansion to a *required* segment, so a single resource template can't match both the natural no-cursor first read and a `?cursor=` continuation. Full paging stays on the `orcid_get_works` tool.
21
+ - **Adopt `@cyanheads/mcp-ts-core` `^0.10.14` supply-chain hardening** — Bun install-time malware/typosquat/CVE scanning via `@socketsecurity/bun-security-scanner` (configured in `bunfig.toml` `[install.security]`, added to `trustedDependencies`); `bunfig.toml` `minimumReleaseAge` blocks installing package versions published less than 3 days ago, excluding `@cyanheads/mcp-ts-core` so framework releases adopt same-day; Dockerfile now pins `oven/bun:1.3.14` (was `1.3`/`1.3-slim`), adds BuildKit cache mounts for Bun's install cache, and runs `--ignore-scripts` on the production dependency install.
22
+ - **`package.json` `author`** corrected to `Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)`.
23
+
24
+ ## Dependencies
25
+
26
+ - `@cyanheads/mcp-ts-core` `^0.10.9` → `^0.10.14`
27
+ - `@biomejs/biome` `^2.5.0` → `^2.5.3`
28
+ - `@types/node` `^26.0.0` → `^26.1.1`
29
+ - `ignore` `^7.0.5` → `^7.0.6`
30
+ - `tsc-alias` `^1.8.17` → `^1.9.0`
31
+ - `vitest` `^4.1.9` → `^4.1.10`
32
+ - `@socketsecurity/bun-security-scanner` — new, `^1.1.2`
33
+ - `typescript` held at `^6.0.3` (now on the devcheck `outdated` allowlist — TS 7.x is a major, out of range)
34
+ - Bun `1.3.2` → `1.3.14` (`packageManager`, Docker base image)
@@ -15,9 +15,11 @@ summary: ""
15
15
  # usage. Flagged as `Breaking` in the rollup.
16
16
  breaking: false
17
17
 
18
- # Set `true` if this release contains any security fix. Pairs with the
19
- # `## Security` section below. Flagged as `Security` in the rollup so
20
- # users can triage upgrade urgency at a glance.
18
+ # Set `true` ONLY for a security fix in THIS project's own source code — a
19
+ # vulnerability or hardening in code you ship. A dependency or transitive CVE
20
+ # bump is routine maintenance, NOT a security release: record it under
21
+ # `## Dependencies` (with the advisory ID) and leave this `false`. When true,
22
+ # pairs with the `## Security` section below and flags `Security` in the rollup.
21
23
  security: false
22
24
 
23
25
  # Optional free-form notes for maintenance agents processing this release.
@@ -1 +1 @@
1
- {"version":3,"file":"researcher-profile.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/researcher-profile.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKrD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;6BAgFpC,CAAC"}
1
+ {"version":3,"file":"researcher-profile.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/researcher-profile.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAMrD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;6BAiFpC,CAAC"}
@@ -5,17 +5,15 @@
5
5
  * @module mcp-server/resources/definitions/researcher-profile.resource
6
6
  */
7
7
  import { resource, z } from '@cyanheads/mcp-ts-core';
8
- import { JsonRpcErrorCode, McpError, notFound } from '@cyanheads/mcp-ts-core/errors';
8
+ import { invalidParams, JsonRpcErrorCode, McpError, notFound } from '@cyanheads/mcp-ts-core/errors';
9
+ import { isValidOrcidId, orcidIdParamSchema } from '../../../services/orcid/orcid-id.js';
9
10
  import { getOrcidService, normalizeOrcidId } from '../../../services/orcid/orcid-service.js';
10
11
  export const researcherProfileResource = resource('orcid://researcher/{orcid_id}/profile', {
11
12
  name: 'orcid-researcher-profile',
12
13
  description: 'Researcher profile (person section) from ORCID: name, biography, keywords, researcher URLs, and external identifiers. Use when injecting researcher identity context into a prompt or checking for a specific external ID (e.g., Scopus ID for cross-server chaining). Prefer the orcid_get_profile tool when the response needs to flow into conditional logic.',
13
14
  mimeType: 'application/json',
14
15
  params: z.object({
15
- orcid_id: z
16
- .string()
17
- .regex(/^(https?:\/\/orcid\.org\/)?\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/, 'Must be a valid ORCID iD (e.g. 0000-0001-2345-6789) or full ORCID URI.')
18
- .describe('ORCID iD — bare format (0000-0001-2345-6789) or full URI (https://orcid.org/0000-0001-2345-6789).'),
16
+ orcid_id: orcidIdParamSchema,
19
17
  }),
20
18
  output: z.object({
21
19
  orcidId: z.string().describe('Normalized ORCID iD (bare format).'),
@@ -36,6 +34,12 @@ export const researcherProfileResource = resource('orcid://researcher/{orcid_id}
36
34
  .describe('External scholarly identifiers (Scopus, ResearcherID, Loop, etc.).'),
37
35
  }),
38
36
  async handler(params, ctx) {
37
+ // Reject a checksum-invalid iD locally, before any upstream call — mirrors the
38
+ // tool route's InvalidParams. The regex-only param schema matched the shape; the
39
+ // ISO 7064 check digit is verified here.
40
+ if (!isValidOrcidId(params.orcid_id)) {
41
+ throw invalidParams(`The ORCID iD ${params.orcid_id} is invalid — its ISO 7064 check digit does not match. Verify the iD and try again.`);
42
+ }
39
43
  const service = getOrcidService();
40
44
  const bareId = normalizeOrcidId(params.orcid_id);
41
45
  ctx.log.debug('orcid-researcher-profile resource', { orcidId: bareId });