getCurrentUser
Retrieve current user information from the Directus CMS API by providing the API URL and authentication token, simplifying user management through the Directus MCP Server.
Instructions
Get the current user info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | Authentication token (default from config) | |
| url | No | Directus API URL (default from config) |
Implementation Reference
- index.ts:440-457 (registration)Registration of the 'getCurrentUser' tool in the listTools response, including its input schema definition.{ name: "getCurrentUser", description: "Get the current user info", inputSchema: { type: "object", properties: { url: { type: "string", description: "Directus API URL (default from config)" }, token: { type: "string", description: "Authentication token (default from config)" } }, required: [] } },
- index.ts:880-896 (handler)Handler implementation for 'getCurrentUser' tool. Fetches current user info from Directus API endpoint '/users/me' using axios GET request with bearer token authentication.case "getCurrentUser": { const token = toolArgs.token || CONFIG.DIRECTUS_ACCESS_TOKEN; const response = await axios.get( `${url}/users/me`, { headers: buildHeaders(token) } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2) } ] }; }