add managed auth tools (manage_auth_connections, manage_credentials, manage_credential_providers)#104
add managed auth tools (manage_auth_connections, manage_credentials, manage_credential_providers)#104masnwilliams wants to merge 10 commits into
Conversation
…manage_credential_providers) Closes the largest agent-facing capability gap in the MCP server: setting up an authenticated browser session for a third-party site. Agents can now drive Kernel's managed auth flow end-to-end. - manage_auth_connections: create/list/get/delete connections; start login flows (returns hosted_url + live_view_url); submit MFA codes or SSO selections when a flow is awaiting input. - manage_credentials: read-only (list, get, totp_code). Credentials are created by humans via dashboard/CLI so the agent never sees raw secrets in its context — it references credentials by name. - manage_credential_providers: read-only (list, get) for external providers like 1Password. Same human-creates / agent-consumes pattern.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Monitoring Plan: Add managed-auth and credentials MCP toolsWhat this PR does: Registers three new MCP tool handlers — Intended effect: After deploy, AI agents using the MCP server can invoke these three tools. Successful calls will appear as spans on the already-active Kernel API backend endpoints ( Risks:
Status updates will be posted automatically on this PR as monitoring progresses. |
Cursor Bugbot caught that we were sending invalid credential payloads when only credential_path or credential_auto was provided without credential_provider. Add upfront validation so the agent gets a clear MCP-level error instead of a generic API rejection.
Cursor Bugbot follow-up: credential_auto=false was treated as a valid provider variant, and credential_path + credential_auto: true were silently allowed together. Only credential_auto: true now counts as a provider mode, and path/auto are enforced as mutually exclusive.
…providers also expose list_items and test on credential providers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…t empty credential values Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
dcruzeneil2
left a comment
There was a problem hiding this comment.
LGTM! Clean PR, follows existing codebase patterns well. One nit:
nit: submit in manage_auth_connections lets fields: {} through the validation guard since !params.fields is falsy for empty objects. The API will likely reject it anyway, but manage_credentials create already handles the equivalent case with Object.keys(params.values).length === 0. Worth adding the same check here for consistency.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7d19430. Configure here.
…_providers create Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Summary
Closes the largest agent-facing capability gap in the MCP server: setting up an authenticated browser session for a third-party site. Agents can now drive Kernel's managed auth flow end-to-end without a human in the loop beyond the one-time hosted login or explicit credential handoff.
What's added
manage_auth_connections(full surface)create— start managing auth for a profile + domain (optionally referencing a pre-stored credential by name, or an external provider like 1Password)list/get/deletelogin— kicks off a hosted login flow. Returnshosted_url(share with the user to sign in) andlive_view_url(agent can watch). Triggers automatic re-auth if credentials are saved.submit— provide field values, an MFA option ID, or an SSO button selector when the flow isawaiting_input. Agent inspectsdiscovered_fields/mfa_optionsfromgetto know what's needed.manage_credentials(full CRUD)list/get(SDK never returns values) /totp_code(current 6-digit code)create/update/delete— agents can store and rotate credentials directly. Values, sso_provider, and totp_secret are all settable.manage_credential_providers(full CRUD)list/get/create/update/deletefor external providers (e.g. 1Password)list_itemsto enumerate available items from the provider, andtestto validate the token and list accessible vaultsAgent Experience / Flow
This PR gives agents a durable path from "I need to use a logged-in site" to "I have a browser profile that can be reused for that site." The agent should first decide whether it already has a profile and credential source, then create the auth connection, start the login, and poll the connection state until the profile is healthy.
Typical flow:
manage_credentials list/get/create, ormanage_credential_providers list_itemswhen the secret lives in an external provider.manage_auth_connections create domain=<site> profile_name=<profile> credential_name=<credential>.manage_auth_connections login id=<conn_id>and shares thehosted_urlwith the user when human login is required.manage_auth_connections get id=<conn_id>until the flow reaches success, or until it seesawaiting_inputwithdiscovered_fields/mfa_options.manage_credentials totp_code, then usesmanage_auth_connections submit.manage_browsers create profile_name=<profile>so the session opens already logged in.Agent safety notes:
getnever returns credential secret values, so agents should not expect to recover passwords after creation.totp_codeand provider tokens are sensitive outputs; agents should use them only for the active auth flow and avoid echoing them in summaries.Test plan
manage_auth_connections listreturns existing connections for the authed usermanage_auth_connections create+loginreturns a working hosted URLmanage_credentialsround-trip:create→list→get→update→deletemanage_credentials totp_codereturns a 6-digit code for a TOTP-enabled credentialmanage_credential_providersround-trip:create→test→list_items→update→deleteTool count
Bumps from 10 → 13.
Note
High Risk
Introduces agent-facing APIs for auth flows, credential storage/rotation, TOTP codes, and external provider tokens—security-sensitive surfaces that must not leak secrets in tool output.
Overview
Adds managed auth to the MCP server so agents can set up and maintain logged-in browser profiles without manual API work.
Three new
manage_*tools follow the existing action-based pattern and call the Kernel SDK:manage_auth_connections(create/list/get/delete connections,loginfor hosted + live view URLs,submitfor MFA/SSO/fields, with validation for credential vs 1Password-style options and proxies);manage_credentials(CRUD plustotp_code, metadata-only on get); andmanage_credential_providers(1Password-style providers withlist_itemsandtest).registerMcpCapabilitieswires in the new registrars; the README updates the tool count 10 → 13 and documents the new capabilities.Reviewed by Cursor Bugbot for commit 3dff35c. Bugbot is set up for automated code reviews on this repo. Configure here.