MCPcopy
hub / github.com/subquery/subql / registerInitMCPTool

Function registerInitMCPTool

packages/cli/src/commands/init.ts:235–260  ·  view source on GitHub ↗
(server: McpServer, opts: MCPToolOptions)

Source from the content-addressed store, hash-verified

233const nonInteractiveInitInputs = initInputs.required({name: true});
234
235export function registerInitMCPTool(server: McpServer, opts: MCPToolOptions): RegisteredTool {
236 return server.registerTool(
237 Init.name,
238 {
239 description: Init.description,
240 inputSchema: (opts.supportsElicitation ? initInputs : nonInteractiveInitInputs).shape,
241 // outputSchema: initOutputs.shape, // TODO once we know the output we can add this
242 },
243 async (args, meta) => {
244 const cwd = await getMCPWorkingDirectory(server);
245 const logger = mcpLogger(server.server);
246
247 const prompt = opts.supportsElicitation ? makeMCPElicitPrmompt(server) : null;
248 const result = await initAdapter(cwd, args, logger, prompt);
249
250 return {
251 content: [
252 {
253 type: 'text',
254 text: `Project created at ${result.projectPath}`,
255 },
256 ],
257 };
258 }
259 );
260}

Callers 1

runMethod · 0.90

Calls 4

getMCPWorkingDirectoryFunction · 0.90
mcpLoggerFunction · 0.90
makeMCPElicitPrmomptFunction · 0.90
initAdapterFunction · 0.85

Tested by

no test coverage detected