@access-mcp/shared 0.3.0 → 0.3.2

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.
@@ -8,12 +8,79 @@ export declare abstract class BaseAccessServer {
8
8
  protected server: Server;
9
9
  protected transport: StdioServerTransport;
10
10
  private _httpClient?;
11
+ private _httpServer?;
12
+ private _httpPort?;
11
13
  constructor(serverName: string, version: string, baseURL?: string);
12
14
  protected get httpClient(): AxiosInstance;
13
15
  private setupHandlers;
14
16
  protected abstract getTools(): any[];
15
17
  protected abstract getResources(): any[];
16
18
  protected abstract handleToolCall(request: any): Promise<any>;
17
- protected abstract handleResourceRead(request: any): Promise<any>;
18
- start(): Promise<void>;
19
+ /**
20
+ * Get available prompts - override in subclasses to provide prompts
21
+ */
22
+ protected getPrompts(): any[];
23
+ /**
24
+ * Handle resource read requests - override in subclasses
25
+ */
26
+ protected handleResourceRead(request: any): Promise<any>;
27
+ /**
28
+ * Handle get prompt requests - override in subclasses
29
+ */
30
+ protected handleGetPrompt(request: any): Promise<any>;
31
+ /**
32
+ * Helper method to create a JSON resource response
33
+ * @param uri The resource URI
34
+ * @param data The data to return as JSON
35
+ */
36
+ protected createJsonResource(uri: string, data: any): {
37
+ contents: {
38
+ uri: string;
39
+ mimeType: string;
40
+ text: string;
41
+ }[];
42
+ };
43
+ /**
44
+ * Helper method to create a Markdown resource response
45
+ * @param uri The resource URI
46
+ * @param markdown The markdown content
47
+ */
48
+ protected createMarkdownResource(uri: string, markdown: string): {
49
+ contents: {
50
+ uri: string;
51
+ mimeType: string;
52
+ text: string;
53
+ }[];
54
+ };
55
+ /**
56
+ * Helper method to create a text resource response
57
+ * @param uri The resource URI
58
+ * @param text The plain text content
59
+ */
60
+ protected createTextResource(uri: string, text: string): {
61
+ contents: {
62
+ uri: string;
63
+ mimeType: string;
64
+ text: string;
65
+ }[];
66
+ };
67
+ /**
68
+ * Start the MCP server with optional HTTP service layer for inter-server communication
69
+ */
70
+ start(options?: {
71
+ httpPort?: number;
72
+ }): Promise<void>;
73
+ /**
74
+ * Start HTTP service layer for inter-server communication
75
+ */
76
+ private startHttpService;
77
+ /**
78
+ * Call a tool on another ACCESS-CI MCP server via HTTP
79
+ */
80
+ protected callRemoteServer(serviceName: string, toolName: string, args?: Record<string, any>): Promise<any>;
81
+ /**
82
+ * Get service endpoint from environment configuration
83
+ * Expected format: ACCESS_MCP_SERVICES=nsf-awards=http://localhost:3001,xdmod-metrics=http://localhost:3002
84
+ */
85
+ private getServiceEndpoint;
19
86
  }
@@ -1,7 +1,8 @@
1
1
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
3
+ import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
4
4
  import axios from "axios";
5
+ import express from "express";
5
6
  export class BaseAccessServer {
6
7
  serverName;
7
8
  version;
@@ -9,6 +10,8 @@ export class BaseAccessServer {
9
10
  server;
10
11
  transport;
11
12
  _httpClient;
13
+ _httpServer;
14
+ _httpPort;
12
15
  constructor(serverName, version, baseURL = "https://support.access-ci.org/api") {
13
16
  this.serverName = serverName;
14
17
  this.version = version;
@@ -20,6 +23,7 @@ export class BaseAccessServer {
20
23
  capabilities: {
21
24
  resources: {},
22
25
  tools: {},
26
+ prompts: {},
23
27
  },
24
28
  });
25
29
  this.transport = new StdioServerTransport();
@@ -98,10 +102,203 @@ export class BaseAccessServer {
98
102
  };
99
103
  }
100
104
  });
