Skip to content

feat(mcp): add the blueprint_apply tool - #1502

Open
GirlBossRush wants to merge 2 commits into
mcp/blueprint-toolfrom
mcp/blueprint-apply
Open

GirlBossRush wants to merge 2 commits into
mcp/blueprint-toolfrom
mcp/blueprint-apply

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds blueprint_apply MCP tool which:

  • Validates a proposed Blueprint locally
  • Applies it through the authentik agent connector's apply endpoint
  • Guides ak config setup when the device isn't connected.

Depends on the authentik Agent apply endpoint. See goauthentik/authentik#26072

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.92053% with 133 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.02%. Comparing base (b27cfe2) to head (05c4a8e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
ak-cli/src/mcp/tools.rs 0.00% 123 Missing ⚠️
ak-cli/src/mcp/mod.rs 0.00% 8 Missing ⚠️
ak-cli/src/mcp/blueprint/validate.rs 89.47% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           mcp/blueprint-tool    #1502      +/-   ##
======================================================
- Coverage               52.29%   52.02%   -0.28%     
======================================================
  Files                     201      201              
  Lines                   21154    21300     +146     
  Branches                16267    16413     +146     
======================================================
+ Hits                    11063    11081      +18     
- Misses                   9732     9858     +126     
- Partials                  359      361       +2     
Flag Coverage Δ
rs-e2e-24.04 32.86% <0.00%> (-0.34%) ⬇️
rs-e2e-25.10 10.16% <0.00%> (-0.11%) ⬇️
rs-e2e-26.04 10.14% <0.00%> (-0.13%) ⬇️
rs-macos-26-ak-agent 29.64% <ø> (ø)
rs-macos-26-ak-agent-desktop 0.00% <ø> (ø)
rs-macos-26-ak-api-cli 100.00% <ø> (ø)
rs-macos-26-ak-api-cli-gen 66.71% <ø> (ø)
rs-macos-26-ak-browser-support 23.93% <ø> (ø)
rs-macos-26-ak-cli 55.37% <11.92%> (-2.59%) ⬇️
rs-macos-26-ak-flow-executor 13.62% <ø> (ø)
rs-macos-26-ak-meta 0.00% <ø> (ø)
rs-macos-26-ak-meta-macros 0.00% <ø> (ø)
rs-macos-26-ak-platform 66.68% <ø> (ø)
rs-macos-26-ak-platform-authz 0.00% <ø> (ø)
rs-macos-26-ak-platform-facts 83.44% <ø> (ø)
rs-macos-26-ak-platform-keyring 66.45% <ø> (ø)
rs-macos-26-ak-sysd 33.87% <ø> (ø)
rs-ubuntu-24.04-ak-agent 31.81% <ø> (ø)
rs-ubuntu-24.04-ak-agent-desktop 0.00% <ø> (ø)
rs-ubuntu-24.04-ak-api-cli 100.00% <ø> (ø)
rs-ubuntu-24.04-ak-api-cli-gen 66.71% <ø> (ø)
rs-ubuntu-24.04-ak-browser-support 23.93% <ø> (ø)
rs-ubuntu-24.04-ak-cli 55.37% <11.92%> (-2.59%) ⬇️
rs-ubuntu-24.04-ak-flow-executor 13.62% <ø> (ø)
rs-ubuntu-24.04-ak-meta 0.00% <ø> (ø)
rs-ubuntu-24.04-ak-meta-macros 0.00% <ø> (ø)
rs-ubuntu-24.04-ak-nss 77.37% <ø> (ø)
rs-ubuntu-24.04-ak-pam 0.00% <ø> (ø)
rs-ubuntu-24.04-ak-platform 65.98% <ø> (ø)
rs-ubuntu-24.04-ak-platform-authz 0.00% <ø> (ø)
rs-ubuntu-24.04-ak-platform-facts 82.64% <ø> (ø)
rs-ubuntu-24.04-ak-platform-keyring 53.33% <ø> (ø)
rs-ubuntu-24.04-ak-sysd 34.09% <ø> (ø)
rs-ubuntu-24.04-arm-ak-agent 31.81% <ø> (ø)
rs-ubuntu-24.04-arm-ak-agent-desktop 0.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-api-cli 100.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-api-cli-gen 66.71% <ø> (ø)
rs-ubuntu-24.04-arm-ak-browser-support 23.93% <ø> (ø)
rs-ubuntu-24.04-arm-ak-cli 55.37% <11.92%> (-2.59%) ⬇️
rs-ubuntu-24.04-arm-ak-flow-executor 13.62% <ø> (ø)
rs-ubuntu-24.04-arm-ak-meta 0.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-meta-macros 0.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-nss 77.37% <ø> (ø)
rs-ubuntu-24.04-arm-ak-pam 0.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-platform 65.98% <ø> (ø)
rs-ubuntu-24.04-arm-ak-platform-authz 0.00% <ø> (ø)
rs-ubuntu-24.04-arm-ak-platform-facts 82.64% <ø> (ø)
rs-ubuntu-24.04-arm-ak-platform-keyring 53.33% <ø> (ø)
rs-ubuntu-24.04-arm-ak-sysd 34.09% <ø> (ø)
rs-windows-2025-ak-agent 31.81% <ø> (ø)
rs-windows-2025-ak-agent-desktop 0.00% <ø> (ø)
rs-windows-2025-ak-api-cli 100.00% <ø> (ø)
rs-windows-2025-ak-api-cli-gen 66.71% <ø> (ø)
rs-windows-2025-ak-browser-support 23.93% <ø> (ø)
rs-windows-2025-ak-cli 55.37% <11.92%> (-2.59%) ⬇️
rs-windows-2025-ak-flow-executor 13.62% <ø> (ø)
rs-windows-2025-ak-meta 0.00% <ø> (ø)
rs-windows-2025-ak-meta-macros 0.00% <ø> (ø)
rs-windows-2025-ak-platform 58.00% <ø> (ø)
rs-windows-2025-ak-platform-authz 0.00% <ø> (ø)
rs-windows-2025-ak-platform-facts 78.66% <ø> (-0.23%) ⬇️
rs-windows-2025-ak-platform-keyring 76.51% <ø> (ø)
rs-windows-2025-ak-sysd 32.36% <ø> (ø)
rs-windows-2025-ee/wcp 46.48% <ø> (ø)
swift 3.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@GirlBossRush
GirlBossRush marked this pull request as ready for review September 12, 2026 13:55
@GirlBossRush GirlBossRush self-assigned this Sep 12, 2026
@authentik-automation

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-1502--authentik-pkg.netlify.app

@authentik-automation
authentik-automation Bot temporarily deployed to pull request September 12, 2026 14:32 Inactive
@BeryJu
BeryJu force-pushed the mcp/blueprint-apply branch from 18fafc5 to d7b51eb Compare September 15, 2026 23:38
@authentik-automation
authentik-automation Bot temporarily deployed to pull request September 16, 2026 00:17 Inactive
Validate a proposed Blueprint locally, then apply it on the server via the Agent connector's apply_blueprint endpoint, which applies as a bounded least-privilege identity (never as the operator). If the device isn't set up, the tool returns guidance to run `ak config setup` rather than failing opaquely — progressive setup, no separate step required to install the server.

The endpoints API is not in the typed Rust client, so the connector lookup and apply are raw authenticated requests using the operator's agent token.
@BeryJu
BeryJu force-pushed the mcp/blueprint-apply branch from d7b51eb to 05c4a8e Compare September 16, 2026 00:25
@authentik-automation
authentik-automation Bot temporarily deployed to pull request September 16, 2026 00:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant