UNPKG

hackmd-mcp

Version:

A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants.

27 lines (26 loc) 790 B
export function registerProfileApiTools(server, client) { // Tool: Get user information server.tool("get_user_info", "Get information about the authenticated user", {}, { title: "Get user information", readOnlyHint: true, openWorldHint: true, }, async () => { try { const userInfo = await client.getMe(); return { content: [ { type: "text", text: JSON.stringify(userInfo, null, 2), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }); }