feat(ai): enhance metadata handling and add support for tools, prompt… (#14002)
…s, and resources - Removed unused `ObjectMetadataStandardIdToIdMap`. - Updated Vite config with additional allowed hosts. - Improved MCP service to handle `ping` method and lists for tools, prompts, and resources. - Refactored utility function `isFieldMetadataEntityOfType` for improved type handling. - Expanded MCP metadata service to include tools, prompts, and resources support.
This commit is contained in:
@@ -14,11 +14,11 @@ export class McpMetadataController {
|
||||
constructor(private readonly mCPMetadataService: MCPMetadataService) {}
|
||||
|
||||
@Post()
|
||||
async getMcpMetadata(
|
||||
async handleMcpMetadata(
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
@Req() request: Request,
|
||||
) {
|
||||
return await this.mCPMetadataService.handleMCPQuery(request, {
|
||||
return await this.mCPMetadataService.handleMCPMetadataQuery(request, {
|
||||
workspace,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,6 +57,9 @@ export class MCPMetadataService {
|
||||
resources: { listChanged: false },
|
||||
prompts: { listChanged: false },
|
||||
},
|
||||
tools: [],
|
||||
resources: [],
|
||||
prompts: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -115,11 +118,13 @@ export class MCPMetadataService {
|
||||
tools: { listChanged: false },
|
||||
},
|
||||
tools: Object.values(this.tools),
|
||||
resources: [],
|
||||
prompts: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async handleMCPQuery(
|
||||
async handleMCPMetadataQuery(
|
||||
request: Request,
|
||||
{
|
||||
workspace,
|
||||
@@ -153,6 +158,28 @@ export class MCPMetadataService {
|
||||
return this.listTools(request);
|
||||
}
|
||||
|
||||
if (request.body.method === 'prompts/list') {
|
||||
return wrapJsonRpcResponse(request.body.id, {
|
||||
result: {
|
||||
capabilities: {
|
||||
prompts: { listChanged: false },
|
||||
},
|
||||
prompts: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (request.body.method === 'resources/list') {
|
||||
return wrapJsonRpcResponse(request.body.id, {
|
||||
result: {
|
||||
capabilities: {
|
||||
resources: { listChanged: false },
|
||||
},
|
||||
resources: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return wrapJsonRpcResponse(request.body.id ?? crypto.randomUUID(), {
|
||||
result: {},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user