@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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool to predict functional consequences of sequence variants using Ensembl VEP.
|
|
3
|
+
* @module mcp-server/tools/definitions/predict-variant
|
|
4
|
+
*/
|
|
5
|
+
import { tool, 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
|
+
const TranscriptConsequenceSchema = z.object({
|
|
9
|
+
transcriptId: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('Ensembl transcript ID (ENST…) affected by this variant.'),
|
|
13
|
+
geneId: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Ensembl gene ID (ENSG…) harboring the affected transcript.'),
|
|
17
|
+
geneSymbol: z.string().optional().describe('Gene symbol (e.g. BRCA2, TP53).'),
|
|
18
|
+
consequenceTerms: z
|
|
19
|
+
.array(z
|
|
20
|
+
.string()
|
|
21
|
+
.describe('A Sequence Ontology consequence term (e.g. missense_variant, stop_gained).'))
|
|
22
|
+
.describe('Sequence Ontology consequence terms for this transcript.'),
|
|
23
|
+
impact: z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Impact level: HIGH (frameshift, stop_gained), MODERATE (missense), LOW (synonymous), or MODIFIER.'),
|
|
27
|
+
biotype: z.string().optional().describe('Transcript biotype (e.g. protein_coding).'),
|
|
28
|
+
hgvsc: z.string().optional().describe('HGVS notation at the cDNA level (e.g. c.2T>A).'),
|
|
29
|
+
hgvsp: z.string().optional().describe('HGVS notation at the protein level (e.g. p.Met1Thr).'),
|
|
30
|
+
aminoAcids: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Reference/alternate amino acids separated by "/" (e.g. M/T).'),
|
|
34
|
+
sift: z
|
|
35
|
+
.object({
|
|
36
|
+
prediction: z.string().describe('SIFT prediction: deleterious or tolerated.'),
|
|
37
|
+
score: z
|
|
38
|
+
.number()
|
|
39
|
+
.describe('SIFT score (0-1). Lower scores indicate more deleterious variants.'),
|
|
40
|
+
})
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('SIFT pathogenicity prediction for missense variants. Omitted when not applicable.'),
|
|
43
|
+
polyphen: z
|
|
44
|
+
.object({
|
|
45
|
+
prediction: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe('PolyPhen prediction: probably_damaging, possibly_damaging, or benign.'),
|
|
48
|
+
score: z
|
|
49
|
+
.number()
|
|
50
|
+
.describe('PolyPhen score (0-1). Higher scores indicate more damaging variants.'),
|
|
51
|
+
})
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('PolyPhen pathogenicity prediction for missense variants. Omitted when not applicable.'),
|
|
54
|
+
});
|
|
55
|
+
const ColocatedVariantSchema = z.object({
|
|
56
|
+
id: z.string().optional().describe('Known variant ID (e.g. rs1234567 for dbSNP entries).'),
|
|
57
|
+
alleleString: z
|
|
58
|
+
.string()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Allele string showing reference/alternate (e.g. A/T).'),
|
|
61
|
+
clinicalSignificance: z
|
|
62
|
+
.array(z.string().describe('A clinical significance term for this colocated known variant.'))
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Clinical significance terms from ClinVar (e.g. pathogenic, benign).'),
|
|
65
|
+
pubmed: z
|
|
66
|
+
.array(z.number().describe('A PubMed ID for literature citing this variant.'))
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('PubMed IDs for literature associated with this variant.'),
|
|
69
|
+
});
|
|
70
|
+
const VepResultSchema = z.object({
|
|
71
|
+
input: z.string().optional().describe('The input variant notation as submitted to VEP.'),
|
|
72
|
+
chromosome: z.string().optional().describe('Chromosome the variant is on.'),
|
|
73
|
+
start: z.number().optional().describe('Variant start position (1-based).'),
|
|
74
|
+
end: z.number().optional().describe('Variant end position (1-based).'),
|
|
75
|
+
assemblyName: z.string().optional().describe('Genome assembly name (e.g. GRCh38).'),
|
|
76
|
+
mostSevereConsequence: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('Most severe Sequence Ontology consequence term across all transcripts ' +
|
|
80
|
+
'(e.g. stop_gained, missense_variant, synonymous_variant).'),
|
|
81
|
+
transcriptConsequences: z
|
|
82
|
+
.array(TranscriptConsequenceSchema.describe('Consequence details for one affected transcript, including impact, HGVS notation, and pathogenicity scores.'))
|
|
83
|
+
.describe('Per-transcript consequence details. High-impact variants may affect many transcripts; ' +
|
|
84
|
+
'focus on canonical transcripts (isCanonical from ensembl_lookup_gene) for primary effect.'),
|
|
85
|
+
colocatedVariants: z
|
|
86
|
+
.array(ColocatedVariantSchema.describe('A known variant at the same genomic position from public databases (dbSNP, ClinVar).'))
|
|
87
|
+
.describe('Known variants at the same position from public databases (dbSNP, ClinVar). ' +
|
|
88
|
+
'Empty when the variant is novel.'),
|
|
89
|
+
});
|
|
90
|
+
export const ensemblPredictVariant = tool('ensembl_predict_variant', {
|
|
91
|
+
title: 'Predict Variant Effect',
|
|
92
|
+
description: 'Predict the functional consequences of a sequence variant using the Ensembl Variant Effect Predictor (VEP). ' +
|
|
93
|
+
'Accepts HGVS notation (transcript-relative, e.g. ENST00000380152.8:c.2T>A, or genomic, ' +
|
|
94
|
+
'e.g. 13:g.32316462T>A) and also region+allele format (chr:start:end:strand/allele, ' +
|
|
95
|
+
'e.g. 1:65568:65568:1/T). Returns the most severe consequence term, affected transcripts and genes, ' +
|
|
96
|
+
'impact level (HIGH/MODERATE/LOW/MODIFIER), and any colocated known variants with clinical significance. ' +
|
|
97
|
+
'HGVS input: provide the full notation including transcript version for best results. ' +
|
|
98
|
+
'Region+allele input: use Ensembl chromosome naming (no chr prefix for vertebrates).',
|
|
99
|
+
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
100
|
+
input: z.object({
|
|
101
|
+
variant: z
|
|
102
|
+
.string()
|
|
103
|
+
.describe('Variant in one of two formats: ' +
|
|
104
|
+
'(1) HGVS notation — transcript-relative: ENST00000380152.8:c.2T>A; ' +
|
|
105
|
+
'genomic: 13:g.32316462T>A; ' +
|
|
106
|
+
'(2) Region+allele: chr:start:end:strand/allele — e.g. 1:65568:65568:1/T. ' +
|
|
107
|
+
'For region+allele, strand is 1 (forward) or -1 (reverse); ' +
|
|
108
|
+
'chromosome names use no "chr" prefix for vertebrates.'),
|
|
109
|
+
species: z
|
|
110
|
+
.string()
|
|
111
|
+
.default('homo_sapiens')
|
|
112
|
+
.describe('Species in Ensembl internal format. Default is homo_sapiens. ' +
|
|
113
|
+
'For non-human variants, set the appropriate species ' +
|
|
114
|
+
'(e.g. mus_musculus for mouse). Use ensembl_list_species to discover valid values.'),
|
|
115
|
+
}),
|
|
116
|
+
output: z.object({
|
|
117
|
+
results: z
|
|
118
|
+
.array(VepResultSchema.describe('VEP consequence record for one genomic position, with transcript consequences and colocated known variants.'))
|
|
119
|
+
.describe('VEP consequence records — typically one per input variant. ' +
|
|
120
|
+
'Multiple records appear when a single notation matches multiple genomic positions.'),
|
|
121
|
+
totalCount: z.number().describe('Number of VEP consequence records returned.'),
|
|
122
|
+
}),
|
|
123
|
+
enrichment: {
|
|
124
|
+
notice: z.string().optional().describe('Guidance when no results are returned.'),
|
|
125
|
+
},
|
|
126
|
+
errors: [
|
|
127
|
+
{
|
|
128
|
+
reason: 'invalid_notation',
|
|
129
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
130
|
+
when: 'The variant notation is malformed or cannot be parsed by VEP.',
|
|
131
|
+
recovery: 'Check HGVS format: transcript-relative uses ENST…:c.POSREF>ALT; ' +
|
|
132
|
+
'genomic uses CHR:g.POSREF>ALT. ' +
|
|
133
|
+
'Region+allele format is chr:start:end:strand/allele. ' +
|
|
134
|
+
'Verify the transcript version matches the current Ensembl release.',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
reason: 'not_found',
|
|
138
|
+
code: JsonRpcErrorCode.NotFound,
|
|
139
|
+
when: 'The variant location falls outside any known transcript or assembly region.',
|
|
140
|
+
recovery: 'Verify the chromosome and position are within the target assembly bounds. ' +
|
|
141
|
+
'Use ensembl_query_region to confirm the genomic context around the position.',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
async handler(input, ctx) {
|
|
145
|
+
ctx.log.info('Predicting variant effect', { variant: input.variant, species: input.species });
|
|
146
|
+
const service = getEnsemblService();
|
|
147
|
+
// Detect region+allele format: chr:start:end:strand/allele
|
|
148
|
+
const regionAllelePattern = /^([^:]+):(\d+):(\d+):(-?1)\/(.+)$/;
|
|
149
|
+
const regionMatch = input.variant.match(regionAllelePattern);
|
|
150
|
+
let results;
|
|
151
|
+
if (regionMatch) {
|
|
152
|
+
const [, chr, start, end, strand, allele] = regionMatch;
|
|
153
|
+
results = await service
|
|
154
|
+
.predictVariantRegion(chr, Number(start), Number(end), Number(strand), allele, input.species, ctx)
|
|
155
|
+
.catch((err) => {
|
|
156
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
157
|
+
if (/invalid|unrecognized|parse|malformed/i.test(msg)) {
|
|
158
|
+
throw ctx.fail('invalid_notation', `Invalid region+allele notation "${input.variant}": ${msg}`);
|
|
159
|
+
}
|
|
160
|
+
if (/not found|outside/i.test(msg)) {
|
|
161
|
+
throw ctx.fail('not_found', `Variant location not found: ${msg}`);
|
|
162
|
+
}
|
|
163
|
+
throw err;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
results = await service
|
|
168
|
+
.predictVariantHgvs(input.variant, input.species, ctx)
|
|
169
|
+
.catch((err) => {
|
|
170
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
171
|
+
if (/invalid|unrecognized|parse|malformed|hgvs/i.test(msg)) {
|
|
172
|
+
throw ctx.fail('invalid_notation', `Invalid HGVS notation "${input.variant}": ${msg}`);
|
|
173
|
+
}
|
|
174
|
+
if (/not found/i.test(msg)) {
|
|
175
|
+
throw ctx.fail('not_found', `Variant ${input.variant} not found.`);
|
|
176
|
+
}
|
|
177
|
+
throw err;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (results.length === 0) {
|
|
181
|
+
ctx.enrich.notice(`No VEP results for "${input.variant}". ` +
|
|
182
|
+
'Verify the notation format and that the position falls within an annotated region.');
|
|
183
|
+
}
|
|
184
|
+
ctx.enrich.total(results.length);
|
|
185
|
+
return { results, totalCount: results.length };
|
|
186
|
+
},
|
|
187
|
+
format: (result) => {
|
|
188
|
+
const lines = [];
|
|
189
|
+
lines.push(`## VEP Results (${result.totalCount} record${result.totalCount !== 1 ? 's' : ''})`);
|
|
190
|
+
if (result.results.length === 0) {
|
|
191
|
+
lines.push('No VEP results returned for this variant.');
|
|
192
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
193
|
+
}
|
|
194
|
+
for (const r of result.results) {
|
|
195
|
+
lines.push(`\n### Variant: ${r.input ?? 'unknown'}`);
|
|
196
|
+
if (r.chromosome && r.start != null) {
|
|
197
|
+
lines.push(`**Location:** ${r.chromosome}:${r.start}${r.end !== r.start ? `-${r.end}` : ''}${r.assemblyName ? ` [${r.assemblyName}]` : ''}`);
|
|
198
|
+
}
|
|
199
|
+
if (r.mostSevereConsequence) {
|
|
200
|
+
lines.push(`**Most severe consequence:** ${r.mostSevereConsequence}`);
|
|
201
|
+
}
|
|
202
|
+
if (r.colocatedVariants.length > 0) {
|
|
203
|
+
lines.push(`\n**Known colocated variants:**`);
|
|
204
|
+
for (const cv of r.colocatedVariants) {
|
|
205
|
+
let cvLine = `- ${cv.id ?? 'novel'}`;
|
|
206
|
+
if (cv.alleleString)
|
|
207
|
+
cvLine += ` (${cv.alleleString})`;
|
|
208
|
+
if (cv.clinicalSignificance?.length) {
|
|
209
|
+
cvLine += ` — ${cv.clinicalSignificance.join(', ')}`;
|
|
210
|
+
}
|
|
211
|
+
if (cv.pubmed?.length) {
|
|
212
|
+
cvLine += ` | PubMed: ${cv.pubmed.join(', ')}`;
|
|
213
|
+
}
|
|
214
|
+
lines.push(cvLine);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (r.transcriptConsequences.length > 0) {
|
|
218
|
+
lines.push(`\n**Transcript consequences (${r.transcriptConsequences.length}):**`);
|
|
219
|
+
for (const tc of r.transcriptConsequences) {
|
|
220
|
+
const geneLabel = tc.geneSymbol ?? tc.geneId ?? 'unknown';
|
|
221
|
+
lines.push(`\n#### ${geneLabel} — ${tc.transcriptId ?? 'unknown'}`);
|
|
222
|
+
if (tc.geneId && tc.geneSymbol)
|
|
223
|
+
lines.push(`**Gene ID:** ${tc.geneId}`);
|
|
224
|
+
lines.push(`**Impact:** ${tc.impact ?? 'UNKNOWN'} | **Consequence:** ${tc.consequenceTerms.join(', ')}`);
|
|
225
|
+
if (tc.biotype)
|
|
226
|
+
lines.push(`**Biotype:** ${tc.biotype}`);
|
|
227
|
+
if (tc.hgvsc)
|
|
228
|
+
lines.push(`**HGVSc:** ${tc.hgvsc}`);
|
|
229
|
+
if (tc.hgvsp)
|
|
230
|
+
lines.push(`**HGVSp:** ${tc.hgvsp}`);
|
|
231
|
+
if (tc.aminoAcids)
|
|
232
|
+
lines.push(`**Amino acids:** ${tc.aminoAcids}`);
|
|
233
|
+
if (tc.sift) {
|
|
234
|
+
lines.push(`**SIFT:** ${tc.sift.prediction} (score: ${tc.sift.score.toFixed(3)})`);
|
|
235
|
+
}
|
|
236
|
+
if (tc.polyphen) {
|
|
237
|
+
lines.push(`**PolyPhen:** ${tc.polyphen.prediction} (score: ${tc.polyphen.score.toFixed(3)})`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
lines.push('');
|
|
242
|
+
}
|
|
243
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
//# sourceMappingURL=predict-variant.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict-variant.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/predict-variant.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;IACzE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IAC7E,gBAAgB,EAAE,CAAC;SAChB,KAAK,CACJ,CAAC;SACE,MAAM,EAAE;SACR,QAAQ,CAAC,4EAA4E,CAAC,CAC1F;SACA,QAAQ,CAAC,0DAA0D,CAAC;IACvE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,mGAAmG,CACpG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACpF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACvF,KAAK,EAAE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AC,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;oBACnD,IAAI,EAAE,CAAC,KAAK;wBAAE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;oBACnD,IAAI,EAAE,CAAC,UAAU;wBAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;oBACnE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;wBACZ,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,UAAU,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;oBACrF,CAAC;oBACD,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;wBAChB,KAAK,CAAC,IAAI,CACR,iBAAiB,EAAE,CAAC,QAAQ,CAAC,UAAU,YAAY,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CACnF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool to find genomic features overlapping a chromosomal region.
|
|
3
|
+
* @module mcp-server/tools/definitions/query-region
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const ensemblQueryRegion: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
species: z.ZodString;
|
|
9
|
+
region: z.ZodString;
|
|
10
|
+
feature: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
gene: "gene";
|
|
12
|
+
transcript: "transcript";
|
|
13
|
+
variation: "variation";
|
|
14
|
+
regulatory: "regulatory";
|
|
15
|
+
exon: "exon";
|
|
16
|
+
}>>>;
|
|
17
|
+
biotype: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
features: z.ZodArray<z.ZodObject<{
|
|
20
|
+
id: z.ZodOptional<z.ZodString>;
|
|
21
|
+
name: z.ZodOptional<z.ZodString>;
|
|
22
|
+
featureType: z.ZodString;
|
|
23
|
+
biotype: z.ZodOptional<z.ZodString>;
|
|
24
|
+
chromosome: z.ZodString;
|
|
25
|
+
start: z.ZodNumber;
|
|
26
|
+
end: z.ZodNumber;
|
|
27
|
+
strand: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
consequenceType: z.ZodOptional<z.ZodString>;
|
|
30
|
+
clinicalSignificance: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
totalCount: z.ZodNumber;
|
|
33
|
+
region: z.ZodString;
|
|
34
|
+
species: z.ZodString;
|
|
35
|
+
}, z.core.$strip>, readonly [{
|
|
36
|
+
readonly reason: "invalid_region";
|
|
37
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
38
|
+
readonly when: "The region string could not be parsed or contains invalid coordinates.";
|
|
39
|
+
readonly recovery: string;
|
|
40
|
+
}, {
|
|
41
|
+
readonly reason: "invalid_species";
|
|
42
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
43
|
+
readonly when: "The species string was not recognized by Ensembl.";
|
|
44
|
+
readonly recovery: "Call ensembl_list_species to discover valid species names in lowercase_underscore format.";
|
|
45
|
+
}], {
|
|
46
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}>;
|
|
48
|
+
//# sourceMappingURL=query-region.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-region.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/query-region.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA8BjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6J7B,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool to find genomic features overlapping a chromosomal region.
|
|
3
|
+
* @module mcp-server/tools/definitions/query-region
|
|
4
|
+
*/
|
|
5
|
+
import { tool, 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
|
+
const FEATURE_TYPES = ['gene', 'transcript', 'variation', 'regulatory', 'exon'];
|
|
9
|
+
const FeatureSchema = z.object({
|
|
10
|
+
id: z.string().optional().describe('Ensembl stable ID for this feature (e.g. ENSG…, rs…).'),
|
|
11
|
+
name: z.string().optional().describe('External name or symbol for this feature.'),
|
|
12
|
+
featureType: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe('Feature type: gene, transcript, variation, regulatory, or exon.'),
|
|
15
|
+
biotype: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Biotype of the feature (e.g. protein_coding, lncRNA, SNV).'),
|
|
19
|
+
chromosome: z.string().describe('Chromosome or sequence region name.'),
|
|
20
|
+
start: z.number().describe('Start position on the chromosome (1-based).'),
|
|
21
|
+
end: z.number().describe('End position on the chromosome (1-based).'),
|
|
22
|
+
strand: z.number().optional().describe('Strand: 1 for forward, -1 for reverse.'),
|
|
23
|
+
description: z.string().optional().describe('Feature description when provided.'),
|
|
24
|
+
consequenceType: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Most severe consequence type for variation features.'),
|
|
28
|
+
clinicalSignificance: z
|
|
29
|
+
.array(z.string().describe('A clinical significance term for this variant.'))
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Clinical significance terms for variation features (e.g. pathogenic, benign).'),
|
|
32
|
+
});
|
|
33
|
+
export const ensemblQueryRegion = tool('ensembl_query_region', {
|
|
34
|
+
title: 'Query Genomic Region',
|
|
35
|
+
description: 'Find genomic features overlapping a chromosomal region: genes, transcripts, variants, regulatory ' +
|
|
36
|
+
'elements, or exons. Returns each feature with its stable ID, type, location, biotype, and name. ' +
|
|
37
|
+
'Useful for "what\'s in this locus?" and for seeding follow-up lookups. Region format is chr:start-end ' +
|
|
38
|
+
'(e.g. 13:32315086-32400268 for the BRCA2 locus). Chromosome names use Ensembl format — no "chr" ' +
|
|
39
|
+
'prefix for vertebrates (use 13 not chr13). The feature parameter defaults to gene only to prevent ' +
|
|
40
|
+
'overwhelming returns — requesting variation in an 85 kb region returns 44,000+ entries. Explicitly ' +
|
|
41
|
+
'include variation, regulatory, transcript, or exon only when needed.',
|
|
42
|
+
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
43
|
+
input: z.object({
|
|
44
|
+
species: z
|
|
45
|
+
.string()
|
|
46
|
+
.describe('Species in Ensembl internal format (e.g. homo_sapiens, mus_musculus). ' +
|
|
47
|
+
'Use ensembl_list_species to discover valid values.'),
|
|
48
|
+
region: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe('Genomic region in chr:start-end format (e.g. 13:32315086-32400268). ' +
|
|
51
|
+
'Chromosome names use Ensembl format — no "chr" prefix for vertebrates (13, not chr13). ' +
|
|
52
|
+
'For large regions (>100 kb), limit to gene feature type to avoid overwhelming results.'),
|
|
53
|
+
feature: z
|
|
54
|
+
.array(z
|
|
55
|
+
.enum(FEATURE_TYPES)
|
|
56
|
+
.describe('A feature type to retrieve: gene, transcript, variation, regulatory, or exon.'))
|
|
57
|
+
.default(['gene'])
|
|
58
|
+
.describe('Feature types to retrieve. Default is gene only. ' +
|
|
59
|
+
'Requesting variation in a large region can return tens of thousands of features. ' +
|
|
60
|
+
'Include variation only for targeted small regions (single gene loci or smaller).'),
|
|
61
|
+
biotype: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Optional biotype filter (e.g. protein_coding, lncRNA, SNV). ' +
|
|
65
|
+
'Applied server-side by Ensembl. Not all feature types support biotype filtering.'),
|
|
66
|
+
}),
|
|
67
|
+
output: z.object({
|
|
68
|
+
features: z
|
|
69
|
+
.array(FeatureSchema.describe('A single genomic feature overlapping the queried region.'))
|
|
70
|
+
.describe('Genomic features found in the requested region.'),
|
|
71
|
+
totalCount: z
|
|
72
|
+
.number()
|
|
73
|
+
.describe('Number of features returned. Note: very large regions may return truncated results.'),
|
|
74
|
+
region: z.string().describe('The region queried, as provided.'),
|
|
75
|
+
species: z.string().describe('The species queried.'),
|
|
76
|
+
}),
|
|
77
|
+
enrichment: {
|
|
78
|
+
notice: z.string().optional().describe('Warning or guidance about the result set.'),
|
|
79
|
+
},
|
|
80
|
+
errors: [
|
|
81
|
+
{
|
|
82
|
+
reason: 'invalid_region',
|
|
83
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
84
|
+
when: 'The region string could not be parsed or contains invalid coordinates.',
|
|
85
|
+
recovery: 'Use the format chr:start-end (e.g. 13:32315086-32400268). ' +
|
|
86
|
+
'Chromosome names use Ensembl format with no "chr" prefix for vertebrates. ' +
|
|
87
|
+
'Verify coordinates are within the chromosome bounds for the target assembly.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
reason: 'invalid_species',
|
|
91
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
92
|
+
when: 'The species string was not recognized by Ensembl.',
|
|
93
|
+
recovery: 'Call ensembl_list_species to discover valid species names in lowercase_underscore format.',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
async handler(input, ctx) {
|
|
97
|
+
ctx.log.info('Querying region', {
|
|
98
|
+
species: input.species,
|
|
99
|
+
region: input.region,
|
|
100
|
+
features: input.feature,
|
|
101
|
+
biotype: input.biotype,
|
|
102
|
+
});
|
|
103
|
+
const service = getEnsemblService();
|
|
104
|
+
const features = await service
|
|
105
|
+
.queryRegion(input.species, input.region, input.feature, input.biotype, ctx)
|
|
106
|
+
.catch((err) => {
|
|
107
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
108
|
+
if (/invalid.*region|coordinate|parse/i.test(msg) ||
|
|
109
|
+
/is not a valid start|is not a valid end|is not a valid chr/i.test(msg)) {
|
|
110
|
+
throw ctx.fail('invalid_region', `Invalid region "${input.region}": ${msg}`);
|
|
111
|
+
}
|
|
112
|
+
if (/species|invalid|unrecognized/i.test(msg)) {
|
|
113
|
+
throw ctx.fail('invalid_species', `Species "${input.species}" not recognized.`);
|
|
114
|
+
}
|
|
115
|
+
throw err;
|
|
116
|
+
});
|
|
117
|
+
if (features.length === 0) {
|
|
118
|
+
ctx.enrich.notice(`No ${input.feature.join(', ')} features found in ${input.region} for ${input.species}. ` +
|
|
119
|
+
'The region may be intergenic or use a different chromosome naming convention.');
|
|
120
|
+
}
|
|
121
|
+
else if (features.length > 1000) {
|
|
122
|
+
ctx.enrich.notice(`Large result set (${features.length} features). ` +
|
|
123
|
+
'Consider narrowing the region or filtering by biotype to reduce context usage.');
|
|
124
|
+
}
|
|
125
|
+
ctx.enrich.total(features.length);
|
|
126
|
+
return {
|
|
127
|
+
features,
|
|
128
|
+
totalCount: features.length,
|
|
129
|
+
region: input.region,
|
|
130
|
+
species: input.species,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
format: (result) => {
|
|
134
|
+
const lines = [];
|
|
135
|
+
lines.push(`## Genomic Region: ${result.species} ${result.region}`);
|
|
136
|
+
lines.push(`**Features found:** ${result.totalCount}\n`);
|
|
137
|
+
if (result.features.length === 0) {
|
|
138
|
+
lines.push('No features found in this region.');
|
|
139
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
140
|
+
}
|
|
141
|
+
for (const f of result.features) {
|
|
142
|
+
const label = f.name ?? f.id ?? f.featureType;
|
|
143
|
+
lines.push(`### ${label}`);
|
|
144
|
+
if (f.id)
|
|
145
|
+
lines.push(`**ID:** ${f.id}`);
|
|
146
|
+
lines.push(`**Type:** ${f.featureType}`);
|
|
147
|
+
if (f.biotype)
|
|
148
|
+
lines.push(`**Biotype:** ${f.biotype}`);
|
|
149
|
+
lines.push(`**Location:** ${f.chromosome}:${f.start}-${f.end}${f.strand != null ? ` strand:${f.strand} (${f.strand === -1 ? '-' : '+'})` : ''}`);
|
|
150
|
+
if (f.description)
|
|
151
|
+
lines.push(`**Description:** ${f.description}`);
|
|
152
|
+
if (f.consequenceType)
|
|
153
|
+
lines.push(`**Consequence:** ${f.consequenceType}`);
|
|
154
|
+
if (f.clinicalSignificance?.length) {
|
|
155
|
+
lines.push(`**Clinical significance:** ${f.clinicalSignificance.join(', ')}`);
|
|
156
|
+
}
|
|
157
|
+
lines.push('');
|
|
158
|
+
}
|
|
159
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=query-region.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-region.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/query-region.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,aAAa,GAA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oBAAoB,EAAE,MAAM,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Ensembl REST API service — HTTP client, rate-limit-aware retry,
|
|
3
|
+
* error normalization, and typed methods per endpoint family.
|
|
4
|
+
* @module services/ensembl/ensembl-service
|
|
5
|
+
*/
|
|
6
|
+
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
|
|
8
|
+
import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
|
|
9
|
+
import type { GeneRecord, HomologyEntry, OverlapFeature, SequenceRecord, SpeciesInfo, TranscriptRecord, VepRecord, XrefEntry } from './types.js';
|
|
10
|
+
export declare class EnsemblService {
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
constructor(_config: AppConfig, _storage: StorageService);
|
|
13
|
+
private fetchJson;
|
|
14
|
+
private fetchWithRetry;
|
|
15
|
+
lookupGene(symbol: string, species: string, expandTranscripts: boolean, ctx: Context): Promise<GeneRecord>;
|
|
16
|
+
lookupGeneById(id: string, expandTranscripts: boolean, ctx: Context): Promise<GeneRecord>;
|
|
17
|
+
lookupGenesBatch(ids: string[], expandTranscripts: boolean, ctx: Context): Promise<Map<string, GeneRecord>>;
|
|
18
|
+
lookupSymbolsBatch(symbols: string[], species: string, expandTranscripts: boolean, ctx: Context): Promise<Map<string, GeneRecord>>;
|
|
19
|
+
lookupTranscript(id: string, ctx: Context): Promise<TranscriptRecord>;
|
|
20
|
+
getSequenceById(id: string, type: string, ctx: Context): Promise<SequenceRecord>;
|
|
21
|
+
getSequenceByRegion(species: string, region: string, expand5prime: number, expand3prime: number, ctx: Context): Promise<SequenceRecord>;
|
|
22
|
+
queryRegion(species: string, region: string, features: string[], biotype: string | undefined, ctx: Context): Promise<OverlapFeature[]>;
|
|
23
|
+
predictVariantHgvs(notation: string, species: string, ctx: Context): Promise<VepRecord[]>;
|
|
24
|
+
predictVariantRegion(chr: string, start: number, end: number, strand: number, allele: string, species: string, ctx: Context): Promise<VepRecord[]>;
|
|
25
|
+
getHomologyBySymbol(symbol: string, species: string, type: string, targetSpecies: string | undefined, ctx: Context): Promise<HomologyEntry[]>;
|
|
26
|
+
getHomologyById(id: string, species: string, type: string, targetSpecies: string | undefined, ctx: Context): Promise<HomologyEntry[]>;
|
|
27
|
+
getXrefsById(id: string, dbname: string | undefined, ctx: Context): Promise<XrefEntry[]>;
|
|
28
|
+
listSpecies(division: string | undefined, ctx: Context): Promise<SpeciesInfo[]>;
|
|
29
|
+
}
|
|
30
|
+
export declare function initEnsemblService(config: AppConfig, storage: StorageService): void;
|
|
31
|
+
export declare function getEnsemblService(): EnsemblService;
|
|
32
|
+
//# sourceMappingURL=ensembl-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensembl-service.d.ts","sourceRoot":"","sources":["../../../src/services/ensembl/ensembl-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACb,cAAc,EASd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,SAAS,EACV,MAAM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