@cyanheads/interpro-mcp-server 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/AGENTS.md +38 -13
  2. package/CLAUDE.md +38 -13
  3. package/Dockerfile +9 -1
  4. package/README.md +82 -123
  5. package/changelog/0.2.x/0.2.0.md +31 -0
  6. package/dist/config/server-config.d.ts +13 -0
  7. package/dist/config/server-config.d.ts.map +1 -0
  8. package/dist/config/server-config.js +19 -0
  9. package/dist/config/server-config.js.map +1 -0
  10. package/dist/index.js +11 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/interpro-find-proteins-by-domain.tool.d.ts +45 -0
  13. package/dist/mcp-server/tools/definitions/interpro-find-proteins-by-domain.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/interpro-find-proteins-by-domain.tool.js +37 -14
  15. package/dist/mcp-server/tools/definitions/interpro-find-proteins-by-domain.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/interpro-get-protein-domains.tool.d.ts +1 -0
  17. package/dist/mcp-server/tools/definitions/interpro-get-protein-domains.tool.d.ts.map +1 -1
  18. package/dist/mcp-server/tools/definitions/interpro-get-protein-domains.tool.js +1 -1
  19. package/dist/mcp-server/tools/definitions/interpro-get-protein-domains.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/definitions/interpro-get-scan-result.tool.d.ts +133 -0
  21. package/dist/mcp-server/tools/definitions/interpro-get-scan-result.tool.d.ts.map +1 -0
  22. package/dist/mcp-server/tools/definitions/interpro-get-scan-result.tool.js +128 -0
  23. package/dist/mcp-server/tools/definitions/interpro-get-scan-result.tool.js.map +1 -0
  24. package/dist/mcp-server/tools/definitions/interpro-get-structure-domains.tool.d.ts +171 -0
  25. package/dist/mcp-server/tools/definitions/interpro-get-structure-domains.tool.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/definitions/interpro-get-structure-domains.tool.js +290 -0
  27. package/dist/mcp-server/tools/definitions/interpro-get-structure-domains.tool.js.map +1 -0
  28. package/dist/mcp-server/tools/definitions/interpro-list-reference.tool.js +1 -1
  29. package/dist/mcp-server/tools/definitions/interpro-list-reference.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/interpro-scan-sequence.tool.d.ts +168 -0
  31. package/dist/mcp-server/tools/definitions/interpro-scan-sequence.tool.d.ts.map +1 -0
  32. package/dist/mcp-server/tools/definitions/interpro-scan-sequence.tool.js +187 -0
  33. package/dist/mcp-server/tools/definitions/interpro-scan-sequence.tool.js.map +1 -0
  34. package/dist/services/interpro/http-adapter.d.ts +11 -2
  35. package/dist/services/interpro/http-adapter.d.ts.map +1 -1
  36. package/dist/services/interpro/http-adapter.js +67 -9
  37. package/dist/services/interpro/http-adapter.js.map +1 -1
  38. package/dist/services/interpro/interpro-service.d.ts +1 -1
  39. package/dist/services/interpro/interpro-service.d.ts.map +1 -1
  40. package/dist/services/interpro/interpro-service.js +6 -24
  41. package/dist/services/interpro/interpro-service.js.map +1 -1
  42. package/dist/services/interpro/reference.d.ts.map +1 -1
  43. package/dist/services/interpro/reference.js +23 -2
  44. package/dist/services/interpro/reference.js.map +1 -1
  45. package/dist/services/interpro/schemas.d.ts +1 -0
  46. package/dist/services/interpro/schemas.d.ts.map +1 -1
  47. package/dist/services/interpro/schemas.js +5 -0
  48. package/dist/services/interpro/schemas.js.map +1 -1
  49. package/dist/services/interpro/structure-schemas.d.ts +116 -0
  50. package/dist/services/interpro/structure-schemas.d.ts.map +1 -0
  51. package/dist/services/interpro/structure-schemas.js +74 -0
  52. package/dist/services/interpro/structure-schemas.js.map +1 -0
  53. package/dist/services/sequence-scan/scan-output.d.ts +94 -0
  54. package/dist/services/sequence-scan/scan-output.d.ts.map +1 -0
  55. package/dist/services/sequence-scan/scan-output.js +174 -0
  56. package/dist/services/sequence-scan/scan-output.js.map +1 -0
  57. package/dist/services/sequence-scan/scan-schemas.d.ts +112 -0
  58. package/dist/services/sequence-scan/scan-schemas.d.ts.map +1 -0
  59. package/dist/services/sequence-scan/scan-schemas.js +97 -0
  60. package/dist/services/sequence-scan/scan-schemas.js.map +1 -0
  61. package/dist/services/sequence-scan/sequence-scan-service.d.ts +119 -0
  62. package/dist/services/sequence-scan/sequence-scan-service.d.ts.map +1 -0
  63. package/dist/services/sequence-scan/sequence-scan-service.js +453 -0
  64. package/dist/services/sequence-scan/sequence-scan-service.js.map +1 -0
  65. package/dist/services/sequence-scan/sequence.d.ts +32 -0
  66. package/dist/services/sequence-scan/sequence.d.ts.map +1 -0
  67. package/dist/services/sequence-scan/sequence.js +63 -0
  68. package/dist/services/sequence-scan/sequence.js.map +1 -0
  69. package/package.json +10 -7
  70. package/server.json +18 -4
  71. package/skills/interpro-guide/SKILL.md +72 -0
