@cyanheads/ensembl-mcp-server 0.1.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 +383 -0
- package/CLAUDE.md +383 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +326 -0
- package/changelog/0.1.x/0.1.1.md +31 -0
- package/changelog/template.md +127 -0
- package/dist/config/server-config.d.ts +14 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +21 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.js +60 -0
- package/dist/mcp-server/prompts/definitions/gene-dossier.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/gene.resource.d.ts +15 -0
- package/dist/mcp-server/resources/definitions/gene.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/gene.resource.js +59 -0
- package/dist/mcp-server/resources/definitions/gene.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/species.resource.d.ts +15 -0
- package/dist/mcp-server/resources/definitions/species.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/species.resource.js +48 -0
- package/dist/mcp-server/resources/definitions/species.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/transcript.resource.d.ts +15 -0
- package/dist/mcp-server/resources/definitions/transcript.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/transcript.resource.js +53 -0
- package/dist/mcp-server/resources/definitions/transcript.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-homology.tool.d.ts +43 -0
- package/dist/mcp-server/tools/definitions/get-homology.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-homology.tool.js +183 -0
- package/dist/mcp-server/tools/definitions/get-homology.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-sequence.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/get-sequence.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-sequence.tool.js +154 -0
- package/dist/mcp-server/tools/definitions/get-sequence.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.d.ts +28 -0
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.js +122 -0
- package/dist/mcp-server/tools/definitions/get-xrefs.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-species.tool.d.ts +28 -0
- package/dist/mcp-server/tools/definitions/list-species.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-species.tool.js +105 -0
- package/dist/mcp-server/tools/definitions/list-species.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.d.ts +57 -0
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.js +254 -0
- package/dist/mcp-server/tools/definitions/lookup-gene.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/predict-variant.tool.d.ts +58 -0
- package/dist/mcp-server/tools/definitions/predict-variant.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/predict-variant.tool.js +246 -0
- package/dist/mcp-server/tools/definitions/predict-variant.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/query-region.tool.d.ts +48 -0
- package/dist/mcp-server/tools/definitions/query-region.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/query-region.tool.js +162 -0
- package/dist/mcp-server/tools/definitions/query-region.tool.js.map +1 -0
- package/dist/services/ensembl/ensembl-service.d.ts +32 -0
- package/dist/services/ensembl/ensembl-service.d.ts.map +1 -0
- package/dist/services/ensembl/ensembl-service.js +366 -0
- package/dist/services/ensembl/ensembl-service.js.map +1 -0
- package/dist/services/ensembl/types.d.ts +289 -0
- package/dist/services/ensembl/types.d.ts.map +1 -0
- package/dist/services/ensembl/types.js +6 -0
- package/dist/services/ensembl/types.js.map +1 -0
- package/package.json +106 -0
- package/server.json +113 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
# FORMAT REFERENCE — do not edit. Copy this file to
|
|
3
|
+
# `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
|
|
4
|
+
# to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
|
|
5
|
+
# with a concrete date.
|
|
6
|
+
|
|
7
|
+
# Required. One-line GitHub Release-style headline. 350 character cap.
|
|
8
|
+
# Default short and scannable. Don't pad, don't stitch unrelated changes with
|
|
9
|
+
# semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
|
|
10
|
+
# inside the value as a key separator and fails GitHub's strict parser.
|
|
11
|
+
summary: ""
|
|
12
|
+
|
|
13
|
+
# Set `true` when consumers must change code to upgrade: API removals,
|
|
14
|
+
# signature changes, config renames, behavior changes that break existing
|
|
15
|
+
# usage. Flagged as `Breaking` in the rollup.
|
|
16
|
+
breaking: false
|
|
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.
|
|
21
|
+
security: false
|
|
22
|
+
|
|
23
|
+
# Optional free-form notes for maintenance agents processing this release.
|
|
24
|
+
# Not rendered in CHANGELOG — consumed by agents running `maintenance` on
|
|
25
|
+
# downstream servers. Use for adoption instructions that don't fit the
|
|
26
|
+
# human-facing sections: new files to create, fields to populate, one-time
|
|
27
|
+
# migration steps. Omit the field entirely when there's nothing to say.
|
|
28
|
+
# agent-notes: |
|
|
29
|
+
# <instructions for downstream maintenance agents>
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# <version> — YYYY-MM-DD
|
|
33
|
+
|
|
34
|
+
<!--
|
|
35
|
+
AUTHORING GUIDE — applies to the new per-version file you create from this
|
|
36
|
+
template.
|
|
37
|
+
|
|
38
|
+
Audience: someone scanning release notes to decide what affects them. Lead
|
|
39
|
+
each bullet with the symbol or concept name in **bold** so they can skip
|
|
40
|
+
what's irrelevant and zoom in on what's not.
|
|
41
|
+
|
|
42
|
+
Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
|
|
43
|
+
name the symbol, state what changed, stop. Use a second sentence only when
|
|
44
|
+
it carries weight. If a bullet feels long, it is.
|
|
45
|
+
|
|
46
|
+
Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
|
|
47
|
+
relevant skill), ceremonial framings ("This release introduces…",
|
|
48
|
+
backwards-compat paragraphs), file-by-file test enumerations, internal
|
|
49
|
+
implementation notes. Prefer code/symbol names over English re-explanations.
|
|
50
|
+
|
|
51
|
+
Narrative intro: skip by default. Add one short sentence only when the
|
|
52
|
+
release theme genuinely needs framing the bullets can't carry.
|
|
53
|
+
|
|
54
|
+
Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
|
|
55
|
+
Fixed, Security. Include only sections with entries; delete the rest
|
|
56
|
+
(including the commented-out scaffolding below). Don't ship empty headers.
|
|
57
|
+
|
|
58
|
+
Include: every distinct fact a reader needs to adopt or audit the release —
|
|
59
|
+
new exports, signatures, lint rule IDs, env vars, breaking changes, version
|
|
60
|
+
bumps on shipped skills. Nothing more.
|
|
61
|
+
|
|
62
|
+
Links: link issues, PRs, docs, or skills where they help a reader jump to
|
|
63
|
+
context. Once per item per entry — don't re-link the same issue in summary,
|
|
64
|
+
narrative, and bullet. Skip links for inline symbol names; code spans speak
|
|
65
|
+
for themselves.
|
|
66
|
+
|
|
67
|
+
Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
|
|
68
|
+
inside its own UI, not in npm reads or local editors.
|
|
69
|
+
|
|
70
|
+
[#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
|
|
71
|
+
[#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
|
|
72
|
+
|
|
73
|
+
Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
|
|
74
|
+
Never speculate on a future number — `#42` for an upcoming PR silently
|
|
75
|
+
resolves to whatever real item already owns 42, and timeline previews pull
|
|
76
|
+
in that unrelated item's metadata.
|
|
77
|
+
|
|
78
|
+
TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
|
|
79
|
+
via `gh release create --notes-from-tag`. The tag is a derivative of this
|
|
80
|
+
changelog entry — a condensed, scannable version, not a copy. Format:
|
|
81
|
+
|
|
82
|
+
<theme — omit version number, GitHub prepends it>
|
|
83
|
+
← blank line
|
|
84
|
+
<1-2 sentence context: what this release does>
|
|
85
|
+
← blank line
|
|
86
|
+
Dependency bumps: ← section header
|
|
87
|
+
← blank line
|
|
88
|
+
- `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
|
|
89
|
+
← blank line
|
|
90
|
+
Changed: ← only sections with entries
|
|
91
|
+
← blank line
|
|
92
|
+
- `format()` output includes `query` in text mode
|
|
93
|
+
← blank line
|
|
94
|
+
Added:
|
|
95
|
+
← blank line
|
|
96
|
+
- `manifest.json` scaffolded for MCPB bundle support
|
|
97
|
+
- Install badges (Claude Desktop, Cursor, VS Code)
|
|
98
|
+
← blank line
|
|
99
|
+
<N> tests pass; `bun run devcheck` clean. ← footer
|
|
100
|
+
|
|
101
|
+
Never a flat comma-separated string. Always structured markdown with
|
|
102
|
+
sections. The tag must scan well as a rendered GitHub Release page.
|
|
103
|
+
-->
|
|
104
|
+
|
|
105
|
+
## Added
|
|
106
|
+
|
|
107
|
+
-
|
|
108
|
+
|
|
109
|
+
## Changed
|
|
110
|
+
|
|
111
|
+
-
|
|
112
|
+
|
|
113
|
+
<!-- ## Deprecated
|
|
114
|
+
|
|
115
|
+
- -->
|
|
116
|
+
|
|
117
|
+
<!-- ## Removed
|
|
118
|
+
|
|
119
|
+
- -->
|
|
120
|
+
|
|
121
|
+
## Fixed
|
|
122
|
+
|
|
123
|
+
-
|
|
124
|
+
|
|
125
|
+
<!-- ## Security
|
|
126
|
+
|
|
127
|
+
- -->
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for ensembl-mcp-server.
|
|
3
|
+
* @module config/server-config
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
declare const ServerConfigSchema: z.ZodObject<{
|
|
7
|
+
baseUrl: z.ZodDefault<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare function getServerConfig(): {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
};
|
|
12
|
+
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=server-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;iBAQtB,CAAC;AAIH,wBAAgB,eAAe;;EAK9B;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for ensembl-mcp-server.
|
|
3
|
+
* @module config/server-config
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
7
|
+
const ServerConfigSchema = z.object({
|
|
8
|
+
baseUrl: z
|
|
9
|
+
.string()
|
|
10
|
+
.default('https://rest.ensembl.org')
|
|
11
|
+
.describe('Ensembl REST API base URL. Override to point at GRCh37 legacy endpoint ' +
|
|
12
|
+
'(https://grch37.rest.ensembl.org) or a local mirror.'),
|
|
13
|
+
});
|
|
14
|
+
let _config;
|
|
15
|
+
export function getServerConfig() {
|
|
16
|
+
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
17
|
+
baseUrl: 'ENSEMBL_BASE_URL',
|
|
18
|
+
});
|
|
19
|
+
return _config;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=server-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,OAAO,CAAC,0BAA0B,CAAC;SACnC,QAAQ,CACP,yEAAyE;QACvE,sDAAsD,CACzD;CACJ,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,OAAO,EAAE,kBAAkB;KAC5B,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview ensembl-mcp-server MCP server entry point.
|
|
4
|
+
* @module index
|
|
5
|
+
*/
|
|
6
|
+
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { ensemblGeneDossierPrompt } from './mcp-server/prompts/definitions/gene-dossier.prompt.js';
|
|
8
|
+
import { ensemblGeneResource } from './mcp-server/resources/definitions/gene.resource.js';
|
|
9
|
+
import { ensemblSpeciesResource } from './mcp-server/resources/definitions/species.resource.js';
|
|
10
|
+
import { ensemblTranscriptResource } from './mcp-server/resources/definitions/transcript.resource.js';
|
|
11
|
+
import { ensemblGetHomology } from './mcp-server/tools/definitions/get-homology.tool.js';
|
|
12
|
+
import { ensemblGetSequence } from './mcp-server/tools/definitions/get-sequence.tool.js';
|
|
13
|
+
import { ensemblGetXrefs } from './mcp-server/tools/definitions/get-xrefs.tool.js';
|
|
14
|
+
import { ensemblListSpecies } from './mcp-server/tools/definitions/list-species.tool.js';
|
|
15
|
+
import { ensemblLookupGene } from './mcp-server/tools/definitions/lookup-gene.tool.js';
|
|
16
|
+
import { ensemblPredictVariant } from './mcp-server/tools/definitions/predict-variant.tool.js';
|
|
17
|
+
import { ensemblQueryRegion } from './mcp-server/tools/definitions/query-region.tool.js';
|
|
18
|
+
import { initEnsemblService } from './services/ensembl/ensembl-service.js';
|
|
19
|
+
await createApp({
|
|
20
|
+
tools: [
|
|
21
|
+
ensemblListSpecies,
|
|
22
|
+
ensemblLookupGene,
|
|
23
|
+
ensemblGetSequence,
|
|
24
|
+
ensemblQueryRegion,
|
|
25
|
+
ensemblPredictVariant,
|
|
26
|
+
ensemblGetHomology,
|
|
27
|
+
ensemblGetXrefs,
|
|
28
|
+
],
|
|
29
|
+
resources: [ensemblGeneResource, ensemblTranscriptResource, ensemblSpeciesResource],
|
|
30
|
+
prompts: [ensemblGeneDossierPrompt],
|
|
31
|
+
instructions: `Ensembl genomics server — vertebrate and model organism gene, sequence, and variant data.
|
|
32
|
+
Species names use Ensembl internal format: lowercase_underscore scientific names (homo_sapiens, mus_musculus).
|
|
33
|
+
Discovery workflow: ensembl_list_species → ensembl_lookup_gene → ensembl_get_sequence / ensembl_get_xrefs / ensembl_get_homology.
|
|
34
|
+
For a complete gene research workflow, use the ensembl_gene_dossier prompt.
|
|
35
|
+
Override the default GRCh38 endpoint by setting ENSEMBL_BASE_URL (e.g. https://grch37.rest.ensembl.org for GRCh37).`,
|
|
36
|
+
setup(core) {
|
|
37
|
+
initEnsemblService(core.config, core.storage);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yDAAyD,CAAC;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,SAAS,CAAC;IACd,KAAK,EAAE;QACL,kBAAkB;QAClB,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,qBAAqB;QACrB,kBAAkB;QAClB,eAAe;KAChB;IACD,SAAS,EAAE,CAAC,mBAAmB,EAAE,yBAAyB,EAAE,sBAAsB,CAAC;IACnF,OAAO,EAAE,CAAC,wBAAwB,CAAC;IACnC,YAAY,EAAE;;;;oHAIoG;IAClH,KAAK,CAAC,IAAI;QACR,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt for assembling a complete gene profile using the Ensembl tool chain.
|
|
3
|
+
* @module mcp-server/prompts/definitions/gene-dossier
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const ensemblGeneDossierPrompt: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
|
|
7
|
+
gene_symbol: z.ZodString;
|
|
8
|
+
species: z.ZodDefault<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
//# sourceMappingURL=gene-dossier.prompt.d.ts.map
|
|
@@ -0,0 +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;;;kBA2DnC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt for assembling a complete gene profile using the Ensembl tool chain.
|
|
3
|
+
* @module mcp-server/prompts/definitions/gene-dossier
|
|
4
|
+
*/
|
|
5
|
+
import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export const ensemblGeneDossierPrompt = prompt('ensembl_gene_dossier', {
|
|
7
|
+
description: 'Structured research workflow for assembling a complete gene profile. Guides the agent through ' +
|
|
8
|
+
'the Ensembl tool chain in order: symbol → ID + location → protein sequence → key variants → ' +
|
|
9
|
+
'cross-species orthologs → xref IDs for protein and literature follow-up.',
|
|
10
|
+
args: z.object({
|
|
11
|
+
gene_symbol: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe('Gene symbol to research (e.g. BRCA2, TP53, EGFR). ' +
|
|
14
|
+
'Case-insensitive; Ensembl will resolve the canonical form.'),
|
|
15
|
+
species: z
|
|
16
|
+
.string()
|
|
17
|
+
.default('homo_sapiens')
|
|
18
|
+
.describe('Species in Ensembl internal format (e.g. homo_sapiens, mus_musculus). ' +
|
|
19
|
+
'Default is homo_sapiens. Use ensembl_list_species to discover valid values.'),
|
|
20
|
+
}),
|
|
21
|
+
generate: (args) => [
|
|
22
|
+
{
|
|
23
|
+
role: 'user',
|
|
24
|
+
content: {
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: `Assemble a complete gene profile for **${args.gene_symbol}** in **${args.species}** ` +
|
|
27
|
+
`using the Ensembl MCP tools. Follow these steps in order:\n\n` +
|
|
28
|
+
`1. **Resolve the gene** — call \`ensembl_lookup_gene\` with symbol="${args.gene_symbol}" ` +
|
|
29
|
+
`and species="${args.species}", setting expand_transcripts=true. ` +
|
|
30
|
+
`Record the stable ID (ENSG…), genomic coordinates (chr:start-end:strand:assembly), ` +
|
|
31
|
+
`biotype, and the canonical transcript ID (ENST…).\n\n` +
|
|
32
|
+
`2. **Fetch the protein sequence** — call \`ensembl_get_sequence\` with the canonical ` +
|
|
33
|
+
`transcript ID from step 1 and type="protein". Record the amino acid sequence and its length.\n\n` +
|
|
34
|
+
`3. **Find variants in the locus** — call \`ensembl_query_region\` with ` +
|
|
35
|
+
`species="${args.species}", the gene's chromosomal region (chr:start-end from step 1), ` +
|
|
36
|
+
`and feature=["variation"]. Identify any HIGH or MODERATE impact variants.\n\n` +
|
|
37
|
+
`4. **Predict variant consequences** — for up to 3 high-impact variants found in step 3, ` +
|
|
38
|
+
`call \`ensembl_predict_variant\` with the variant ID or HGVS notation. ` +
|
|
39
|
+
`Record most_severe_consequence, impact, and clinical significance.\n\n` +
|
|
40
|
+
`5. **Find cross-species orthologs** — call \`ensembl_get_homology\` with ` +
|
|
41
|
+
`symbol="${args.gene_symbol}", species="${args.species}", and type="orthologues". ` +
|
|
42
|
+
`Focus on mammalian orthologs (mouse, rat, zebrafish). Record perc_id for the top 3.\n\n` +
|
|
43
|
+
`6. **Get external database IDs** — call \`ensembl_get_xrefs\` with the stable gene ID ` +
|
|
44
|
+
`from step 1 (no dbname filter to get all). Record: ` +
|
|
45
|
+
`HGNC ID (dbname=HGNC), UniProt accession (dbname=Uniprot_gn), ` +
|
|
46
|
+
`NCBI Gene ID (dbname=EntrezGene), and OMIM ID (dbname=MIM_GENE) if present.\n\n` +
|
|
47
|
+
`7. **Synthesize the dossier** — compile your findings into a structured report with sections:\n` +
|
|
48
|
+
` - Gene overview (ID, location, biotype, description)\n` +
|
|
49
|
+
` - Protein sequence summary (length, first 50 aa, key domains if known)\n` +
|
|
50
|
+
` - Variant landscape (count, highest-impact findings, clinical significance)\n` +
|
|
51
|
+
` - Conservation across species (ortholog table with perc_id)\n` +
|
|
52
|
+
` - External IDs for follow-up (UniProt → pubchem for structure, ` +
|
|
53
|
+
`HGNC/EntrezGene → pubmed for literature, OMIM for disease associations)\n\n` +
|
|
54
|
+
`Use the stable IDs and coordinates from each step as inputs to the next — ` +
|
|
55
|
+
`the Ensembl tool chain is designed to chain this way.`,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=gene-dossier.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gene-dossier.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/gene-dossier.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,EAAE;IACrE,WAAW,EACT,gGAAgG;QAChG,8FAA8F;QAC9F,0EAA0E;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,CACP,oDAAoD;YAClD,4DAA4D,CAC/D;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,OAAO,CAAC,cAAc,CAAC;aACvB,QAAQ,CACP,wEAAwE;YACtE,6EAA6E,CAChF;KACJ,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EACF,0CAA0C,IAAI,CAAC,WAAW,WAAW,IAAI,CAAC,OAAO,KAAK;oBACtF,+DAA+D;oBAC/D,uEAAuE,IAAI,CAAC,WAAW,IAAI;oBAC3F,gBAAgB,IAAI,CAAC,OAAO,sCAAsC;oBAClE,qFAAqF;oBACrF,uDAAuD;oBACvD,uFAAuF;oBACvF,kGAAkG;oBAClG,yEAAyE;oBACzE,YAAY,IAAI,CAAC,OAAO,gEAAgE;oBACxF,+EAA+E;oBAC/E,0FAA0F;oBAC1F,yEAAyE;oBACzE,wEAAwE;oBACxE,2EAA2E;oBAC3E,WAAW,IAAI,CAAC,WAAW,eAAe,IAAI,CAAC,OAAO,6BAA6B;oBACnF,yFAAyF;oBACzF,wFAAwF;oBACxF,qDAAqD;oBACrD,gEAAgE;oBAChE,iFAAiF;oBACjF,iGAAiG;oBACjG,2DAA2D;oBAC3D,6EAA6E;oBAC7E,kFAAkF;oBAClF,kEAAkE;oBAClE,oEAAoE;oBACpE,6EAA6E;oBAC7E,4EAA4E;oBAC5E,uDAAuD;aAC1D;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing Ensembl gene records by stable ID.
|
|
3
|
+
* @module mcp-server/resources/definitions/gene
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const ensemblGeneResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, undefined, readonly [{
|
|
10
|
+
readonly reason: "not_found";
|
|
11
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
12
|
+
readonly when: "The gene stable ID was not found in Ensembl.";
|
|
13
|
+
readonly recovery: string;
|
|
14
|
+
}]>;
|
|
15
|
+
//# sourceMappingURL=gene.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gene.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gene.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,mBAAmB;;;;;;;GA2D9B,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing Ensembl gene records by stable ID.
|
|
3
|
+
* @module mcp-server/resources/definitions/gene
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getEnsemblService } from '../../../services/ensembl/ensembl-service.js';
|
|
8
|
+
export const ensemblGeneResource = resource('ensembl://gene/{id}', {
|
|
9
|
+
name: 'Ensembl Gene',
|
|
10
|
+
description: 'Gene record by Ensembl stable ID (ENSG…). Returns location, biotype, description, and transcript list. ' +
|
|
11
|
+
'Stable, injectable context for multi-step workflows. ' +
|
|
12
|
+
'Use ensembl_lookup_gene to resolve a gene symbol to the stable ID first.',
|
|
13
|
+
mimeType: 'application/json',
|
|
14
|
+
params: z.object({
|
|
15
|
+
id: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('Ensembl gene stable ID (ENSG…). ' +
|
|
18
|
+
'Version suffix is optional — omitting it resolves to the current version. ' +
|
|
19
|
+
'Example: ENSG00000139618 or ENSG00000139618.7'),
|
|
20
|
+
}),
|
|
21
|
+
errors: [
|
|
22
|
+
{
|
|
23
|
+
reason: 'not_found',
|
|
24
|
+
code: JsonRpcErrorCode.NotFound,
|
|
25
|
+
when: 'The gene stable ID was not found in Ensembl.',
|
|
26
|
+
recovery: 'Verify the ID format (ENSG followed by 11 digits, optional .version suffix). ' +
|
|
27
|
+
'Use ensembl_lookup_gene to resolve a symbol to a current stable ID.',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
async handler(params, ctx) {
|
|
31
|
+
ctx.log.debug('Fetching gene resource', { id: params.id });
|
|
32
|
+
const service = getEnsemblService();
|
|
33
|
+
const gene = await service.lookupGeneById(params.id, true, ctx).catch((err) => {
|
|
34
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
35
|
+
if (/not found/i.test(msg)) {
|
|
36
|
+
throw ctx.fail('not_found', `Gene ${params.id} not found in Ensembl.`);
|
|
37
|
+
}
|
|
38
|
+
throw err;
|
|
39
|
+
});
|
|
40
|
+
return gene;
|
|
41
|
+
},
|
|
42
|
+
list: async () => ({
|
|
43
|
+
resources: [
|
|
44
|
+
{
|
|
45
|
+
uri: 'ensembl://gene/ENSG00000139618',
|
|
46
|
+
name: 'BRCA2 (homo_sapiens)',
|
|
47
|
+
description: 'Example: BRCA2 breast cancer susceptibility gene',
|
|
48
|
+
mimeType: 'application/json',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
uri: 'ensembl://gene/ENSG00000141510',
|
|
52
|
+
name: 'TP53 (homo_sapiens)',
|
|
53
|
+
description: 'Example: Tumor protein p53',
|
|
54
|
+
mimeType: 'application/json',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=gene.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gene.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gene.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,qBAAqB,EAAE;IACjE,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,yGAAyG;QACzG,uDAAuD;QACvD,0EAA0E;IAC5E,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,QAAQ,CACP,kCAAkC;YAChC,4EAA4E;YAC5E,+CAA+C,CAClD;KACJ,CAAC;IAEF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,8CAA8C;YACpD,QAAQ,EACN,+EAA+E;gBAC/E,qEAAqE;SACxE;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;QAEpC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACrF,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,MAAM,CAAC,EAAE,wBAAwB,CAAC,CAAC;YACzE,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,gCAAgC;gBACrC,IAAI,EAAE,sBAAsB;gBAC5B,WAAW,EAAE,kDAAkD;gBAC/D,QAAQ,EAAE,kBAAkB;aAC7B;YACD;gBACE,GAAG,EAAE,gCAAgC;gBACrC,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4BAA4B;gBACzC,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing the Ensembl species catalog.
|
|
3
|
+
* @module mcp-server/resources/definitions/species
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const ensemblSpeciesResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
7
|
+
division: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
EnsemblVertebrates: "EnsemblVertebrates";
|
|
9
|
+
EnsemblPlants: "EnsemblPlants";
|
|
10
|
+
EnsemblFungi: "EnsemblFungi";
|
|
11
|
+
EnsemblMetazoa: "EnsemblMetazoa";
|
|
12
|
+
EnsemblProtists: "EnsemblProtists";
|
|
13
|
+
}>>;
|
|
14
|
+
}, z.core.$strip>, undefined, undefined>;
|
|
15
|
+
//# sourceMappingURL=species.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"species.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAWrD,eAAO,MAAM,sBAAsB;;;;;;;;wCAwCjC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing the Ensembl species catalog.
|
|
3
|
+
* @module mcp-server/resources/definitions/species
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getEnsemblService } from '../../../services/ensembl/ensembl-service.js';
|
|
7
|
+
const DIVISION_VALUES = [
|
|
8
|
+
'EnsemblVertebrates',
|
|
9
|
+
'EnsemblPlants',
|
|
10
|
+
'EnsemblFungi',
|
|
11
|
+
'EnsemblMetazoa',
|
|
12
|
+
'EnsemblProtists',
|
|
13
|
+
];
|
|
14
|
+
export const ensemblSpeciesResource = resource('ensembl://species', {
|
|
15
|
+
name: 'Ensembl Species',
|
|
16
|
+
description: 'Complete catalog of Ensembl-supported species with internal name, display name, assembly, ' +
|
|
17
|
+
'taxon ID, and division. Addressable reference for tool bootstrapping. ' +
|
|
18
|
+
'Contains ~350 vertebrate species plus additional non-vertebrate divisions. ' +
|
|
19
|
+
'Use this as stable, injectable context when working with unfamiliar species names.',
|
|
20
|
+
mimeType: 'application/json',
|
|
21
|
+
params: z.object({
|
|
22
|
+
division: z
|
|
23
|
+
.enum(DIVISION_VALUES)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Filter to a specific Ensembl division. ' + 'Omit to return species from all divisions.'),
|
|
26
|
+
}),
|
|
27
|
+
async handler(params, ctx) {
|
|
28
|
+
ctx.log.debug('Fetching species resource', { division: params.division });
|
|
29
|
+
const service = getEnsemblService();
|
|
30
|
+
const allSpecies = await service.listSpecies(params.division, ctx);
|
|
31
|
+
allSpecies.sort((a, b) => a.name.localeCompare(b.name));
|
|
32
|
+
return {
|
|
33
|
+
species: allSpecies,
|
|
34
|
+
totalCount: allSpecies.length,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
list: async () => ({
|
|
38
|
+
resources: [
|
|
39
|
+
{
|
|
40
|
+
uri: 'ensembl://species',
|
|
41
|
+
name: 'All Ensembl Species',
|
|
42
|
+
description: 'Complete catalog of Ensembl-supported species',
|
|
43
|
+
mimeType: 'application/json',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=species.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"species.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,eAAe,GAAG;IACtB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,iBAAiB;CACT,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,mBAAmB,EAAE;IAClE,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,4FAA4F;QAC5F,wEAAwE;QACxE,6EAA6E;QAC7E,oFAAoF;IACtF,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,IAAI,CAAC,eAAe,CAAC;aACrB,QAAQ,EAAE;aACV,QAAQ,CACP,yCAAyC,GAAG,4CAA4C,CACzF;KACJ,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;QAEpC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACnE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAExD,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,UAAU,EAAE,UAAU,CAAC,MAAM;SAC9B,CAAC;IACJ,CAAC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,mBAAmB;gBACxB,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing Ensembl transcript records by stable ID.
|
|
3
|
+
* @module mcp-server/resources/definitions/transcript
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const ensemblTranscriptResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, undefined, readonly [{
|
|
10
|
+
readonly reason: "not_found";
|
|
11
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
12
|
+
readonly when: "The transcript stable ID was not found in Ensembl.";
|
|
13
|
+
readonly recovery: string;
|
|
14
|
+
}]>;
|
|
15
|
+
//# sourceMappingURL=transcript.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/transcript.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,yBAAyB;;;;;;;GAqDpC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource exposing Ensembl transcript records by stable ID.
|
|
3
|
+
* @module mcp-server/resources/definitions/transcript
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getEnsemblService } from '../../../services/ensembl/ensembl-service.js';
|
|
8
|
+
export const ensemblTranscriptResource = resource('ensembl://transcript/{id}', {
|
|
9
|
+
name: 'Ensembl Transcript',
|
|
10
|
+
description: 'Transcript record by Ensembl stable ID (ENST…). Returns parent gene, location, biotype, ' +
|
|
11
|
+
'canonical flag, and length. Use ensembl_lookup_gene with expand_transcripts=true to discover ' +
|
|
12
|
+
'transcript IDs for a given gene, then fetch this resource for stable, injectable context.',
|
|
13
|
+
mimeType: 'application/json',
|
|
14
|
+
params: z.object({
|
|
15
|
+
id: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('Ensembl transcript stable ID (ENST…). ' +
|
|
18
|
+
'Version suffix is optional — omitting it resolves to the current version. ' +
|
|
19
|
+
'Example: ENST00000380152 or ENST00000380152.8'),
|
|
20
|
+
}),
|
|
21
|
+
errors: [
|
|
22
|
+
{
|
|
23
|
+
reason: 'not_found',
|
|
24
|
+
code: JsonRpcErrorCode.NotFound,
|
|
25
|
+
when: 'The transcript stable ID was not found in Ensembl.',
|
|
26
|
+
recovery: 'Verify the ID format (ENST followed by 11 digits, optional .version suffix). ' +
|
|
27
|
+
'Use ensembl_lookup_gene with expand_transcripts=true to get transcript IDs.',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
async handler(params, ctx) {
|
|
31
|
+
ctx.log.debug('Fetching transcript resource', { id: params.id });
|
|
32
|
+
const service = getEnsemblService();
|
|
33
|
+
const transcript = await service.lookupTranscript(params.id, ctx).catch((err) => {
|
|
34
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
35
|
+
if (/not found/i.test(msg)) {
|
|
36
|
+
throw ctx.fail('not_found', `Transcript ${params.id} not found in Ensembl.`);
|
|
37
|
+
}
|
|
38
|
+
throw err;
|
|
39
|
+
});
|
|
40
|
+
return transcript;
|
|
41
|
+
},
|
|
42
|
+
list: async () => ({
|
|
43
|
+
resources: [
|
|
44
|
+
{
|
|
45
|
+
uri: 'ensembl://transcript/ENST00000380152',
|
|
46
|
+
name: 'BRCA2-201 canonical transcript (homo_sapiens)',
|
|
47
|
+
description: 'Example: canonical BRCA2 transcript',
|
|
48
|
+
mimeType: 'application/json',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=transcript.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/transcript.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC,2BAA2B,EAAE;IAC7E,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,0FAA0F;QAC1F,+FAA+F;QAC/F,2FAA2F;IAC7F,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,QAAQ,CACP,wCAAwC;YACtC,4EAA4E;YAC5E,+CAA+C,CAClD;KACJ,CAAC;IAEF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,oDAAoD;YAC1D,QAAQ,EACN,+EAA+E;gBAC/E,6EAA6E;SAChF;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;QAEpC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACvF,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,MAAM,CAAC,EAAE,wBAAwB,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,sCAAsC;gBAC3C,IAAI,EAAE,+CAA+C;gBACrD,WAAW,EAAE,qCAAqC;gBAClD,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool to find orthologs and paralogs of a gene across species.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-homology
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const ensemblGetHomology: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
9
|
+
id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
species: z.ZodDefault<z.ZodString>;
|
|
11
|
+
target_species: z.ZodOptional<z.ZodString>;
|
|
12
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
orthologues: "orthologues";
|
|
14
|
+
paralogues: "paralogues";
|
|
15
|
+
all: "all";
|
|
16
|
+
}>>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
homologs: z.ZodArray<z.ZodObject<{
|
|
19
|
+
targetId: z.ZodString;
|
|
20
|
+
targetSpecies: z.ZodOptional<z.ZodString>;
|
|
21
|
+
type: z.ZodOptional<z.ZodString>;
|
|
22
|
+
percId: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
percPos: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
taxonomyLevel: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
totalCount: z.ZodNumber;
|
|
27
|
+
queryId: z.ZodString;
|
|
28
|
+
querySpecies: z.ZodString;
|
|
29
|
+
queryType: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, readonly [{
|
|
31
|
+
readonly reason: "not_found";
|
|
32
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
33
|
+
readonly when: "The gene symbol or stable ID was not found in Ensembl.";
|
|
34
|
+
readonly recovery: string;
|
|
35
|
+
}, {
|
|
36
|
+
readonly reason: "no_input";
|
|
37
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
38
|
+
readonly when: "Neither symbol nor id was provided.";
|
|
39
|
+
readonly recovery: "Provide either symbol (with species) or a stable Ensembl gene ID.";
|
|
40
|
+
}], {
|
|
41
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=get-homology.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-homology.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-homology.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0CjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyK7B,CAAC"}
|