Problem
The create_user tool in src/okta_mcp_server/tools/users/users.py accepts only a profile dict and calls client.create_user(user_data) without passing any query parameters. The Okta Users API defaults activate=true, so every user created via this tool lands in PROVISIONED status (activation email is fired immediately).
There is no way to create a user in STAGED status, which is the expected starting state for:
- Pre-hire / future-dated employee imports
- M&A user migrations where activation is controlled centrally by HR/IT
- Bulk imports where you want to validate data before kicking off provisioning workflows
Current behavior
# src/okta_mcp_server/tools/users/users.py
async def create_user(profile: dict, ctx: Context = None) -> list:
...
user_data = {"profile": profile}
user, _, err = await client.create_user(user_data)
Result: new user is in PROVISIONED status, activation email sent.
Proposed fix
Accept an activate: bool = True parameter and pass it through to the Okta SDK (which already supports query_params.activate per its user_client.create_user docstring):
async def create_user(profile: dict, activate: bool = True, ctx: Context = None) -> list:
...
user_data = {"profile": profile}
user, _, err = await client.create_user(
user_data,
{"activate": str(activate).lower()},
)
Default behavior is preserved. Callers needing STAGED pass activate=False.
Verification
I've applied this patch locally and verified end-to-end:
- Created a disposable user with
activate="false" via the Okta Python SDK
- Confirmed returned user's
status == UserStatus.STAGED
- Deleted the test user (STAGED users delete in a single call)
Happy to open a PR with the fix.
References
Problem
The
create_usertool insrc/okta_mcp_server/tools/users/users.pyaccepts only aprofiledict and callsclient.create_user(user_data)without passing any query parameters. The Okta Users API defaultsactivate=true, so every user created via this tool lands inPROVISIONEDstatus (activation email is fired immediately).There is no way to create a user in
STAGEDstatus, which is the expected starting state for:Current behavior
Result: new user is in
PROVISIONEDstatus, activation email sent.Proposed fix
Accept an
activate: bool = Trueparameter and pass it through to the Okta SDK (which already supportsquery_params.activateper itsuser_client.create_userdocstring):Default behavior is preserved. Callers needing STAGED pass
activate=False.Verification
I've applied this patch locally and verified end-to-end:
activate="false"via the Okta Python SDKstatus == UserStatus.STAGEDHappy to open a PR with the fix.
References
activatequery paramuser_client.create_usersignature acceptsquery_params.activate