@@ -0,0 +1,168 @@
1
+ /**
2
+ * @fileoverview Domain matches for a raw protein sequence: precalculated lookup, else InterProScan.
3
+ * @module mcp-server/tools/definitions/interpro-scan-sequence.tool
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const interproScanSequence: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ sequence: z.ZodString;
9
+ waitSeconds: z.ZodDefault<z.ZodNumber>;
10
+ cursor: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ source: z.ZodEnum<{
13
+ interproscan: "interproscan";
14
+ precalculated: "precalculated";
15
+ }>;
16
+ status: z.ZodEnum<{
17
+ finished: "finished";
18
+ queued: "queued";
19
+ running: "running";
20
+ submitted: "submitted";
21
+ }>;
22
+ jobId: z.ZodOptional<z.ZodString>;
23
+ md5: z.ZodOptional<z.ZodString>;
24
+ length: z.ZodOptional<z.ZodNumber>;
25
+ interproVersion: z.ZodOptional<z.ZodString>;
26
+ interproscanVersion: z.ZodOptional<z.ZodString>;
27
+ matches: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ signature: z.ZodObject<{
29
+ accession: z.ZodString;
30
+ signatureLibraryRelease: z.ZodObject<{
31
+ library: z.ZodString;
32
+ version: z.ZodString;
33
+ }, z.core.$catchall<z.ZodJSONSchema>>;
34
+ entry: z.ZodOptional<z.ZodNullable<z.ZodObject<{
35
+ accession: z.ZodString;
36
+ }, z.core.$catchall<z.ZodJSONSchema>>>>;
37
+ }, z.core.$catchall<z.ZodJSONSchema>>;
38
+ 'model-ac': z.ZodNullable<z.ZodString>;
39
+ source: z.ZodString;
40
+ locations: z.ZodArray<z.ZodObject<{
41
+ start: z.ZodNumber;
42
+ end: z.ZodNumber;
43
+ 'location-fragments': z.ZodArray<z.ZodObject<{
44
+ start: z.ZodNumber;
45
+ end: z.ZodNumber;
46
+ 'dc-status': z.ZodString;
47
+ }, z.core.$catchall<z.ZodJSONSchema>>>;
48
+ }, z.core.$catchall<z.ZodJSONSchema>>>;
49
+ }, z.core.$catchall<z.ZodJSONSchema>>>>;
50
+ coverage: z.ZodOptional<z.ZodObject<{
51
+ totalMatches: z.ZodNumber;
52
+ offset: z.ZodNumber;
53
+ returnedMatches: z.ZodNumber;
54
+ hasMore: z.ZodBoolean;
55
+ nextCursor: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ sourceUrl: z.ZodString;
58
+ }, z.core.$strip>, readonly [{
59
+ readonly reason: "empty_sequence";
60
+ readonly code: JsonRpcErrorCode.ValidationError;
61
+ readonly when: "The sequence holds no residue letters.";
62
+ readonly recovery: "Pass the protein residues as letters, optionally after one FASTA header line.";
63
+ }, {
64
+ readonly reason: "invalid_residue";
65
+ readonly code: JsonRpcErrorCode.ValidationError;
66
+ readonly when: "The sequence holds a character other than a residue letter or whitespace.";
67
+ readonly recovery: "Remove digits, gap characters, and stop symbols, then repeat with residue letters only.";
68
+ }, {
69
+ readonly reason: "multiple_sequences";
70
+ readonly code: JsonRpcErrorCode.ValidationError;
71
+ readonly when: "The input holds more than one FASTA record.";
72
+ readonly recovery: "Scan one sequence per call, repeating interpro_scan_sequence for each record.";
73
+ }, {
74
+ readonly reason: "invalid_cursor";
75
+ readonly code: JsonRpcErrorCode.ValidationError;
76
+ readonly when: "The cursor is malformed, belongs to another sequence or result, or the result changed.";
77
+ readonly recovery: "Repeat interpro_scan_sequence with the same sequence and no cursor.";
78
+ readonly thrownBy: "service";
79
+ }, {
80
+ readonly reason: "scan_not_configured";
81
+ readonly code: JsonRpcErrorCode.ConfigurationError;
82
+ readonly when: "The sequence has no precalculated matches and this server cannot submit InterProScan jobs.";
83
+ readonly recovery: "The server operator must configure InterProScan submission; sequences already in UniParc still return precalculated matches.";
84
+ readonly thrownBy: "service";
85
+ }, {
86
+ readonly reason: "rate_limited";
87
+ readonly code: JsonRpcErrorCode.RateLimited;
88
+ readonly when: "The server already holds its maximum of in-flight InterProScan jobs; nothing was submitted.";
89
+ readonly retryable: true;
90
+ readonly recovery: "Wait retryAfter seconds, then repeat the same interpro_scan_sequence call.";
91
+ readonly thrownBy: "service";
92
+ }, {
93
+ readonly reason: "scan_rejected";
94
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
95
+ readonly when: "The Job Dispatcher rejected the submission with HTTP 400.";
96
+ readonly retryable: false;
97
+ readonly recovery: "Check that the input is one protein sequence; if the message names the contact address, the server operator must correct it.";
98
+ readonly thrownBy: "service";
99
+ }, {
100
+ readonly reason: "scan_failed";
101
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
102
+ readonly when: "The InterProScan job ended with status ERROR or FAILURE.";
103
+ readonly retryable: false;
104
+ readonly recovery: "Repeat interpro_scan_sequence with the same sequence to start a new job.";
105
+ readonly thrownBy: "service";
106
+ }, {
107
+ readonly reason: "scan_not_found";
108
+ readonly code: JsonRpcErrorCode.NotFound;
109
+ readonly when: "The Job Dispatcher no longer holds the job this sequence was waiting on.";
110
+ readonly retryable: false;
111
+ readonly recovery: "Repeat interpro_scan_sequence with the same sequence to start a new job.";
112
+ readonly thrownBy: "service";
113
+ }, {
114
+ readonly reason: "retry_deadline_exceeded";
115
+ readonly code: JsonRpcErrorCode.Timeout;
116
+ readonly when: "Lookup, submission, polling, and result reading exhausted the fifty-second call budget.";
117
+ readonly retryable: true;
118
+ readonly recovery: "Repeat the same call; a job already started is reused, or read it with interpro_get_scan_result using the jobId in the message.";
119
+ readonly thrownBy: "service";
120
+ }, {
121
+ readonly reason: "upstream_shape_invalid";
122
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
123
+ readonly when: "The Matches API or Job Dispatcher returned a response this server cannot read.";
124
+ readonly retryable: false;
125
+ readonly recovery: "Retry the same call later; the upstream response format may have changed.";
126
+ readonly thrownBy: "service";
127
+ }, {
128
+ readonly reason: "upstream_response_too_large";
129
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
130
+ readonly when: "An upstream response exceeds 4 MiB.";
131
+ readonly retryable: false;
132
+ readonly recovery: "Scan a shorter sequence, or split a multi-domain protein into regions and scan each.";
133
+ readonly thrownBy: "service";
134
+ }, {
135
+ readonly reason: "upstream_rejected";
136
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
137
+ readonly when: "An upstream service returned an unhandled redirect or client rejection.";
138
+ readonly retryable: false;
139
+ readonly recovery: "Retry the same call later; the upstream service may be under maintenance.";
140
+ readonly thrownBy: "service";
141
+ }, {
142
+ readonly reason: "upstream_unavailable";
143
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
144
+ readonly when: "An upstream service had a network or server failure.";
145
+ readonly retryable: true;
146
+ readonly recovery: "Retry the same call later; a job already started is reused rather than resubmitted.";
147
+ readonly thrownBy: "service";
148
+ }, {
149
+ readonly reason: "upstream_timeout";
150
+ readonly code: JsonRpcErrorCode.Timeout;
151
+ readonly when: "An upstream request returned HTTP 408/504 or exceeded its attempt deadline.";
152
+ readonly retryable: true;
153
+ readonly recovery: "Retry the same call after waiting; a job already started is reused.";
154
+ readonly thrownBy: "service";
155
+ }, {
156
+ readonly reason: "upstream_rate_limited";
157
+ readonly code: JsonRpcErrorCode.RateLimited;
158
+ readonly when: "An upstream service returned HTTP 429.";
159
+ readonly retryable: true;
160
+ readonly recovery: "Wait for retryAfter when supplied, then repeat the same call.";
161
+ readonly thrownBy: "service";
162
+ }], {
163
+ notice: z.ZodOptional<z.ZodString>;
164
+ totalCount: z.ZodOptional<z.ZodNumber>;
165
+ truncated: z.ZodOptional<z.ZodBoolean>;
166
+ shown: z.ZodOptional<z.ZodNumber>;
167
+ }>;
168
+ //# sourceMappingURL=interpro-scan-sequence.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpro-scan-sequence.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/interpro-scan-sequence.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAmBjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyM/B,CAAC"}
@@ -0,0 +1,187 @@
1
+ /**
2
+ * @fileoverview Domain matches for a raw protein sequence: precalculated lookup, else InterProScan.
3
+ * @module mcp-server/tools/definitions/interpro-scan-sequence.tool
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ import { formatInterpro } from '../../../services/interpro/format.js';
8
+ import { optionalString } from '../../../services/interpro/schemas.js';
9
+ import { buildScanOutput, decodeScanCursor, ScanEnrichment, ScanOutputSchema, } from '../../../services/sequence-scan/scan-output.js';
10
+ import { codePointLabel, MAX_SEQUENCE_CHARS, parseSequence, } from '../../../services/sequence-scan/sequence.js';
11
+ import { getSequenceScanService, MAX_WAIT_SECONDS, } from '../../../services/sequence-scan/sequence-scan-service.js';
12
+ export const interproScanSequence = tool('interpro_scan_sequence', {
13
+ title: 'Scan a protein sequence',
14
+ description: 'Find InterPro domain, family, and site matches for one raw protein sequence that has no UniProt accession. Sequences already in UniParc return precalculated matches at once; any other sequence starts one InterProScan 6 job, which commonly runs about ten minutes, so the usual first result is a jobId to read with interpro_get_scan_result. Repeating a sequence whose job is still running returns the same jobId instead of starting another. Matches are InterProScan records verbatim, 1-based and inclusive, each naming its member database and release.',
15
+ annotations: {
16
+ readOnlyHint: false,
17
+ destructiveHint: false,
18
+ idempotentHint: false,
19
+ openWorldHint: true,
20
+ },
21
+ auth: ['tool:interpro_scan_sequence:write'],
22
+ input: z.object({
23
+ sequence: z
24
+ .string()
25
+ .max(MAX_SEQUENCE_CHARS)
26
+ .describe('One protein sequence as residue letters, optionally preceded by a single FASTA header line. Case, spaces, and line breaks are ignored; digits, gaps, and stop symbols (*) are rejected.'),
27
+ waitSeconds: z
28
+ .number()
29
+ .int()
30
+ .min(0)
31
+ .max(MAX_WAIT_SECONDS)
32
+ .default(30)
33
+ .describe('Seconds to wait for a newly started job to finish before returning its jobId; 0 starts the job and returns at once.'),
34
+ cursor: optionalString(z.string().trim().max(4096)).describe('Opaque coverage.nextCursor from an earlier call with this same sequence, to read the next segment of precalculated matches.'),
35
+ }),
36
+ output: ScanOutputSchema,
37
+ enrichment: ScanEnrichment,
38
+ errors: [
39
+ {
40
+ reason: 'empty_sequence',
41
+ code: JsonRpcErrorCode.ValidationError,
42
+ when: 'The sequence holds no residue letters.',
43
+ recovery: 'Pass the protein residues as letters, optionally after one FASTA header line.',
44
+ },
45
+ {
46
+ reason: 'invalid_residue',
47
+ code: JsonRpcErrorCode.ValidationError,
48
+ when: 'The sequence holds a character other than a residue letter or whitespace.',
49
+ recovery: 'Remove digits, gap characters, and stop symbols, then repeat with residue letters only.',
50
+ },
51
+ {
52
+ reason: 'multiple_sequences',
53
+ code: JsonRpcErrorCode.ValidationError,
54
+ when: 'The input holds more than one FASTA record.',
55
+ recovery: 'Scan one sequence per call, repeating interpro_scan_sequence for each record.',
56
+ },
57
+ {
58
+ reason: 'invalid_cursor',
59
+ code: JsonRpcErrorCode.ValidationError,
60
+ when: 'The cursor is malformed, belongs to another sequence or result, or the result changed.',
61
+ recovery: 'Repeat interpro_scan_sequence with the same sequence and no cursor.',
62
+ thrownBy: 'service',
63
+ },
64
+ {
65
+ reason: 'scan_not_configured',
66
+ code: JsonRpcErrorCode.ConfigurationError,
67
+ when: 'The sequence has no precalculated matches and this server cannot submit InterProScan jobs.',
68
+ recovery: 'The server operator must configure InterProScan submission; sequences already in UniParc still return precalculated matches.',
69
+ thrownBy: 'service',
70
+ },
71
+ {
72
+ reason: 'rate_limited',
73
+ code: JsonRpcErrorCode.RateLimited,
74
+ when: 'The server already holds its maximum of in-flight InterProScan jobs; nothing was submitted.',
75
+ retryable: true,
76
+ recovery: 'Wait retryAfter seconds, then repeat the same interpro_scan_sequence call.',
77
+ thrownBy: 'service',
78
+ },
79
+ {
80
+ reason: 'scan_rejected',
81
+ code: JsonRpcErrorCode.ServiceUnavailable,
82
+ when: 'The Job Dispatcher rejected the submission with HTTP 400.',
83
+ retryable: false,
84
+ recovery: 'Check that the input is one protein sequence; if the message names the contact address, the server operator must correct it.',
85
+ thrownBy: 'service',
86
+ },
87
+ {
88
+ reason: 'scan_failed',
89
+ code: JsonRpcErrorCode.ServiceUnavailable,
90
+ when: 'The InterProScan job ended with status ERROR or FAILURE.',
91
+ retryable: false,
92
+ recovery: 'Repeat interpro_scan_sequence with the same sequence to start a new job.',
93
+ thrownBy: 'service',
94
+ },
95
+ {
96
+ reason: 'scan_not_found',
97
+ code: JsonRpcErrorCode.NotFound,
98
+ when: 'The Job Dispatcher no longer holds the job this sequence was waiting on.',
99
+ retryable: false,
100
+ recovery: 'Repeat interpro_scan_sequence with the same sequence to start a new job.',
101
+ thrownBy: 'service',
102
+ },
103
+ {
104
+ reason: 'retry_deadline_exceeded',
105
+ code: JsonRpcErrorCode.Timeout,
106
+ when: 'Lookup, submission, polling, and result reading exhausted the fifty-second call budget.',
107
+ retryable: true,
108
+ recovery: 'Repeat the same call; a job already started is reused, or read it with interpro_get_scan_result using the jobId in the message.',
109
+ thrownBy: 'service',
110
+ },
111
+ {
112
+ reason: 'upstream_shape_invalid',
113
+ code: JsonRpcErrorCode.ServiceUnavailable,
114
+ when: 'The Matches API or Job Dispatcher returned a response this server cannot read.',
115
+ retryable: false,
116
+ recovery: 'Retry the same call later; the upstream response format may have changed.',
117
+ thrownBy: 'service',
118
+ },
119
+ {
120
+ reason: 'upstream_response_too_large',
121
+ code: JsonRpcErrorCode.ServiceUnavailable,
122
+ when: 'An upstream response exceeds 4 MiB.',
123
+ retryable: false,
124
+ recovery: 'Scan a shorter sequence, or split a multi-domain protein into regions and scan each.',
125
+ thrownBy: 'service',
126
+ },
127
+ {
128
+ reason: 'upstream_rejected',
129
+ code: JsonRpcErrorCode.ServiceUnavailable,
130
+ when: 'An upstream service returned an unhandled redirect or client rejection.',
131
+ retryable: false,
132
+ recovery: 'Retry the same call later; the upstream service may be under maintenance.',
133
+ thrownBy: 'service',
134
+ },
135
+ {
136
+ reason: 'upstream_unavailable',
137
+ code: JsonRpcErrorCode.ServiceUnavailable,
138
+ when: 'An upstream service had a network or server failure.',
139
+ retryable: true,
140
+ recovery: 'Retry the same call later; a job already started is reused rather than resubmitted.',
141
+ thrownBy: 'service',
142
+ },
143
+ {
144
+ reason: 'upstream_timeout',
145
+ code: JsonRpcErrorCode.Timeout,
146
+ when: 'An upstream request returned HTTP 408/504 or exceeded its attempt deadline.',
147
+ retryable: true,
148
+ recovery: 'Retry the same call after waiting; a job already started is reused.',
149
+ thrownBy: 'service',
150
+ },
151
+ {
152
+ reason: 'upstream_rate_limited',
153
+ code: JsonRpcErrorCode.RateLimited,
154
+ when: 'An upstream service returned HTTP 429.',
155
+ retryable: true,
156
+ recovery: 'Wait for retryAfter when supplied, then repeat the same call.',
157
+ thrownBy: 'service',
158
+ },
159
+ ],
160
+ async handler(input, ctx) {
161
+ const parsed = parseSequence(input.sequence);
162
+ if (!parsed.ok)
163
+ switch (parsed.reason) {
164
+ case 'empty_sequence':
165
+ throw ctx.fail('empty_sequence', 'The sequence holds no residue letters.');
166
+ case 'multiple_sequences':
167
+ throw ctx.fail('multiple_sequences', `A second FASTA record starts at character ${parsed.position}; scan one sequence per call.`);
168
+ case 'invalid_residue':
169
+ throw ctx.fail('invalid_residue', `Character ${codePointLabel(parsed.codePoint)} at position ${parsed.position} is not a protein residue letter.`);
170
+ }
171
+ const { md5, residues } = parsed;
172
+ const start = decodeScanCursor(input.cursor, { md5 });
173
+ const service = getSequenceScanService();
174
+ const outcome = await service.scan(service.begin(ctx), { md5, residues }, input.waitSeconds * 1000, start !== undefined);
175
+ return buildScanOutput(ctx.enrich, outcome, {
176
+ md5,
177
+ length: residues.length,
178
+ ...(start ? { start } : {}),
179
+ // The sequence is not echoed (titin is 34 kB), so the precalculated call is named, not printed.
180
+ continuation: (cursor) => outcome.source === 'precalculated'
181
+ ? 'interpro_scan_sequence, passing the same sequence and cursor set to coverage.nextCursor,'
182
+ : `interpro_get_scan_result ${JSON.stringify({ jobId: outcome.jobId, cursor })}`,
183
+ });
184
+ },
185
+ format: formatInterpro,
186
+ });
187
+ //# sourceMappingURL=interpro-scan-sequence.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpro-scan-sequence.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/interpro-scan-sequence.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc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CAAC,EAAE,CAAC;YAC3B,gGAAgG;YAChG,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,MAAM,KAAK,eAAe;gBAChC,CAAC,CAAC,0FAA0F;gBAC5F,CAAC,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;SACrF,CAAC,CAAC;IACL,CAAC;IAED,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC"}
@@ -1,11 +1,20 @@
1
1
  /**
2
- * @fileoverview Bounded HTTP/1.1 adapter for InterPro's malformed bodyless 204 responses.
2
+ * @fileoverview Bounded HTTP/1.1 adapter for InterPro's malformed bodyless 204 responses, also
3
+ * carrying the Matches API and Job Dispatcher requests on the same fixed origin.
3
4
  * @module services/interpro/http-adapter
4
5
  */
