@cyanheads/ensembl-mcp-server 0.4.4 → 0.5.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 +15 -12
- package/CLAUDE.md +15 -12
- package/Dockerfile +110 -33
- package/README.md +25 -37
- package/changelog/0.5.x/0.5.0.md +25 -0
- package/changelog/0.5.x/0.5.1.md +28 -0
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.d.ts.map +1 -1
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.js +12 -5
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-homology.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-homology.tool.js +6 -8
- package/dist/mcp-server/tools/definitions/get-homology.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-sequence.tool.d.ts +14 -2
- package/dist/mcp-server/tools/definitions/get-sequence.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-sequence.tool.js +162 -53
- package/dist/mcp-server/tools/definitions/get-sequence.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.js +15 -15
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/predict-variant.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/predict-variant.tool.js +10 -14
- package/dist/mcp-server/tools/definitions/predict-variant.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/query-region.tool.d.ts +6 -1
- package/dist/mcp-server/tools/definitions/query-region.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/query-region.tool.js +121 -30
- package/dist/mcp-server/tools/definitions/query-region.tool.js.map +1 -1
- package/dist/services/ensembl/ensembl-service.d.ts +11 -0
- package/dist/services/ensembl/ensembl-service.d.ts.map +1 -1
- package/dist/services/ensembl/ensembl-service.js +26 -0
- package/dist/services/ensembl/ensembl-service.js.map +1 -1
- package/dist/services/ensembl/types.d.ts +11 -0
- package/dist/services/ensembl/types.d.ts.map +1 -1
- package/package.json +11 -10
- package/server.json +10 -24
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** ensembl-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 0.5.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.14`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.2.0
|
|
8
8
|
**Zod:** ^4.6.5
|
|
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.
|
|
@@ -136,6 +136,8 @@ export function getServerConfig() {
|
|
|
136
136
|
|
|
137
137
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`ENSEMBL_BASE_URL`) not the path (`baseUrl`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
138
138
|
|
|
139
|
+
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.
|
|
140
|
+
|
|
139
141
|
### Server identity and instructions
|
|
140
142
|
|
|
141
143
|
The canonical `createApp()` identity for this project is `name: 'ensembl-mcp-server'` plus `title: 'ensembl-mcp-server'`. Keep both bare and hyphenated; npm and install surfaces retain the published `@cyanheads/ensembl-mcp-server` identity. Package metadata supplies the description and website, so don't duplicate those fields in `createApp()`.
|
|
@@ -167,13 +169,14 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
167
169
|
| Property | Description |
|
|
168
170
|
|:---------|:------------|
|
|
169
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. |
|
|
170
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.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 JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
|
|
171
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. |
|
|
172
|
-
| `ctx.inputs` |
|
|
174
|
+
| `ctx.inputs` | The request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped` — limited to what the client declared (`elicitation` and its form/url modes, `sampling`, `roots`). Client-supplied: a consent gate trusts only a `ctx.state` record it stored when it asked, bound to the operation, caller, and target (see the `api-context` skill). |
|
|
175
|
+
| `ctx.clientCapabilities` | What the client declared for this request, `undefined` when no view exists. Decides whether to ask for optional context (e.g. roots); never a reason to skip a consent prompt. |
|
|
173
176
|
| `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). |
|
|
174
177
|
| `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`. |
|
|
175
178
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
176
|
-
| `ctx.requestId` |
|
|
179
|
+
| `ctx.requestId` | Request ID — the one every log record of the call carries and its error envelope returns as `data.requestId`. |
|
|
177
180
|
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
178
181
|
|
|
179
182
|
---
|
|
@@ -182,7 +185,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
182
185
|
|
|
183
186
|
Handlers throw — the framework catches, classifies, and formats.
|
|
184
187
|
|
|
185
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` 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.
|
|
188
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` 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. The framework puts it on the wire whenever a failure carrying that `reason` arrives without a hint — a bare `ctx.fail('reason')` or a service throw with `data: { reason }` — as `data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim; override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Every error envelope also carries `data.requestId`, the id the server's log records for that call carry, and `content[]` closes with `(reason … · request <id>)`. Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
186
189
|
|
|
187
190
|
```ts
|
|
188
191
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -194,7 +197,7 @@ errors: [
|
|
|
194
197
|
],
|
|
195
198
|
async handler(input, ctx) {
|
|
196
199
|
const item = await db.find(input.id);
|
|
197
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
200
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
|
|
198
201
|
return item;
|
|
199
202
|
}
|
|
200
203
|
```
|
|
@@ -215,7 +218,7 @@ throw new Error('Invalid query format'); // → ValidationError
|
|
|
215
218
|
|
|
216
219
|
// McpError — when no factory exists for the code
|
|
217
220
|
import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
218
|
-
throw new McpError(JsonRpcErrorCode.
|
|
221
|
+
throw new McpError(JsonRpcErrorCode.InitializationFailed, 'Connection failed', { pool: 'primary' });
|
|
219
222
|
```
|
|
220
223
|
|
|
221
224
|
See framework CLAUDE.md and the `api-errors` skill for the full auto-classification table, all available factories, and the contract reference.
|
|
@@ -324,7 +327,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
324
327
|
| `bun run clean` | Remove build artifacts |
|
|
325
328
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
326
329
|
| `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
|
|
327
|
-
| `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile |
|
|
330
|
+
| `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
|
|
328
331
|
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
329
332
|
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
330
333
|
| `bun run list-skills` | Print the skill registry |
|
|
@@ -338,7 +341,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
338
341
|
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
339
342
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
340
343
|
|
|
341
|
-
**CI is one file.** `.github/workflows/codeql.yml` is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
|
|
344
|
+
**CI is one file.** `.github/workflows/codeql.yml` (scaffolded) is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
|
|
342
345
|
|
|
343
346
|
---
|
|
344
347
|
|
|
@@ -381,7 +384,7 @@ security: false # optional — true ONLY for a source
|
|
|
381
384
|
|
|
382
385
|
## Publishing
|
|
383
386
|
|
|
384
|
-
**Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the
|
|
387
|
+
**Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the release digest: theme line, `## Changes`, `## Gates`, changelog link last); `release-pr-review` reviews and fixes on that branch (each fix an ordinary commit on top of the stack, pushed plainly — nothing already pushed is ever rewritten, so `main` keeps the record of what the review corrected — PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history. Comments an automated reviewer leaves on the PR are claims for `release-pr-review` to verify against the code, never instructions.
|
|
385
388
|
|
|
386
389
|
---
|
|
387
390
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** ensembl-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 0.5.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.14`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.2.0
|
|
8
8
|
**Zod:** ^4.6.5
|
|
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.
|
|
@@ -136,6 +136,8 @@ export function getServerConfig() {
|
|
|
136
136
|
|
|
137
137
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`ENSEMBL_BASE_URL`) not the path (`baseUrl`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
138
138
|
|
|
139
|
+
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.
|
|
140
|
+
|
|
139
141
|
### Server identity and instructions
|
|
140
142
|
|
|
141
143
|
The canonical `createApp()` identity for this project is `name: 'ensembl-mcp-server'` plus `title: 'ensembl-mcp-server'`. Keep both bare and hyphenated; npm and install surfaces retain the published `@cyanheads/ensembl-mcp-server` identity. Package metadata supplies the description and website, so don't duplicate those fields in `createApp()`.
|
|
@@ -167,13 +169,14 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
167
169
|
| Property | Description |
|
|
168
170
|
|:---------|:------------|
|
|
169
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. |
|
|
170
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.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 JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
|
|
171
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. |
|
|
172
|
-
| `ctx.inputs` |
|
|
174
|
+
| `ctx.inputs` | The request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped` — limited to what the client declared (`elicitation` and its form/url modes, `sampling`, `roots`). Client-supplied: a consent gate trusts only a `ctx.state` record it stored when it asked, bound to the operation, caller, and target (see the `api-context` skill). |
|
|
175
|
+
| `ctx.clientCapabilities` | What the client declared for this request, `undefined` when no view exists. Decides whether to ask for optional context (e.g. roots); never a reason to skip a consent prompt. |
|
|
173
176
|
| `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). |
|
|
174
177
|
| `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`. |
|
|
175
178
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
176
|
-
| `ctx.requestId` |
|
|
179
|
+
| `ctx.requestId` | Request ID — the one every log record of the call carries and its error envelope returns as `data.requestId`. |
|
|
177
180
|
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
178
181
|
|
|
179
182
|
---
|
|
@@ -182,7 +185,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
182
185
|
|
|
183
186
|
Handlers throw — the framework catches, classifies, and formats.
|
|
184
187
|
|
|
185
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` 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.
|
|
188
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` 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. The framework puts it on the wire whenever a failure carrying that `reason` arrives without a hint — a bare `ctx.fail('reason')` or a service throw with `data: { reason }` — as `data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim; override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Every error envelope also carries `data.requestId`, the id the server's log records for that call carry, and `content[]` closes with `(reason … · request <id>)`. Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
186
189
|
|
|
187
190
|
```ts
|
|
188
191
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -194,7 +197,7 @@ errors: [
|
|
|
194
197
|
],
|
|
195
198
|
async handler(input, ctx) {
|
|
196
199
|
const item = await db.find(input.id);
|
|
197
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
200
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
|
|
198
201
|
return item;
|
|
199
202
|
}
|
|
200
203
|
```
|
|
@@ -215,7 +218,7 @@ throw new Error('Invalid query format'); // → ValidationError
|
|
|
215
218
|
|
|
216
219
|
// McpError — when no factory exists for the code
|
|
217
220
|
import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
218
|
-
throw new McpError(JsonRpcErrorCode.
|
|
221
|
+
throw new McpError(JsonRpcErrorCode.InitializationFailed, 'Connection failed', { pool: 'primary' });
|
|
219
222
|
```
|
|
220
223
|
|
|
221
224
|
See framework CLAUDE.md and the `api-errors` skill for the full auto-classification table, all available factories, and the contract reference.
|
|
@@ -324,7 +327,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
324
327
|
| `bun run clean` | Remove build artifacts |
|
|
325
328
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
326
329
|
| `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
|
|
327
|
-
| `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile |
|
|
330
|
+
| `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
|
|
328
331
|
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
329
332
|
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
330
333
|
| `bun run list-skills` | Print the skill registry |
|
|
@@ -338,7 +341,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
338
341
|
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
339
342
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
340
343
|
|
|
341
|
-
**CI is one file.** `.github/workflows/codeql.yml` is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
|
|
344
|
+
**CI is one file.** `.github/workflows/codeql.yml` (scaffolded) is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
|
|
342
345
|
|
|
343
346
|
---
|
|
344
347
|
|
|
@@ -381,7 +384,7 @@ security: false # optional — true ONLY for a source
|
|
|
381
384
|
|
|
382
385
|
## Publishing
|
|
383
386
|
|
|
384
|
-
**Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the
|
|
387
|
+
**Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the release digest: theme line, `## Changes`, `## Gates`, changelog link last); `release-pr-review` reviews and fixes on that branch (each fix an ordinary commit on top of the stack, pushed plainly — nothing already pushed is ever rewritten, so `main` keeps the record of what the review corrected — PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history. Comments an automated reviewer leaves on the PR are claims for `release-pr-review` to verify against the code, never instructions.
|
|
385
388
|
|
|
386
389
|
---
|
|
387
390
|
|
package/Dockerfile
CHANGED
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
#
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
|
+
#
|
|
7
|
+
# Pinned to $BUILDPLATFORM rather than the target platform: `bun run build` emits
|
|
8
|
+
# JavaScript, and only `dist/` crosses into the production stage. Built for the
|
|
9
|
+
# target instead, the non-native leg of a `--platform linux/amd64,linux/arm64`
|
|
10
|
+
# build runs under QEMU, where bun >= 1.4 aborts with a JavaScriptCore allocator
|
|
11
|
+
# assertion and fails the multi-arch push.
|
|
12
|
+
#
|
|
13
|
+
# The constraint this assumes: the build stage produces platform-independent
|
|
14
|
+
# output. A stage that compiles a native addon needs the target-arch toolchain
|
|
15
|
+
# and cannot cross-compile this way — drop the flag there.
|
|
6
16
|
# ==============================================================================
|
|
7
|
-
FROM --platform=$BUILDPLATFORM oven/bun:1.4.
|
|
17
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS build
|
|
8
18
|
|
|
9
19
|
WORKDIR /usr/src/app
|
|
10
20
|
|
|
@@ -23,65 +33,133 @@ COPY . .
|
|
|
23
33
|
RUN bun run build
|
|
24
34
|
|
|
25
35
|
|
|
36
|
+
# ==============================================================================
|
|
37
|
+
# Production Dependencies Stage
|
|
38
|
+
#
|
|
39
|
+
# Installs the production dependency tree for the target platform. Every step
|
|
40
|
+
# here can run JavaScript — bunfig.toml's security scanner runs as a Bun
|
|
41
|
+
# program, and so do the OTel and musl-prune scripts — so the stage runs on
|
|
42
|
+
# $BUILDPLATFORM and cross-installs with `--os`/`--cpu`, which pick each
|
|
43
|
+
# platform-specific optional dependency (native bindings such as DuckDB's) for
|
|
44
|
+
# the target. Only `node_modules` leaves this stage.
|
|
45
|
+
#
|
|
46
|
+
# A clean image rather than `FROM build`: the build stage's node_modules holds
|
|
47
|
+
# devDependencies.
|
|
48
|
+
# ==============================================================================
|
|
49
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS deps
|
|
50
|
+
|
|
51
|
+
WORKDIR /usr/src/app
|
|
52
|
+
|
|
53
|
+
# Copy dependency manifests. `bunfig.toml` rides along so every install below
|
|
54
|
+
# passes its release-age gate and security scanner, as a local install does.
|
|
55
|
+
COPY package.json bun.lock bunfig.toml ./
|
|
56
|
+
|
|
57
|
+
# The scanner bunfig.toml names is a devDependency, and Bun installs a missing
|
|
58
|
+
# scanner through the same production-filtered install, which omits it and
|
|
59
|
+
# aborts. Seed it from the build stage's full install instead. Remove this line,
|
|
60
|
+
# and the `rm` at the end of this stage, if bunfig.toml stops naming a scanner.
|
|
61
|
+
COPY --from=build /usr/src/app/node_modules/@socketsecurity/bun-security-scanner ./node_modules/@socketsecurity/bun-security-scanner
|
|
62
|
+
|
|
63
|
+
# Docker names the target architecture `amd64`/`arm64`; Bun's `--cpu` takes
|
|
64
|
+
# `x64`/`arm64`. Mapped once here, read by both installs below. `oven/bun`
|
|
65
|
+
# publishes only these two architectures, so any other target fails here.
|
|
66
|
+
ARG TARGETOS
|
|
67
|
+
ARG TARGETARCH
|
|
68
|
+
RUN case "$TARGETARCH" in \
|
|
69
|
+
amd64) echo x64 ;; \
|
|
70
|
+
arm64) echo arm64 ;; \
|
|
71
|
+
*) echo "Unsupported TARGETARCH '$TARGETARCH': expected amd64 or arm64" >&2; exit 1 ;; \
|
|
72
|
+
esac > .bun-cpu
|
|
73
|
+
|
|
74
|
+
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
75
|
+
# that are not needed in the final production image.
|
|
76
|
+
# `--omit=peer` drops the framework's optional peer tiers (test runner, service
|
|
77
|
+
# SDKs, parsers) that Bun would otherwise auto-install. Anything this server
|
|
78
|
+
# actually imports belongs in its own `dependencies`, so nothing needed at
|
|
79
|
+
# runtime is lost.
|
|
80
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
81
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts \
|
|
82
|
+
--os="$TARGETOS" --cpu="$(cat .bun-cpu)"
|
|
83
|
+
|
|
84
|
+
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
85
|
+
# Installed by default. Omit them for a leaner image at build time
|
|
86
|
+
# with: docker build --build-arg OTEL_ENABLED=false
|
|
87
|
+
# The script reads the list and each range from the installed framework's
|
|
88
|
+
# `peerDependencies` and passes the target flags on to its `bun install`.
|
|
89
|
+
COPY scripts/install-otel.ts ./scripts/
|
|
90
|
+
ARG OTEL_ENABLED=true
|
|
91
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
92
|
+
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
93
|
+
bun scripts/install-otel.ts --os="$TARGETOS" --cpu="$(cat .bun-cpu)"; \
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
# `--os`/`--cpu` have no libc counterpart, so a native dependency published in
|
|
97
|
+
# glibc and musl variants (DuckDB's bindings, for one) installs both. The
|
|
98
|
+
# runtime image is Debian (glibc) and never loads the musl copy; the script
|
|
99
|
+
# deletes every package whose own `libc` admits only musl. It follows every
|
|
100
|
+
# install, since a later `bun install` restores what it removes. A server on a
|
|
101
|
+
# musl (Alpine) runtime image drops these two lines.
|
|
102
|
+
COPY scripts/prune-musl-packages.ts ./scripts/
|
|
103
|
+
RUN bun scripts/prune-musl-packages.ts
|
|
104
|
+
|
|
105
|
+
# The seeded scanner served only the installs above; keep it out of the image.
|
|
106
|
+
RUN rm -rf node_modules/@socketsecurity/bun-security-scanner
|
|
107
|
+
|
|
108
|
+
|
|
26
109
|
# ==============================================================================
|
|
27
110
|
# Production Stage
|
|
28
111
|
#
|
|
29
112
|
# This stage creates a minimal, optimized, and secure image for running the
|
|
30
113
|
# application. It uses a slim base image and only includes production
|
|
31
|
-
# dependencies and build artifacts.
|
|
114
|
+
# dependencies and build artifacts. Its only Bun invocations are HEALTHCHECK
|
|
115
|
+
# and CMD, which run on the real target at container start.
|
|
32
116
|
# ==============================================================================
|
|
33
|
-
FROM oven/bun:1.4.
|
|
117
|
+
FROM oven/bun:1.4.2-slim AS production
|
|
34
118
|
|
|
35
119
|
WORKDIR /usr/src/app
|
|
36
120
|
|
|
37
|
-
# Set the environment to production for performance
|
|
38
|
-
# production dependencies are installed.
|
|
121
|
+
# Set the environment to production for performance.
|
|
39
122
|
ENV NODE_ENV=production
|
|
40
123
|
|
|
41
124
|
# OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
|
|
42
125
|
ARG APP_VERSION
|
|
43
126
|
LABEL org.opencontainers.image.title="@cyanheads/ensembl-mcp-server"
|
|
44
127
|
LABEL org.opencontainers.image.description="Look up genes, fetch sequences, predict variant consequences, find orthologs, and retrieve cross-database xrefs from Ensembl REST via MCP. STDIO or Streamable HTTP."
|
|
45
|
-
LABEL org.opencontainers.image.source="https://github.com/cyanheads/ensembl-mcp-server"
|
|
46
128
|
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
|
47
129
|
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
130
|
+
LABEL org.opencontainers.image.source="https://github.com/cyanheads/ensembl-mcp-server"
|
|
48
131
|
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# that are not needed in the final production image.
|
|
54
|
-
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
55
|
-
bun install --production --frozen-lockfile --ignore-scripts --omit=peer
|
|
56
|
-
|
|
57
|
-
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
58
|
-
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
59
|
-
# with: docker build --build-arg OTEL_ENABLED=true
|
|
60
|
-
ARG OTEL_ENABLED=true
|
|
61
|
-
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
62
|
-
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
63
|
-
bun add @hono/otel \
|
|
64
|
-
@opentelemetry/instrumentation-http \
|
|
65
|
-
@opentelemetry/exporter-metrics-otlp-http \
|
|
66
|
-
@opentelemetry/exporter-trace-otlp-http \
|
|
67
|
-
@opentelemetry/instrumentation-pino \
|
|
68
|
-
@opentelemetry/resources \
|
|
69
|
-
@opentelemetry/sdk-metrics \
|
|
70
|
-
@opentelemetry/sdk-node \
|
|
71
|
-
@opentelemetry/sdk-trace-node \
|
|
72
|
-
@opentelemetry/semantic-conventions \
|
|
73
|
-
--omit=dev --omit=peer --ignore-scripts; \
|
|
74
|
-
fi
|
|
132
|
+
# The manifest comes from the build context: the deps stage's copy was rewritten
|
|
133
|
+
# by the OTel install, and the runtime reads only its name, version, and type.
|
|
134
|
+
COPY package.json ./
|
|
135
|
+
COPY --from=deps /usr/src/app/node_modules ./node_modules
|
|
75
136
|
|
|
76
137
|
# Copy the compiled application code from the build stage
|
|
77
138
|
COPY --from=build /usr/src/app/dist ./dist
|
|
78
139
|
|
|
140
|
+
# Mirror CLI (MirrorService adopters only — Tier 3, opt-in):
|
|
141
|
+
# Copy your mirror lifecycle scripts and emit a runtime tsconfig so Bun resolves
|
|
142
|
+
# the @/ path alias against ./dist/ rather than ./src/.
|
|
143
|
+
# See the api-mirror skill for the full recipe.
|
|
144
|
+
#
|
|
145
|
+
# COPY --from=build /usr/src/app/scripts/<your>-mirror-init.ts \
|
|
146
|
+
# /usr/src/app/scripts/<your>-mirror-refresh.ts \
|
|
147
|
+
# /usr/src/app/scripts/<your>-mirror-verify.ts \
|
|
148
|
+
# /usr/src/app/scripts/_mirror-context.ts \
|
|
149
|
+
# ./scripts/
|
|
150
|
+
# RUN echo '{"compilerOptions":{"baseUrl":".","paths":{"@/*":["./dist/*"]}}}' > tsconfig.json
|
|
151
|
+
|
|
79
152
|
# The 'oven/bun' image already provides a non-root user named 'bun'.
|
|
80
153
|
# We will use this existing user for enhanced security.
|
|
81
154
|
|
|
82
155
|
# Create and set permissions for the log directory, assigning ownership to the 'bun' user.
|
|
83
156
|
RUN mkdir -p /var/log/ensembl-mcp-server && chown -R bun:bun /var/log/ensembl-mcp-server
|
|
84
157
|
|
|
158
|
+
# Writable data dirs for on-disk SQLite stores (catalog index / observations
|
|
159
|
+
# mirror), owned by the runtime user. Mount a volume over either in production.
|
|
160
|
+
RUN mkdir -p /usr/src/app/.cache /usr/src/app/.mirror \
|
|
161
|
+
&& chown -R bun:bun /usr/src/app/.cache /usr/src/app/.mirror
|
|
162
|
+
|
|
85
163
|
# Switch to the non-root user
|
|
86
164
|
USER bun
|
|
87
165
|
|
|
@@ -97,7 +175,6 @@ ENV MCP_TRANSPORT_TYPE="http"
|
|
|
97
175
|
ENV MCP_SESSION_MODE="stateless"
|
|
98
176
|
ENV MCP_LOG_LEVEL="info"
|
|
99
177
|
ENV LOGS_DIR="/var/log/ensembl-mcp-server"
|
|
100
|
-
ENV MCP_FORCE_CONSOLE_LOGGING="true"
|
|
101
178
|
|
|
102
179
|
# Expose the port the server listens on
|
|
103
180
|
EXPOSE ${MCP_HTTP_PORT}
|
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/ensembl-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/ensembl-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -64,80 +64,66 @@ All resource data is also reachable via the `ensembl_list_species` tool, which a
|
|
|
64
64
|
|
|
65
65
|
### `ensembl_list_species` <sub>tool</sub>
|
|
66
66
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- Returns internal name (the value every other tool expects), display name, common name, taxon ID, assembly, and division
|
|
70
|
-
- Required first step — species names like `homo_sapiens` are opaque to non-biologists
|
|
67
|
+
- Optional `division` (`EnsemblVertebrates`, `EnsemblPlants`, `EnsemblFungi`, `EnsemblMetazoa`, `EnsemblProtists`; omitted, the endpoint default — vertebrates, ~356 species on GRCh38) and `nameContains`, a substring match against name, display name, and common name
|
|
68
|
+
- Returns the internal name every other tool expects (`homo_sapiens`), plus display name, common name, taxon ID, assembly, and division
|
|
71
69
|
|
|
72
70
|
---
|
|
73
71
|
|
|
74
72
|
### `ensembl_lookup_gene` <sub>tool</sub>
|
|
75
73
|
|
|
76
|
-
- Exactly one of `symbol` (+
|
|
77
|
-
- `
|
|
78
|
-
- Batch modes (`ids`/`symbols`) return a `succeeded`/`failed` split with per-item error strings instead of failing the call
|
|
79
|
-
- Errors: `not_found`, `invalid_species`, `no_input`, `conflicting_input`
|
|
74
|
+
- Exactly one of `symbol` (+ `species`, default `homo_sapiens`), `id`, `ids`, or `symbols` (batches up to 20); `expand_transcripts` (default `false`) adds the transcript list with biotype and canonical flag
|
|
75
|
+
- A single lookup returns `gene`; a batch returns a `succeeded`/`failed` split with per-item errors instead of failing the call. Errors: `not_found`, `invalid_species`, `no_input`, `conflicting_input`
|
|
80
76
|
|
|
81
77
|
---
|
|
82
78
|
|
|
83
79
|
### `ensembl_get_sequence` <sub>tool</sub>
|
|
84
80
|
|
|
85
|
-
- `
|
|
86
|
-
-
|
|
87
|
-
- `
|
|
88
|
-
- `protein` and `cds` require a transcript or protein ID, not a gene ID
|
|
89
|
-
- Every response states `length` so callers can budget context before consuming large sequences
|
|
90
|
-
- Errors: `not_found`, `type_mismatch`, `missing_species`
|
|
81
|
+
- A stable ID (`ENSG…`/`ENST…`/`ENSP…`) or a region (`species:chr:start-end`, or `chr:start-end` with `species`; at most 10,000,000 bases); `type` is `genomic` (default), `cdna`, `cds`, or `protein`, the last three from a transcript or protein ID only; `expand_5prime`/`expand_3prime` add flanking bases
|
|
82
|
+
- Returns a window set by `offset` (default `0`) and `max_length` (default `10000`, `0` uncapped); `length` is the full sequence length, and `truncated`/`nextOffset` say where to resume
|
|
83
|
+
- Errors: `not_found`, `type_mismatch`, `missing_species`, `invalid_region`
|
|
91
84
|
|
|
92
85
|
---
|
|
93
86
|
|
|
94
87
|
### `ensembl_query_region` <sub>tool</sub>
|
|
95
88
|
|
|
96
|
-
- `
|
|
97
|
-
-
|
|
98
|
-
- Exon rows carry a `parentId` and `rank`, since one exon is reported once per parent transcript
|
|
99
|
-
- Errors: `invalid_region`, `invalid_species`
|
|
89
|
+
- `species` and `region` (`chr:start-end`, at most 5,000,000 bases); `feature` defaults to `["gene"]` and also accepts `transcript`, `variation`, `regulatory`, `exon`; optional `biotype` filter
|
|
90
|
+
- `max_results` caps the list (default `100`, `0` uncapped) while `totalCount` reports the true count; `assemblyName` names the coordinates' assembly, and exon rows carry `parentId` and `rank`. Errors: `invalid_region`, `invalid_species`
|
|
100
91
|
|
|
101
92
|
---
|
|
102
93
|
|
|
103
94
|
### `ensembl_predict_variant` <sub>tool</sub>
|
|
104
95
|
|
|
105
|
-
- `variant`
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
- Totals (`transcriptConsequencesTotal`, `pubmedTotal`) are always reported even when capped
|
|
109
|
-
- Errors: `invalid_notation`, `not_found`
|
|
96
|
+
- `variant` as HGVS (transcript-relative or genomic), region+allele (`chr:start:end:strand/allele`), or a dbSNP rsID
|
|
97
|
+
- Returns the most severe consequence, per-transcript impact (HIGH/MODERATE/LOW/MODIFIER), and colocated known variants with clinical significance. Errors: `invalid_notation`, `not_found`
|
|
98
|
+
- `max_transcript_consequences` and `max_pubmed_ids_per_variant` (default `10` each, `0` uncapped; `include_all_colocated_pubmed` lifts the PubMed cap) bound the result, while `transcriptConsequencesTotal` and `pubmedTotal` report the full counts
|
|
110
99
|
|
|
111
100
|
---
|
|
112
101
|
|
|
113
102
|
### `ensembl_get_homology` <sub>tool</sub>
|
|
114
103
|
|
|
115
|
-
- Exactly one of `symbol` (+ `species`, default `homo_sapiens`) or `id`; optional `target_species` filter
|
|
116
|
-
- `
|
|
117
|
-
- `max_results` caps the homolog list (default `25`, `0` uncapped); `totalCount` always reports the true count available
|
|
118
|
-
- Errors: `not_found`, `no_input`, `conflicting_input`
|
|
104
|
+
- Exactly one of `symbol` (+ `species`, default `homo_sapiens`) or `id`; `type` is `orthologues` (default), `paralogues`, or `all`; optional `target_species` filter
|
|
105
|
+
- `max_results` caps the list (default `25`, `0` uncapped) while `totalCount` reports the true count. Errors: `not_found`, `no_input`, `conflicting_input`
|
|
119
106
|
|
|
120
107
|
---
|
|
121
108
|
|
|
122
109
|
### `ensembl_get_xrefs` <sub>tool</sub>
|
|
123
110
|
|
|
124
111
|
- `id` (`ENSG…`/`ENST…`) required; optional `dbname` filter (e.g. `HGNC`, `Uniprot_gn`, `EntrezGene`, `MIM_GENE`, `RefSeq_mRNA`, `Reactome`, `GO`)
|
|
125
|
-
-
|
|
126
|
-
- Errors: `not_found`
|
|
112
|
+
- Returns the full cross-reference set (56+ entries for a well-annotated gene such as BRCA2). Errors: `not_found`
|
|
127
113
|
|
|
128
114
|
---
|
|
129
115
|
|
|
130
116
|
### `ensembl://gene/{id}` <sub>resource</sub>
|
|
131
117
|
|
|
132
|
-
-
|
|
133
|
-
- Errors: `not_found`
|
|
118
|
+
- `id` is a gene stable ID (`ENSG…`); version suffix optional
|
|
119
|
+
- Returns location, biotype, description, and transcript list. Errors: `not_found`
|
|
134
120
|
|
|
135
121
|
---
|
|
136
122
|
|
|
137
123
|
### `ensembl://transcript/{id}` <sub>resource</sub>
|
|
138
124
|
|
|
139
|
-
-
|
|
140
|
-
- Errors: `not_found`
|
|
125
|
+
- `id` is a transcript stable ID (`ENST…`); version suffix optional
|
|
126
|
+
- Returns parent gene, location, biotype, canonical flag, and length. Errors: `not_found`
|
|
141
127
|
|
|
142
128
|
---
|
|
143
129
|
|
|
@@ -151,6 +137,7 @@ All resource data is also reachable via the `ensembl_list_species` tool, which a
|
|
|
151
137
|
### `ensembl://species/{division}` <sub>resource</sub>
|
|
152
138
|
|
|
153
139
|
- `division` required: `EnsemblVertebrates`, `EnsemblPlants`, `EnsemblFungi`, `EnsemblMetazoa`, or `EnsemblProtists`
|
|
140
|
+
- Returns that division's species — internal name, display name, assembly, taxon ID, and division
|
|
154
141
|
|
|
155
142
|
---
|
|
156
143
|
|
|
@@ -166,14 +153,14 @@ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): s
|
|
|
166
153
|
Ensembl-specific:
|
|
167
154
|
|
|
168
155
|
- Keyless REST API — no API key required; Ensembl REST is fully public at 55,000 req/hr
|
|
169
|
-
- Rate-limit-aware service layer:
|
|
170
|
-
- Batch POST endpoints used throughout — `POST /lookup/id`
|
|
156
|
+
- Rate-limit-aware service layer: retries 429 honoring `Retry-After`, and retries transient 5xx and HTML error pages
|
|
157
|
+
- Batch POST endpoints used throughout — `POST /lookup/id` and `POST /lookup/symbol/{species}` (up to 1,000 items each upstream) reduce N+1 round trips in multi-gene workflows
|
|
171
158
|
- GRCh37 legacy support via `ENSEMBL_BASE_URL` — point the entire server at `https://grch37.rest.ensembl.org` for clinical workflows on the older assembly
|
|
172
159
|
- All coordinate-bearing responses echo the assembly name so agents never see a bare genomic position without assembly context
|
|
173
160
|
|
|
174
161
|
Agent-friendly output:
|
|
175
162
|
|
|
176
|
-
-
|
|
163
|
+
- `ensembl_get_sequence` returns sequences in bounded windows (10,000 characters by default) with the full length and a `nextOffset` to continue, so a long gene or locus never lands in one response unasked
|
|
177
164
|
- `ensembl_list_species` is explicitly the discovery step — tool descriptions call out the opaque internal-name format and direct agents to it before using species-dependent tools
|
|
178
165
|
- Cross-tool chaining made explicit: xref IDs from `ensembl_get_xrefs` are described as inputs for protein and literature servers; the `ensembl_gene_dossier` prompt sequences all 6 tools into one research workflow
|
|
179
166
|
|
|
@@ -303,6 +290,7 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
|
|
|
303
290
|
| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
|
|
304
291
|
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |
|
|
305
292
|
| `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |
|
|
293
|
+
| `LOG_TOOL_FAILURE_PAYLOADS` | Log each failed tool call's arguments and result, redacted by key name and capped at `LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES` (default `16384`). A secret inside a free-form value is not redacted. | `false` |
|
|
306
294
|
| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
|
|
307
295
|
|
|
308
296
|
See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "ensembl_query_region caps its feature list (max_results) and returns assemblyName; ensembl_get_sequence returns bounded offset/max_length windows; oversized, reversed, and out-of-bounds regions classify as invalid_region; blank required identifiers are rejected at the schema across all tools"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.5.0 — 2026-09-23
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`ensembl_get_sequence` returns bounded windows** — default 10,000 characters, with new `offset`/`max_length` params to page through the rest; `truncated`/`nextOffset` say how to continue, `length` stays the full sequence length ([#19](https://github.com/cyanheads/ensembl-mcp-server/issues/19)).
|
|
12
|
+
- **`ensembl_query_region` caps its feature list** — `max_results` defaults to 100 (`0` for uncapped); `totalCount` always reports the true pre-cap count ([#17](https://github.com/cyanheads/ensembl-mcp-server/issues/17)).
|
|
13
|
+
- **`ensembl_query_region` returns `assemblyName`** — read from the overlap rows or resolved via `/info/assembly` and cached per species for the process ([#23](https://github.com/cyanheads/ensembl-mcp-server/issues/23)).
|
|
14
|
+
|
|
15
|
+
## Fixed
|
|
16
|
+
|
|
17
|
+
- **`ensembl_query_region` rejects an empty `feature` array** at the schema instead of forwarding it to Ensembl ([#21](https://github.com/cyanheads/ensembl-mcp-server/issues/21)).
|
|
18
|
+
- **Oversized, reversed, or out-of-bounds regions classify as `invalid_region`** on both region tools, with actionable recovery guidance — also undecodable regions on `ensembl_query_region` (limit 5,000,000 bases) and unknown sequence regions on `ensembl_get_sequence` (limit 10,000,000 bases), which rejects reversed coordinates before any request ([#24](https://github.com/cyanheads/ensembl-mcp-server/issues/24), [#27](https://github.com/cyanheads/ensembl-mcp-server/issues/27), [#28](https://github.com/cyanheads/ensembl-mcp-server/issues/28)).
|
|
19
|
+
- **Both region tools classify Ensembl's error text in linear time** — the patterns matched against the echoed id or region no longer backtrack, and on `ensembl_get_sequence` an unknown stable ID whose echo reads like a type mismatch now reports `not_found` ([#27](https://github.com/cyanheads/ensembl-mcp-server/issues/27), [#28](https://github.com/cyanheads/ensembl-mcp-server/issues/28)).
|
|
20
|
+
- **`ensembl_get_sequence` rejects a non-genomic `type` for a region id** as `type_mismatch` — `/sequence/region` ignores `type` and always serves genomic DNA, so the tool now fails the request instead of mislabeling it ([#25](https://github.com/cyanheads/ensembl-mcp-server/issues/25)).
|
|
21
|
+
- **Blank or whitespace-only required identifiers are rejected at the schema** — `id`, `region`, `species`, `variant`, and batch `ids`/`symbols` entries across every tool, instead of reaching Ensembl unfiltered ([#22](https://github.com/cyanheads/ensembl-mcp-server/issues/22)).
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
- `@types/node` `^26.6.1` → `^26.6.2`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Adopts mcp-ts-core 0.13.14: tool errors carry a request ID and their declared recovery hint with no server stack or request context in error data, numeric and boolean strings, a lone string for a list, and null optional arguments are repaired instead of rejected, and the Docker image installs dependencies on the build platform."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.5.1 — 2026-10-08
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **Tool errors carry a request ID** — `data.requestId` is set and the error text closes with the request ID (mcp-ts-core 0.13.10).
|
|
12
|
+
- **The framework fills each tool's declared recovery hint** from its error contract (mcp-ts-core 0.13.10); the per-throw `ctx.recoveryFor(...)` forwards in the tool definitions are removed. Callers receive identical recovery text.
|
|
13
|
+
- **Server stack traces, request context, and `data.rootCause` no longer reach error data** (mcp-ts-core 0.13.7, 0.13.8, 0.13.13).
|
|
14
|
+
- **Tool input repair** — numeric and boolean strings, a lone string for a list field, and `null` at an optional key are repaired before validation (mcp-ts-core 0.13.14), as is an integer sent for a string field (0.13.9).
|
|
15
|
+
- **Docker image installs production dependencies in a `deps` stage on the build platform** and drops musl-only packages, so the multi-arch build runs no JavaScript under QEMU (mcp-ts-core 0.13.10, 0.13.11). Bun `1.4.0` → `1.4.2`.
|
|
16
|
+
- **`server.json` npm entries no longer pass `run`/`start:*` arguments**; the streamable-http entry sets `MCP_TRANSPORT_TYPE=http` (mcp-ts-core 0.13.11).
|
|
17
|
+
- **Framework skills, scripts, `CLAUDE.md`/`AGENTS.md`, `README.md`, `.env.example`, and ignore files** resynced to the 0.13.14 templates.
|
|
18
|
+
|
|
19
|
+
## Dependencies
|
|
20
|
+
|
|
21
|
+
- `@cyanheads/mcp-ts-core` `^0.13.6` → `^0.13.14`
|
|
22
|
+
- `pino-pretty` `^13.1.3` → `^13.2.0`
|
|
23
|
+
- `@biomejs/biome` `^2.5.14` → `^2.5.15`
|
|
24
|
+
- `@socketsecurity/bun-security-scanner` `^1.1.2` → `^1.1.3`
|
|
25
|
+
- `@types/node` `^26.6.2` → `^26.6.4`
|
|
26
|
+
- `ignore` `^7.0.9` → `^7.0.12`
|
|
27
|
+
- `tsc-alias` `^1.9.5` → `^1.9.7`
|
|
28
|
+
- `vitest` `^5.0.1` → `^5.0.3`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gene-dossier.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/gene-dossier.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,wBAAwB;;;
|
|
1
|
+
{"version":3,"file":"gene-dossier.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/gene-dossier.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,wBAAwB;;;kBAqEnC,CAAC"}
|