affine_current_user
Retrieve details of the currently signed-in user within the AFFiNE MCP Server, facilitating user authentication and session management for workspace operations.
Instructions
Get current signed-in user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/user.ts:7-11 (handler)The handler function for the affine_current_user tool. It executes a GraphQL query to fetch the current user's details (id, name, email, etc.) and returns them as text.const currentUserHandler = async () => { const query = `query Me { currentUser { id name email emailVerified avatarUrl disabled } }`; const data = await gql.request<{ currentUser: any }>(query); return text(data.currentUser); };
- src/tools/user.ts:15-18 (schema)The input/output schema for the tool, with empty inputSchema indicating no parameters required, title and description provided.{ title: "Current User", description: "Get current signed-in user.", inputSchema: {}
- src/tools/user.ts:13-21 (registration)The registration of the "affine_current_user" tool using server.registerTool, linking the schema and handler.server.registerTool( "affine_current_user", { title: "Current User", description: "Get current signed-in user.", inputSchema: {} }, currentUserHandler as any );