mcp_settings.json (or the mcphub_user table when the database backend is enabled). All endpoints require an authenticated admin (isAdmin: true).
For OAuth/social accounts created via Better Auth, see /api/better-auth/* instead — those records live in a separate table and are not managed through this API.
GET /api/users
List all users.
GET /api/users/:username
Get a single user.
POST /api/users
Create a user.
PUT /api/users/:username
Update a user.
DELETE /api/users/:username
Delete a user.
GET /api/users-stats
Aggregate user counts.
Get All Users
- Endpoint:
GET /api/users - Authentication: Required (admin only)
- Response: The
passwordfield is stripped from every record.
Get a User
- Endpoint:
GET /api/users/:username - Authentication: Required (admin only)
- Response:
404 if the user does not exist.
Create a User
- Endpoint:
POST /api/users - Authentication: Required (admin only)
- Body:
- Returns
400ifusername/passwordare missing, the password is too weak, or the username is already taken. - Returns
201with the new user (password stripped) on success.
The user model does not have per-user
servers or groups lists. Server access is governed by each server’s owner, visibility, and sharedWithUsers fields. See Authentication & Security and MCP Settings.Update a User
- Endpoint:
PUT /api/users/:username - Authentication: Required (admin only)
- Body (at least one field is required):
- Returns
400if neither field is supplied, the password fails validation, or the request would demote the last remaining admin. - Returns
404if the username does not exist.
Delete a User
- Endpoint:
DELETE /api/users/:username - Authentication: Required (admin only)
- Restrictions:
- You cannot delete your own account.
- You cannot delete the last admin.
Get User Statistics
- Endpoint:
GET /api/users-stats - Authentication: Required (admin only)