6
+ import { type McpError } from '@cyanheads/mcp-ts-core/errors';
5
7
  /** Maximum decoded response size, shared by native and injected transports. */
6
8
  export declare const MAX_RESPONSE_BYTES: number;
7
9
  /** Fetch-compatible injection seam; callers supply the composed request signal. */
8
10
  export type InterproFetch = (url: string, init: RequestInit) => Promise<Response>;
9
- /** Collect one response without following redirects or retaining malformed connections. */
11
+ /**
12
+ * Classify a non-OK upstream response: 5xx (except 501), 408, and 429 are retryable; any other
13
+ * client status is reported as a non-retryable service failure, not a caller error.
14
+ */
15
+ export declare function upstreamStatusError(response: Response, service: string): Promise<McpError>;
16
+ /** A transport whose whole-response backstop is `attemptMs`; callers bound attempts more tightly. */
17
+ export declare const createInterproHttpFetch: (attemptMs: number) => InterproFetch;
18
+ /** The InterPro API transport: small JSON pages, so 15 seconds bounds each whole response. */
10
19
  export declare const interproHttpFetch: InterproFetch;
11
20
  //# sourceMappingURL=http-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-adapter.d.ts","sourceRoot":"","sources":["../../../src/services/interpro/http-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAClD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElF,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,EAAE,aAkK5B,CAAC"}