105
+ this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
106
+ try {
107
+ return { prompts: this.getPrompts() };
108
+ }
109
+ catch (error) {
110
+ // Silent error handling for MCP compatibility
111
+ return { prompts: [] };
112
+ }
113
+ });
114
+ this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
115
+ try {
116
+ return await this.handleGetPrompt(request);
117
+ }
118
+ catch (error) {
119
+ const errorMessage = error instanceof Error ? error.message : String(error);
120
+ console.error("Error getting prompt:", errorMessage);
121
+ throw error;
122
+ }
123
+ });
124
+ }
125
+ /**
126
+ * Get available prompts - override in subclasses to provide prompts
127
+ */
128
+ getPrompts() {
129
+ return [];
130
+ }
131
+ /**
132
+ * Handle resource read requests - override in subclasses
133
+ */
134
+ async handleResourceRead(request) {
135
+ throw new Error("Resource reading not supported by this server");
136
+ }
137
+ /**
138
+ * Handle get prompt requests - override in subclasses
139
+ */
140
+ async handleGetPrompt(request) {
141
+ throw new Error("Prompt not found");
142
+ }
143
+ /**
144
+ * Helper method to create a JSON resource response
145
+ * @param uri The resource URI
146
+ * @param data The data to return as JSON
147
+ */
148
+ createJsonResource(uri, data) {
149
+ return {
150
+ contents: [
151
+ {
152
+ uri,
153
+ mimeType: "application/json",
154
+ text: JSON.stringify(data, null, 2),
155
+ },
156
+ ],
157
+ };
158
+ }
159
+ /**
160
+ * Helper method to create a Markdown resource response
161
+ * @param uri The resource URI
162
+ * @param markdown The markdown content
163
+ */
164
+ createMarkdownResource(uri, markdown) {
165
+ return {
166
+ contents: [
167
+ {
168
+ uri,
169
+ mimeType: "text/markdown",
170
+ text: markdown,
171
+ },
172
+ ],
173
+ };
174
+ }
175
+ /**
176
+ * Helper method to create a text resource response
177
+ * @param uri The resource URI
178
+ * @param text The plain text content
179
+ */
180
+ createTextResource(uri, text) {
181
+ return {
182
+ contents: [
183
+ {
184
+ uri,
185
+ mimeType: "text/plain",
186
+ text: text,
187
+ },
188
+ ],
189
+ };
190
+ }
191
+ /**
192
+ * Start the MCP server with optional HTTP service layer for inter-server communication
193
+ */
194
+ async start(options) {
195
+ // Start HTTP service layer if port is specified
196
+ if (options?.httpPort) {
197
+ this._httpPort = options.httpPort;
198
+ await this.startHttpService();
199
+ console.log(`${this.serverName} HTTP server running on port ${this._httpPort}`);
200
+ }
201
+ else {
202
+ // Only connect stdio transport when NOT in HTTP mode
203
+ await this.server.connect(this.transport);
204
+ // MCP servers should not output anything to stderr/stdout when running
205
+ // as it interferes with JSON-RPC communication
206
+ }
207
+ }
208
+ /**
209
+ * Start HTTP service layer for inter-server communication
210
+ */
211
+ async startHttpService() {
212
+ if (!this._httpPort)
213
+ return;
214
+ this._httpServer = express();
215
+ this._httpServer.use(express.json());
216
+ // Health check endpoint
217
+ this._httpServer.get('/health', (req, res) => {
218
+ res.json({
219
+ server: this.serverName,
220
+ version: this.version,
221
+ status: 'healthy',
222
+ timestamp: new Date().toISOString()
223
+ });
224
+ });
225
+ // List available tools endpoint
226
+ this._httpServer.get('/tools', (req, res) => {
227
+ try {
228
+ const tools = this.getTools();
229
+ res.json({ tools });
230
+ }
231
+ catch (error) {
232
+ res.status(500).json({ error: 'Failed to list tools' });
233
+ }
234
+ });
235
+ // Tool execution endpoint
236
+ this._httpServer.post('/tools/:toolName', async (req, res) => {
237
+ try {
238
+ const { toolName } = req.params;
239
+ const { arguments: args = {} } = req.body;
240
+ // Validate that the tool exists
241
+ const tools = this.getTools();
242
+ const tool = tools.find(t => t.name === toolName);
243
+ if (!tool) {
244
+ return res.status(404).json({ error: `Tool '${toolName}' not found` });
245
+ }
246
+ // Execute the tool
247
+ const request = {
248
+ params: {
249
+ name: toolName,
250
+ arguments: args
251
+ }
252
+ };
253
+ const result = await this.handleToolCall(request);
254
+ res.json(result);
255
+ }
256
+ catch (error) {
257
+ const errorMessage = error instanceof Error ? error.message : String(error);
258
+ res.status(500).json({ error: errorMessage });
259
+ }
260
+ });
261
+ // Start HTTP server
262
+ return new Promise((resolve, reject) => {
263
+ this._httpServer.listen(this._httpPort, '0.0.0.0', () => {
264
+ resolve();
265
+ }).on('error', reject);
266
+ });
101
267
  }
