MCPcopy Create free account
hub / github.com/echoVic/blade-code / handleListResources

Method handleListResources

src/mcp/server/MCPServer.ts:214–237  ·  view source on GitHub ↗

* 处理列出资源

(clientId: string, message: MCPMessage)

Source from the content-addressed store, hash-verified

212 * 处理列出资源
213 */
214 private async handleListResources(clientId: string, message: MCPMessage): Promise<void> {
215 const resources: MCPResource[] = [
216 {
217 uri: 'file://workspace',
218 name: 'Current Workspace',
219 description: 'Files and directories in the current workspace',
220 mimeType: 'application/json',
221 },
222 {
223 uri: 'git://status',
224 name: 'Git Status',
225 description: 'Current git repository status',
226 mimeType: 'application/json',
227 },
228 {
229 uri: 'git://log',
230 name: 'Git Log',
231 description: 'Recent git commits',
232 mimeType: 'application/json',
233 },
234 ];
235
236 this.sendResponse(clientId, message.id, { resources });
237 }
238
239 /**
240 * 处理读取资源

Callers 1

handleMessageMethod · 0.95

Calls 1

sendResponseMethod · 0.95

Tested by

no test coverage detected