1
+ {"version":3,"file":"http-adapter.d.ts","sourceRoot":"","sources":["../../../src/services/interpro/http-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,+BAA+B,CAAC;AAIvC,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAClD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAiMlF;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsBhG;AAED,qGAAqG;AACrG,eAAO,MAAM,uBAAuB,cACtB,MAAM,KAAG,aAEU,CAAC;AAElC,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,EAAE,aAA+C,CAAC"}
@@ -1,17 +1,31 @@
1
1
  /**
2
- * @fileoverview Bounded HTTP/1.1 adapter for InterPro's malformed bodyless 204 responses.
2
+ * @fileoverview Bounded HTTP/1.1 adapter for InterPro's malformed bodyless 204 responses, also
3
+ * carrying the Matches API and Job Dispatcher requests on the same fixed origin.
3
4
  * @module services/interpro/http-adapter
4
5
  */
5
6
  import { request } from 'node:https';
6
- import { serviceUnavailable, timeout } from '@cyanheads/mcp-ts-core/errors';
7
+ import { JsonRpcErrorCode, serviceUnavailable, timeout, } from '@cyanheads/mcp-ts-core/errors';
8
+ import { httpErrorFromResponse } from '@cyanheads/mcp-ts-core/utils';
7
9
  import { API_BASE } from './routing.js';
8
10
  /** Maximum decoded response size, shared by native and injected transports. */
9
11
  export const MAX_RESPONSE_BYTES = 4 * 1024 * 1024;
10
- /** Collect one response without following redirects or retaining malformed connections. */
11
- export const interproHttpFetch = (url, init) => new Promise((resolve, reject) => {
12
+ /**
13
+ * The documented path prefixes on the fixed origin: the InterPro API, the InterPro Matches API,
14
+ * and the Job Dispatcher's InterProScan 6 service. The URL parser resolves dot segments first.
15
+ */
16
+ const ALLOWED_PATH_PREFIXES = [
17
+ '/interpro/api/',
18
+ '/interpro/matches/api/',
19
+ '/Tools/services/rest/iprscan6/',
20
+ ];
21
+ /**
22
+ * Collect one response without following redirects or retaining malformed connections, failing
23
+ * as `upstream_timeout` when the whole response outlasts `attemptMs`.
24
+ */
25
+ const collect = (url, init, attemptMs) => new Promise((resolve, reject) => {
12
26
  const target = new URL(url);
13
27
  if (target.origin !== new URL(API_BASE).origin ||
14
- !target.pathname.startsWith('/interpro/api/')) {
28
+ !ALLOWED_PATH_PREFIXES.some((prefix) => target.pathname.startsWith(prefix))) {
15
29
  reject(serviceUnavailable('InterPro request left the fixed API origin.', {
16
30
  reason: 'upstream_rejected',
17
31
  retryable: false,
@@ -39,13 +53,26 @@ export const interproHttpFetch = (url, init) => new Promise((resolve, reject) =>
39
53
  const timer = setTimeout(() => fail(timeout('InterPro response exceeded its attempt deadline.', {
40
54
  reason: 'upstream_timeout',
41
55
  retryable: true,
42
- })), 15_000);
56
+ })), attemptMs);
43
57
  const connectionOptions = { ALPNProtocols: ['http/1.1'] };
58
+ const body = typeof init.body === 'string' ? init.body : undefined;
59
+ const requestHeaders = new Headers(init.headers);
60
+ const accept = requestHeaders.get('accept') ?? 'application/json';
61
+ const contentType = requestHeaders.get('content-type');
44
62
  const req = request(target, {
45
63
  ...connectionOptions,
46
- method: 'GET',
64
+ method: body === undefined ? 'GET' : 'POST',
47
65
  agent: false,
48
- headers: { Accept: 'application/json', 'Accept-Encoding': 'identity' },
66
+ headers: {
67
+ Accept: accept,
68
+ 'Accept-Encoding': 'identity',
69
+ ...(body === undefined
70
+ ? {}
71
+ : {
72
+ 'Content-Type': contentType ?? 'application/json',
73
+ 'Content-Length': String(Buffer.byteLength(body, 'utf8')),
74
+ }),
75
+ },
49
76
  });
50
77
  req.on('error', (cause) => fail(serviceUnavailable('InterPro connection failed.', { reason: 'upstream_unavailable', retryable: true }, { cause })));
51
78
  req.on('close', () => {
@@ -128,7 +155,38 @@ export const interproHttpFetch = (url, init) => new Promise((resolve, reject) =>
128
155
  signal?.addEventListener('abort', abort, { once: true });
129
156
  if (signal?.aborted)
130
157
  abort();
131
- else
158
+ else if (body === undefined)
132
159
  req.end();
160
+ else
161
+ req.end(body);
133
162
  });
163
+ /**
164
+ * Classify a non-OK upstream response: 5xx (except 501), 408, and 429 are retryable; any other
165
+ * client status is reported as a non-retryable service failure, not a caller error.
166
+ */
167
+ export async function upstreamStatusError(response, service) {
168
+ const status = response.status;
169
+ const reason = status === 408 || status === 504
170
+ ? 'upstream_timeout'
171
+ : status === 429
172
+ ? 'upstream_rate_limited'
173
+ : status >= 500
174
+ ? 'upstream_unavailable'
175
+ : 'upstream_rejected';
176
+ return await httpErrorFromResponse(response, {
177
+ service,
178
+ captureBody: false,
179
+ codeOverride: (value) => value < 500 && value !== 408 && value !== 429
180
+ ? JsonRpcErrorCode.ServiceUnavailable
181
+ : undefined,
182
+ data: {
183
+ reason,
184
+ retryable: (status >= 500 && status !== 501) || status === 408 || status === 429,
185
+ },
186
+ });
187
+ }
188
+ /** A transport whose whole-response backstop is `attemptMs`; callers bound attempts more tightly. */
189
+ export const createInterproHttpFetch = (attemptMs) => (url, init) => collect(url, init, attemptMs);
190
+ /** The InterPro API transport: small JSON pages, so 15 seconds bounds each whole response. */
191
+ export const interproHttpFetch = createInterproHttpFetch(15_000);
134
192
  //# sourceMappingURL=http-adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-adapter.js","sourceRoot":"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ACzB,CAAC,CAAC,MAAM,IAAI,GAAG;gBACb,CAAC,CAAC,sBAAsB;gBACxB,CAAC,CAAC,mBAAmB,CAAC;IAC9B,OAAO,MAAM,qBAAqB,CAAC,QAAQ,EAAE;QAC3C,OAAO;QACP,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CACtB,KAAK,GAAG,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG;YAC3C,CAAC,CAAC,gBAAgB,CAAC,kBAAkB;YACrC,CAAC,CAAC,SAAS;QACf,IAAI,EAAE;YACJ,MAAM;YACN,SAAS,EAAE,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG;SACjF;KACF,CAAC,CAAC;AACL,CAAC;AAED,qGAAqG;AACrG,MAAM,CAAC,MAAM,uBAAuB,GAClC,CAAC,SAAiB,EAAiB,EAAE,CACrC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACZ,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAElC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAkB,uBAAuB,CAAC,MAAM,CAAC,CAAC"}
@@ -15,7 +15,7 @@ export interface MissingRecord {
15
15
  readonly accession: string;
16
16
  /** A list scoped to the record: 204 is a valid empty page, so only 404 reports it missing. */
17
17
  readonly list?: boolean;
18
- readonly reason: 'entry_not_found' | 'protein_not_found' | 'clan_not_found';
18
+ readonly reason: 'entry_not_found' | 'protein_not_found' | 'clan_not_found' | 'structure_not_found';
19
19
  readonly sourceDatabase: string;
20
20
  }
21
21
  /** Domain status handling selected by the tool workflow. */
@@ -1 +1 @@
1
- {"version":3,"file":"interpro-service.d.ts","sourceRoot":"","sources":["../../../src/services/interpro/interpro-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,O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eout, validationError, } from '@cyanheads/mcp-ts-core/errors';
3
- import { createPacer, defaultIsTransient, httpErrorFromResponse, withRetry, } from '@cyanheads/mcp-ts-core/utils';
4
- import { interproHttpFetch, MAX_RESPONSE_BYTES } from './http-adapter.js';
2
+ import { McpError, notFound, serviceUnavailable, timeout, validationError, } from '@cyanheads/mcp-ts-core/errors';
3
+ import { createPacer, defaultIsTransient, withRetry } from '@cyanheads/mcp-ts-core/utils';
4
+ import { interproHttpFetch, MAX_RESPONSE_BYTES, upstreamStatusError, } from './http-adapter.js';
5
5
  import { apiUrl } from './routing.js';
6
6
  import { isAccession, JsonObjectSchema, JsonValueSchema } from './schemas.js';
7
7
  const pacer = createPacer({
@@ -28,6 +28,7 @@ const RECORD_NOUNS = {
28
28
  entry_not_found: 'entry',
29
29
  clan_not_found: 'set',
30
30
  protein_not_found: 'protein',
31
+ structure_not_found: 'structure',
31
32
  };
32
33
  /** Name a record in a caller-facing message, e.g. `entry PF00870 in pfam`. */
33
34
  const describeRecord = ({ reason, accession, sourceDatabase }) => `${RECORD_NOUNS[reason]} ${accession} in ${sourceDatabase}`;
@@ -116,27 +117,8 @@ export class InterproService {
116
117
  ...(missing ? { accession: missing.accession } : {}),
117
118
  });
118
119
  }
119
- if (!response.ok) {
120
- const status = response.status;
121
- const reason = status === 408 || status === 504
122
- ? 'upstream_timeout'
123
- : status === 429
124
- ? 'upstream_rate_limited'
125
- : status >= 500
126
- ? 'upstream_unavailable'
127
- : 'upstream_rejected';
128
- throw await httpErrorFromResponse(response, {
129
- service: 'InterPro',
130
- captureBody: false,
131
- codeOverride: (value) => value < 500 && value !== 408 && value !== 429
132
- ? JsonRpcErrorCode.ServiceUnavailable
133
- : undefined,
134
- data: {
135
- reason,
136
- retryable: (status >= 500 && status !== 501) || status === 408 || status === 429,
137
- },
138
- });
139
- }
120
+ if (!response.ok)
121
+ throw await upstreamStatusError(response, 'InterPro');
140
122
  const encoding = response.headers.get('content-encoding');
141
123
  if (encoding && encoding.toLowerCase() !== 'identity')
142
124
  throw serviceUnavailable('InterPro returned an unexpected content encoding.', {