102
- async start() {
103
- await this.server.connect(this.transport);
104
- // MCP servers should not output anything to stderr/stdout when running
105
- // as it interferes with JSON-RPC communication
268
+ /**
269
+ * Call a tool on another ACCESS-CI MCP server via HTTP
270
+ */
271
+ async callRemoteServer(serviceName, toolName, args = {}) {
272
+ const serviceUrl = this.getServiceEndpoint(serviceName);
273
+ if (!serviceUrl) {
274
+ throw new Error(`Service '${serviceName}' not found. Check ACCESS_MCP_SERVICES environment variable.`);
275
+ }
276
+ const response = await axios.post(`${serviceUrl}/tools/${toolName}`, {
277
+ arguments: args
278
+ }, {
279
+ timeout: 30000,
280
+ validateStatus: () => true
281
+ });
282
+ if (response.status !== 200) {
283
+ throw new Error(`Remote server call failed: ${response.status} ${response.data?.error || response.statusText}`);
284
+ }
285
+ return response.data;
286
+ }
287
+ /**
288
+ * Get service endpoint from environment configuration
289
+ * Expected format: ACCESS_MCP_SERVICES=nsf-awards=http://localhost:3001,xdmod-metrics=http://localhost:3002
290
+ */
291
+ getServiceEndpoint(serviceName) {
292
+ const services = process.env.ACCESS_MCP_SERVICES;
293
+ if (!services)
294
+ return null;
295
+ const serviceMap = {};
296
+ services.split(',').forEach(service => {
297
+ const [name, url] = service.split('=');
298
+ if (name && url) {
299
+ serviceMap[name.trim()] = url.trim();
300
+ }
301
+ });
302
+ return serviceMap[serviceName] || null;
106
303
  }
107
304
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./base-server.js";
2
2
  export * from "./types.js";
3
3
  export * from "./utils.js";
4
+ export * from "./taxonomies.js";
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./base-server.js";
2
2
  export * from "./types.js";
3
3
  export * from "./utils.js";
4
+ export * from "./taxonomies.js";
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Shared taxonomies and reference data for ACCESS-CI MCP servers
3
+ * These provide context to AI assistants about the ACCESS-CI ecosystem
4
+ */
5
+ export interface FieldOfScience {
6
+ name: string;
7
+ description: string;
8
+ keywords: string[];
9
+ typical_resources: string[];
10
+ common_software: string[];
11
+ allocation_range?: {
12
+ min: number;
13
+ max: number;
14
+ typical: number;
15
+ };
16
+ }
17
+ /**
18
+ * NSF Field of Science classification with ACCESS-CI context
19
+ * Based on NSF's formal classification system with added context about
20
+ * typical resource usage patterns and software requirements
21
+ */
22
+ export declare const FIELDS_OF_SCIENCE: Record<string, FieldOfScience>;
23
+ /**
24
+ * ACCESS Allocation Types with definitions and typical use cases
25
+ */
26
+ export interface AllocationType {
27
+ name: string;
28
+ description: string;
29
+ typical_duration: string;
30
+ credit_range: {
31
+ min: number;
32
+ max: number;
33
+ };
34
+ use_cases: string[];
35
+ eligibility: string;
36
+ }
37
+ export declare const ALLOCATION_TYPES: Record<string, AllocationType>;
38
+ /**
39
+ * Common resource types and their characteristics
40
+ */
41
+ export interface ResourceType {
42
+ name: string;
43
+ description: string;
44
+ typical_use_cases: string[];
45
+ key_features: string[];
46
+ }
47
+ export declare const RESOURCE_TYPES: Record<string, ResourceType>;
48
+ /**
49
+ * Get field of science by name or partial match
50
+ */
51
+ export declare function getFieldOfScience(fieldName: string): FieldOfScience | null;
52
+ /**
53
+ * Get all field names
54
+ */
55
+ export declare function getFieldNames(): string[];
56
+ /**
57
+ * Get allocation type by name
58
+ */
59
+ export declare function getAllocationType(typeName: string): AllocationType | null;
60
+ /**
61
+ * ACCESS-CI Feature Codes
62
+ * These numeric codes identify capabilities and characteristics of ACCESS resources
63
+ * Derived from the ACCESS Operations API resource catalog
64
+ */
65
+ export declare const ACCESS_FEATURE_CODES: Record<number, string>;
66
+ /**
67
+ * Get feature name by code
68
+ */
69
+ export declare function getFeatureName(featureCode: number): string;
70
+ /**
71
+ * Get feature names for an array of codes
72
+ */
73
+ export declare function getFeatureNames(featureCodes: number[]): string[];
74
+ /**
75
+ * Major ACCESS-CI Systems Catalog
76
+ * Based on https://ara.access-ci.org/ resource advisor
77
+ */
78
+ export interface AccessSystem {
79
+ name: string;
80
+ organization: string;
81
+ description: string;
82
+ strengths: string[];
83
+ gpu_types?: string[];
84
+ max_memory_per_node?: string;
85
+ storage_capacity?: string;
86
+ user_interfaces: string[];
87
+ ideal_for: string[];
88
+ experience_level: string[];
89
+ }
90
+ export declare const ACCESS_SYSTEMS: Record<string, AccessSystem>;
91
+ /**
92
+ * Memory requirements guide
93
+ */
94
+ export declare const MEMORY_REQUIREMENTS: {
95
+ "< 64 GB": {
96
+ description: string;
97
+ typical_uses: string[];
98
+ recommended_systems: string[];
99
+ };
100
+ "64-256 GB": {
101
+ description: string;
102
+ typical_uses: string[];
103
+ recommended_systems: string[];
104
+ };
105
+ "256-512 GB": {
106
+ description: string;
107
+ typical_uses: string[];
108
+ recommended_systems: string[];
109
+ };
110
+ "> 512 GB": {
111
+ description: string;
112
+ typical_uses: string[];
113
+ recommended_systems: string[];
114
+ };
115
+ };
116
+ /**
117
+ * GPU selection guide based on use case
118
+ */
119
+ export declare const GPU_SELECTION_GUIDE: {
120
+ "Large Language Models": {
121
+ recommended_gpu: string;
122
+ recommended_systems: string[];
123
+ min_memory: string;
124
+ notes: string;
125
+ };
126
+ "Computer Vision": {
127
+ recommended_gpu: string;
128
+ recommended_systems: string[];
129
+ min_memory: string;
130
+ notes: string;
131
+ };
132
+ "Molecular Dynamics": {
133
+ recommended_gpu: string;
134
+ recommended_systems: string[];
135
+ min_memory: string;
136
+ notes: string;
137
+ };
138
+ "General AI/ML": {
139
+ recommended_gpu: string;
140
+ recommended_systems: string[];
141
+ min_memory: string;
142
+ notes: string;
143
+ };
144
+ };
@@ -0,0 +1,698 @@
1
+ /**
2
+ * Shared taxonomies and reference data for ACCESS-CI MCP servers
3
+ * These provide context to AI assistants about the ACCESS-CI ecosystem
4
+ */
5
+ /**
6
+ * NSF Field of Science classification with ACCESS-CI context
7
+ * Based on NSF's formal classification system with added context about
8
+ * typical resource usage patterns and software requirements
9
+ */
10
+ export const FIELDS_OF_SCIENCE = {
11
+ "Computer Science": {
12
+ name: "Computer Science",
13
+ description: "Research in algorithms, AI/ML, data science, cybersecurity, and high-performance computing",
14
+ keywords: [
15
+ "machine learning",
16
+ "artificial intelligence",
17
+ "deep learning",
18
+ "neural networks",
19
+ "data science",
20
+ "algorithms",
21
+ "distributed systems",
22
+ "parallel computing",
23
+ "HPC",
24
+ "cybersecurity",
25
+ "computer vision",
26
+ "natural language processing",
27
+ "NLP",
28
+ ],
29
+ typical_resources: ["GPU", "high memory", "fast storage", "high-speed networking"],
30
+ common_software: [
31
+ "TensorFlow",
32
+ "PyTorch",
33
+ "scikit-learn",
34
+ "Python",
35
+ "CUDA",
36
+ "Jupyter",
37
+ "NumPy",
38
+ "Pandas",
39
+ ],
40
+ allocation_range: {
41
+ min: 50000,
42
+ max: 1000000,
43
+ typical: 250000,
44
+ },
45
+ },
46
+ "Biological Sciences": {
47
+ name: "Biological Sciences",
48
+ description: "Research in genomics, proteomics, structural biology, systems biology, and bioinformatics",
49
+ keywords: [
50
+ "genomics",
51
+ "proteomics",
52
+ "bioinformatics",
53
+ "structural biology",
54
+ "molecular dynamics",
55
+ "sequence analysis",
56
+ "protein folding",
57
+ "phylogenetics",
58
+ "systems biology",
59
+ "metagenomics",
60
+ ],
61
+ typical_resources: ["high throughput", "large storage", "CPU clusters", "high memory"],
62
+ common_software: [
63
+ "BLAST",
64
+ "GROMACS",
65
+ "AMBER",
66
+ "NAMD",
67
+ "Rosetta",
68
+ "Bowtie",
69
+ "SAMtools",
70
+ "BioPython",
71
+ ],
72
+ allocation_range: {
73
+ min: 100000,
74
+ max: 800000,
75
+ typical: 300000,
76
+ },
77
+ },
78
+ "Physics": {
79
+ name: "Physics",
80
+ description: "Research in high energy physics, astrophysics, condensed matter, and computational physics",
81
+ keywords: [
82
+ "quantum mechanics",
83
+ "particle physics",
84
+ "astrophysics",
85
+ "cosmology",
86
+ "condensed matter",
87
+ "computational physics",
88
+ "molecular dynamics",
89
+ "lattice QCD",
90
+ "gravitational waves",
91
+ ],
92
+ typical_resources: ["CPU clusters", "high memory", "GPU for simulations", "large storage"],
93
+ common_software: [
94
+ "LAMMPS",
95
+ "Quantum ESPRESSO",
96
+ "VASP",
97
+ "GROMACS",
98
+ "ROOT",
99
+ "Geant4",
100
+ "MATLAB",
101
+ "Mathematica",
102
+ ],
103
+ allocation_range: {
104
+ min: 100000,
105
+ max: 2000000,
106
+ typical: 500000,
107
+ },
108
+ },
109
+ "Chemistry": {
110
+ name: "Chemistry",
111
+ description: "Research in computational chemistry, molecular modeling, and materials science",
112
+ keywords: [
113
+ "molecular dynamics",
114
+ "quantum chemistry",
115
+ "computational chemistry",
116
+ "materials science",
117
+ "drug discovery",
118
+ "reaction mechanisms",
119
+ "DFT",
120
+ "ab initio",
121
+ ],
122
+ typical_resources: ["CPU clusters", "high memory", "GPU acceleration", "fast storage"],
123
+ common_software: [
124
+ "Gaussian",
125
+ "GAMESS",
126
+ "NWChem",
127
+ "ORCA",
128
+ "AMBER",
129
+ "NAMD",
130
+ "LAMMPS",
131
+ "VMD",
132
+ ],
133
+ allocation_range: {
134
+ min: 75000,
135
+ max: 1000000,
136
+ typical: 300000,
137
+ },
138
+ },
139
+ "Engineering": {
140
+ name: "Engineering",
141
+ description: "Research in computational engineering, CFD, structural analysis, and design optimization",
142
+ keywords: [
143
+ "computational fluid dynamics",
144
+ "CFD",
145
+ "finite element analysis",
146
+ "FEA",
147
+ "structural analysis",
148
+ "optimization",
149
+ "CAD",
150
+ "mechanical engineering",
151
+ "aerospace",
152
+ ],
153
+ typical_resources: ["CPU clusters", "high memory", "GPU for visualization", "parallel I/O"],
154
+ common_software: [
155
+ "ANSYS",
156
+ "OpenFOAM",
157
+ "COMSOL",
158
+ "ABAQUS",
159
+ "LS-DYNA",
160
+ "SU2",
161
+ "ParaView",
162
+ ],
163
+ allocation_range: {
164
+ min: 100000,
165
+ max: 1500000,
166
+ typical: 400000,
167
+ },
168
+ },
169
+ "Earth Sciences": {
170
+ name: "Earth Sciences",
171
+ description: "Research in climate modeling, atmospheric science, geophysics, and environmental science",
172
+ keywords: [
173
+ "climate modeling",
174
+ "atmospheric science",
175
+ "weather prediction",
176
+ "oceanography",
177
+ "geophysics",
178
+ "seismology",
179
+ "remote sensing",
180
+ "environmental science",
181
+ ],
182
+ typical_resources: ["large storage", "CPU clusters", "high I/O", "data analytics"],
183
+ common_software: [
184
+ "WRF",
185
+ "CESM",
186
+ "NCAR",
187
+ "netCDF",
188
+ "GDAL",
189
+ "Python",
190
+ "R",
191
+ "MATLAB",
192
+ ],
193
+ allocation_range: {
194
+ min: 150000,
195
+ max: 2000000,
196
+ typical: 600000,
197
+ },
198
+ },
199
+ "Mathematics and Statistics": {
200
+ name: "Mathematics and Statistics",
201
+ description: "Research in numerical analysis, optimization, data analytics, and statistical modeling",
202
+ keywords: [
203
+ "numerical analysis",
204
+ "optimization",
205
+ "linear algebra",
206
+ "statistics",
207
+ "data analytics",
208
+ "monte carlo",
209
+ "stochastic processes",
210
+ "computational mathematics",
211
+ ],
212
+ typical_resources: ["CPU clusters", "high memory", "GPU for linear algebra"],
213
+ common_software: [
214
+ "MATLAB",
215
+ "R",
216
+ "Python",
217
+ "Julia",
218
+ "Mathematica",
219
+ "SAS",
220
+ "SPSS",
221
+ "Octave",
222
+ ],
223
+ allocation_range: {
224
+ min: 50000,
225
+ max: 500000,
226
+ typical: 150000,
227
+ },
228
+ },
229
+ "Social Sciences": {
230
+ name: "Social Sciences",
231
+ description: "Research in economics, sociology, political science, and computational social science",
232
+ keywords: [
233
+ "econometrics",
234
+ "agent-based modeling",
235
+ "network analysis",
236
+ "social networks",
237
+ "political science",
238
+ "computational social science",
239
+ "survey analysis",
240
+ ],
241
+ typical_resources: ["data analytics", "storage", "CPU clusters for simulations"],
242
+ common_software: [
243
+ "R",
244
+ "Python",
245
+ "Stata",
246
+ "SPSS",
247
+ "NetLogo",
248
+ "Gephi",
249
+ "Julia",
250
+ ],
251
+ allocation_range: {
252
+ min: 25000,
253
+ max: 300000,
254
+ typical: 100000,
255
+ },
256
+ },
257
+ "Astronomy and Astrophysics": {
258
+ name: "Astronomy and Astrophysics",
259
+ description: "Research in observational astronomy, cosmological simulations, and data analysis",
260
+ keywords: [
261
+ "cosmology",
262
+ "galaxy formation",
263
+ "stellar evolution",
264
+ "exoplanets",
265
+ "gravitational waves",
266
+ "radio astronomy",
267
+ "optical astronomy",
268
+ "simulation",
269
+ ],
270
+ typical_resources: ["large storage", "CPU clusters", "GPU for visualization", "data pipelines"],
271
+ common_software: [
272
+ "Gadget",
273
+ "FLASH",
274
+ "Enzo",
275
+ "Athena",
276
+ "IRAF",
277
+ "DS9",
278
+ "Python",
279
+ "astropy",
280
+ ],
281
+ allocation_range: {
282
+ min: 150000,
283
+ max: 2500000,
284
+ typical: 700000,
285
+ },
286
+ },
287
+ };
288
+ export const ALLOCATION_TYPES = {
289
+ Discover: {
290
+ name: "Discover ACCESS Credits",
291
+ description: "Small allocations for exploring ACCESS resources and conducting preliminary research",
292
+ typical_duration: "12 months",
293
+ credit_range: {
294
+ min: 1000,
295
+ max: 400000,
296
+ },
297
+ use_cases: [
298
+ "Preliminary research and feasibility studies",
299
+ "Code development and testing",
300
+ "Learning ACCESS systems",
301
+ "Small-scale computational experiments",
302
+ "Proof-of-concept work",
303
+ ],
304
+ eligibility: "All researchers at US institutions",
305
+ },
306
+ Explore: {
307
+ name: "Explore ACCESS Credits",
308
+ description: "Medium allocations for established research projects",
309
+ typical_duration: "12 months",
310
+ credit_range: {
311
+ min: 400000,
312
+ max: 1500000,
313
+ },
314
+ use_cases: [
315
+ "Ongoing research projects",
316
+ "Production computations",
317
+ "Data analysis and processing",
318
+ "Multi-parameter studies",
319
+ "Medium-scale simulations",
320
+ ],
321
+ eligibility: "Researchers with demonstrated need beyond Discover level",
322
+ },
323
+ Accelerate: {
324
+ name: "Accelerate ACCESS Credits",
325
+ description: "Large allocations for significant computational research",
326
+ typical_duration: "12 months",
327
+ credit_range: {
328
+ min: 1500000,
329
+ max: 10000000,
330
+ },
331
+ use_cases: [
332
+ "Large-scale simulations",
333
+ "Major research initiatives",
334
+ "High-throughput computing campaigns",
335
+ "Big data analytics",
336
+ "Multi-year projects",
337
+ ],
338
+ eligibility: "Well-established research programs with significant computational needs",
339
+ },
340
+ Maximize: {
341
+ name: "Maximize ACCESS Credits",
342
+ description: "Very large allocations for exceptional computational research with broad impact",
343
+ typical_duration: "12 months",
344
+ credit_range: {
345
+ min: 10000000,
346
+ max: 50000000,
347
+ },
348
+ use_cases: [
349
+ "Grand challenge problems",
350
+ "Transformative research",
351
+ "National-scale computing campaigns",
352
+ "Major scientific breakthroughs",
353
+ "Leadership-class computing",
354
+ ],
355
+ eligibility: "Exceptional projects with demonstrated transformative potential and broad impact",
356
+ },
357
+ };
358
+ export const RESOURCE_TYPES = {
359
+ CPU: {
360
+ name: "CPU Compute",
361
+ description: "General-purpose computing with standard processors",
362
+ typical_use_cases: [
363
+ "Serial and parallel applications",
364
+ "General scientific computing",
365
+ "Data processing",
366
+ "Simulations",
367
+ ],
368
+ key_features: [
369
+ "High core counts",
370
+ "Good memory bandwidth",
371
+ "MPI support",
372
+ "Long-running jobs",
373
+ ],
374
+ },
375
+ GPU: {
376
+ name: "GPU Accelerated",
377
+ description: "Systems with graphics processing units for accelerated computing",
378
+ typical_use_cases: [
379
+ "Machine learning and AI",
380
+ "Deep learning",
381
+ "Molecular dynamics",
382
+ "Image processing",
383
+ "CFD simulations",
384
+ ],
385
+ key_features: [
386
+ "CUDA/ROCm support",
387
+ "High memory bandwidth",
388
+ "Tensor cores",
389
+ "Fast training",
390
+ ],
391
+ },
392
+ "High Memory": {
393
+ name: "High Memory Systems",
394
+ description: "Systems with large RAM for memory-intensive applications",
395
+ typical_use_cases: [
396
+ "Large datasets in memory",
397
+ "Genome assembly",
398
+ "In-memory databases",
399
+ "Large-scale graph analysis",
400
+ ],
401
+ key_features: [
402
+ "1TB+ memory per node",
403
+ "Fast memory access",
404
+ "Large working sets",
405
+ ],
406
+ },
407
+ Storage: {
408
+ name: "Storage Resources",
409
+ description: "High-capacity storage systems for data-intensive research",
410
+ typical_use_cases: [
411
+ "Large datasets",
412
+ "Data archival",
413
+ "Intermediate results",
414
+ "Collaborative data sharing",
415
+ ],
416
+ key_features: [
417
+ "Petabyte-scale capacity",
418
+ "High-speed I/O",
419
+ "Data management tools",
420
+ "Backup and archival",
421
+ ],
422
+ },
423
+ Cloud: {
424
+ name: "Cloud Computing",
425
+ description: "Flexible cloud-based computing resources",
426
+ typical_use_cases: [
427
+ "Web services",
428
+ "Containers and microservices",
429
+ "Science gateways",
430
+ "Interactive computing",
431
+ "Elastic workloads",
432
+ ],
433
+ key_features: [
434
+ "On-demand resources",
435
+ "Virtual machines",
436
+ "Container support",
437
+ "API access",
438
+ ],
439
+ },
440
+ };
441
+ /**
442
+ * Get field of science by name or partial match
443
+ */
444
+ export function getFieldOfScience(fieldName) {
445
+ // Exact match
446
+ if (FIELDS_OF_SCIENCE[fieldName]) {
447
+ return FIELDS_OF_SCIENCE[fieldName];
448
+ }
449
+ // Case-insensitive partial match
450
+ const lowerFieldName = fieldName.toLowerCase();
451
+ for (const [key, value] of Object.entries(FIELDS_OF_SCIENCE)) {
452
+ if (key.toLowerCase().includes(lowerFieldName) || lowerFieldName.includes(key.toLowerCase())) {
453
+ return value;
454
+ }
455
+ }
456
+ return null;
457
+ }
458
+ /**
459
+ * Get all field names
460
+ */
461
+ export function getFieldNames() {
462
+ return Object.keys(FIELDS_OF_SCIENCE);
463
+ }
464
+ /**
465
+ * Get allocation type by name
466
+ */
467
+ export function getAllocationType(typeName) {
468
+ // Exact match
469
+ if (ALLOCATION_TYPES[typeName]) {
470
+ return ALLOCATION_TYPES[typeName];
471
+ }
472
+ // Case-insensitive partial match
473
+ const lowerTypeName = typeName.toLowerCase();
474
+ for (const [key, value] of Object.entries(ALLOCATION_TYPES)) {
475
+ if (key.toLowerCase() === lowerTypeName) {
476
+ return value;
477
+ }
478
+ }
479
+ return null;
480
+ }
481
+ /**
482
+ * ACCESS-CI Feature Codes
483
+ * These numeric codes identify capabilities and characteristics of ACCESS resources
484
+ * Derived from the ACCESS Operations API resource catalog
485
+ */
486
+ export const ACCESS_FEATURE_CODES = {
487
+ // Core resource capabilities
488
+ 100: "GPU Computing",
489
+ 101: "High Memory Computing",
490
+ 102: "High Performance Storage",
491
+ 103: "High Throughput Computing",
492
+ 104: "Large Scale Computing",
493
+ // Access and interface types
494
+ 134: "Cloud Computing Platform",
495
+ 135: "Container Support",
496
+ 136: "Virtual Machine Support",
497
+ 137: "Science Gateway Resource", // Often excluded from general listings
498
+ 138: "Interactive Computing",
499
+ 139: "ACCESS Allocated Resource", // Requires ACCESS allocation
500
+ // Specialized capabilities
501
+ 140: "Data Transfer Node",
502
+ 141: "Visualization Capabilities",
503
+ 142: "GPU Acceleration",
504
+ 143: "AI/ML Optimized",
505
+ 144: "Quantum Computing",
506
+ // Network and I/O
507
+ 145: "High-Speed Networking",
508
+ 146: "Parallel I/O",
509
+ 147: "Data Staging",
510
+ // Software and environment
511
+ 148: "Specialized Software Stack",
512
+ 149: "Custom Environments",
513
+ 150: "Jupyter Support",
514
+ 151: "RStudio Support",
515
+ // Note: This is a partial mapping based on observed feature IDs
516
+ // Complete documentation may be available from ACCESS Operations team
517
+ };
518
+ /**
519
+ * Get feature name by code
520
+ */
521
+ export function getFeatureName(featureCode) {
522
+ return ACCESS_FEATURE_CODES[featureCode] || `Unknown Feature (${featureCode})`;
523
+ }
524
+ /**
525
+ * Get feature names for an array of codes
526
+ */
527
+ export function getFeatureNames(featureCodes) {
528
+ return featureCodes.map(code => getFeatureName(code));
529
+ }
530
+ export const ACCESS_SYSTEMS = {
531
+ "Delta": {
532
+ name: "Delta",
533
+ organization: "NCSA (University of Illinois)",
534
+ description: "GPU-focused system with NVIDIA A100 and A40 GPUs",
535
+ strengths: ["AI/ML", "Deep Learning", "GPU Computing", "Large Models"],
536
+ gpu_types: ["NVIDIA A100 (40GB/80GB)", "NVIDIA A40"],
537
+ max_memory_per_node: "256 GB (CPU nodes), 2 TB (large memory)",
538
+ storage_capacity: "Large parallel filesystem",
539
+ user_interfaces: ["SSH", "Open OnDemand", "Jupyter"],
540
+ ideal_for: [
541
+ "Training large language models",
542
+ "Deep learning research",
543
+ "GPU-accelerated simulations",
544
+ "Computer vision",
545
+ ],
546
+ experience_level: ["Intermediate", "Advanced"],
547
+ },
548
+ "Bridges-2": {
549
+ name: "Bridges-2",
550
+ organization: "PSC (Pittsburgh Supercomputing Center)",
551
+ description: "Versatile system with CPU, GPU, and high-memory nodes",
552
+ strengths: ["General Purpose", "High Memory", "GPU Computing", "Visualization"],
553
+ gpu_types: ["NVIDIA V100", "NVIDIA A100", "NVIDIA A40"],
554
+ max_memory_per_node: "4 TB Extreme Memory nodes",
555
+ storage_capacity: "15 PB",
556
+ user_interfaces: ["SSH", "Open OnDemand", "Jupyter", "RStudio", "VS Code"],
557
+ ideal_for: [
558
+ "Genome assembly",
559
+ "Large-scale data analytics",
560
+ "Mixed workloads (CPU+GPU)",
561
+ "Memory-intensive applications",
562
+ ],
563
+ experience_level: ["Beginner", "Intermediate", "Advanced"],
564
+ },
565
+ "Anvil": {
566
+ name: "Anvil",
567
+ organization: "Purdue University",
568
+ description: "Composable subsystem architecture with flexible resource allocation",
569
+ strengths: ["Composable Architecture", "Flexible Resources", "CPU Computing"],
570
+ max_memory_per_node: "256 GB (standard), 1 TB (large memory)",
571
+ storage_capacity: "Multi-PB",
572
+ user_interfaces: ["SSH", "Open OnDemand", "Jupyter"],
573
+ ideal_for: [
574
+ "Parallel CPU applications",
575
+ "Genomics workflows",
576
+ "Data science",
577
+ "Gateway hosting",
578
+ ],
579
+ experience_level: ["Beginner", "Intermediate", "Advanced"],
580
+ },
581
+ "Expanse": {
582
+ name: "Expanse",
583
+ organization: "SDSC (San Diego Supercomputing Center)",
584
+ description: "Balanced CPU and GPU computing with excellent storage",
585
+ strengths: ["Data-Intensive Computing", "GPU Computing", "CPU Computing"],
586
+ gpu_types: ["NVIDIA V100"],
587
+ max_memory_per_node: "2 TB",
588
+ storage_capacity: "7 PB parallel storage",
589
+ user_interfaces: ["SSH", "Jupyter", "RStudio"],
590
+ ideal_for: [
591
+ "Data analytics at scale",
592
+ "Bioinformatics",
593
+ "Machine learning",
594
+ "Simulation science",
595
+ ],
596
+ experience_level: ["Intermediate", "Advanced"],
597
+ },
598
+ "Stampede3": {
599
+ name: "Stampede3",
600
+ organization: "TACC (Texas Advanced Computing Center)",
601
+ description: "Leadership-class supercomputer with NVIDIA Grace-Hopper",
602
+ strengths: ["Leadership Computing", "AI/ML", "Large-Scale Simulation"],
603
+ gpu_types: ["NVIDIA Grace Hopper Superchip"],
604
+ max_memory_per_node: "480 GB (Grace-Hopper)",
605
+ user_interfaces: ["SSH", "TACC Portal"],
606
+ ideal_for: [
607
+ "Grand challenge problems",
608
+ "Large-scale AI training",
609
+ "Extreme-scale simulations",
610
+ "Leadership-class workloads",
611
+ ],
612
+ experience_level: ["Advanced", "Expert"],
613
+ },
614
+ "Jetstream2": {
615
+ name: "Jetstream2",
616
+ organization: "Indiana University",
617
+ description: "Cloud computing platform for interactive science and gateways",
618
+ strengths: ["Cloud Computing", "Interactive Computing", "Science Gateways", "Flexibility"],
619
+ gpu_types: ["NVIDIA A100"],
620
+ user_interfaces: ["Exosphere (web)", "OpenStack API", "Jupyter", "RStudio"],
621
+ ideal_for: [
622
+ "Science gateways",
623
+ "Web services",
624
+ "Interactive analysis",
625
+ "Classroom use",
626
+ "Container-based workflows",
627
+ ],
628
+ experience_level: ["Beginner", "Intermediate"],
629
+ },
630
+ "Open Science Grid": {
631
+ name: "Open Science Grid",
632
+ organization: "OSG Consortium",
633
+ description: "High-throughput computing for distributed workflows",
634
+ strengths: ["High-Throughput Computing", "Distributed Computing", "Workflows"],
635
+ user_interfaces: ["HTCondor", "APIs"],
636
+ ideal_for: [
637
+ "High-throughput workflows",
638
+ "Parameter sweeps",
639
+ "Embarrassingly parallel tasks",
640
+ "Large-scale ensembles",
641
+ ],
642
+ experience_level: ["Intermediate", "Advanced"],
643
+ },
644
+ };
645
+ /**
646
+ * Memory requirements guide
647
+ */
648
+ export const MEMORY_REQUIREMENTS = {
649
+ "< 64 GB": {
650
+ description: "Standard memory for most applications",
651
+ typical_uses: ["Serial applications", "Small datasets", "Code development"],
652
+ recommended_systems: ["Anvil", "Bridges-2", "Expanse"],
653
+ },
654
+ "64-256 GB": {
655
+ description: "Medium memory for moderate-scale applications",
656
+ typical_uses: ["Parallel applications", "Medium datasets", "Ensemble runs"],
657
+ recommended_systems: ["Delta", "Anvil", "Bridges-2", "Expanse"],
658
+ },
659
+ "256-512 GB": {
660
+ description: "High memory for large-scale applications",
661
+ typical_uses: ["Large genomic assemblies", "Big data analytics", "In-memory databases"],
662
+ recommended_systems: ["Bridges-2", "Anvil"],
663
+ },
664
+ "> 512 GB": {
665
+ description: "Extreme memory for the largest problems",
666
+ typical_uses: ["Whole genome assembly", "Extreme-scale graph analytics", "Very large matrices"],
667
+ recommended_systems: ["Bridges-2 (up to 4TB)"],
668
+ },
669
+ };
670
+ /**
671
+ * GPU selection guide based on use case
672
+ */
673
+ export const GPU_SELECTION_GUIDE = {
674
+ "Large Language Models": {
675
+ recommended_gpu: "NVIDIA A100 80GB or Grace-Hopper",
676
+ recommended_systems: ["Delta", "Stampede3"],
677
+ min_memory: "80 GB per GPU",
678
+ notes: "Multi-GPU required for models >10B parameters",
679
+ },
680
+ "Computer Vision": {
681
+ recommended_gpu: "NVIDIA A100 40GB or V100",
682
+ recommended_systems: ["Delta", "Bridges-2", "Expanse"],
683
+ min_memory: "16-40 GB per GPU",
684
+ notes: "A100 recommended for training, V100 sufficient for inference",
685
+ },
686
+ "Molecular Dynamics": {
687
+ recommended_gpu: "NVIDIA A100 or V100",
688
+ recommended_systems: ["Delta", "Bridges-2", "Expanse"],
689
+ min_memory: "16-40 GB per GPU",
690
+ notes: "Double-precision performance important",
691
+ },
692
+ "General AI/ML": {
693
+ recommended_gpu: "NVIDIA V100 or A100",
694
+ recommended_systems: ["Delta", "Bridges-2", "Expanse", "Jetstream2"],
695
+ min_memory: "16-40 GB per GPU",
696
+ notes: "V100 good for most workloads, A100 for larger models",
697
+ },
698
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@access-mcp/shared",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Shared utilities for ACCESS-CI MCP servers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,6 +34,10 @@
34
34
  "dependencies": {
35
35
  "@modelcontextprotocol/sdk": "^1.16.0",
36
36
  "axios": "^1.6.0",
37
+ "express": "^5.1.0",
37
38
  "zod": "^3.22.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/express": "^5.0.0"
38
42
  }
39
43
  }