Repository navigation
Add alwaysLoad to AgentConfig MCP servers - #1852
Open
knechtionscoding wants to merge 1 commit into
Open
knechtionscoding wants to merge 1 commit into
knechtionscoding wants to merge 1 commit into
Conversation
Claude Code defers MCP tool definitions behind tool search and loads a server's tools on demand. An agent that uses one server on nearly every run pays a ToolSearch call for it, and on some providers that load breaks the prompt cache for the rest of the run. MCPServerSpec gains an optional alwaysLoad. When true it is written into the server's entry in KELOS_MCP_SERVERS, and Claude Code loads that server's tools at session start while other servers stay deferred. Codex builds its config from named fields, so it never sees the key. v1alpha1 is still served and has no alwaysLoad, so conversion to v1alpha1 records each flagged server in the kelos.dev/v1alpha2-mcp-always-load annotation, and conversion back restores it by index and name, as the other v1alpha2-only MCP and skills settings do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
knechtionscoding
requested a deployment
to
ok-to-test
October 28, 2026 10:25 — with
GitHub Actions
Waiting
knechtionscoding
marked this pull request as ready for review
October 28, 2026 10:35
There was a problem hiding this comment.
No issues found across 8 files
You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind api
What this PR does / why we need it:
Claude Code defers MCP tool definitions behind tool search and only loads a server's tools when the agent asks for them with
ToolSearch. An agent that uses one server on nearly every run pays aToolSearchcall for it every time, and with some model providers that load also invalidates the prompt cache for the rest of the run.MCPServerSpecgets an optionalalwaysLoadfield. When it istrue, the server's entry inKELOS_MCP_SERVERSincludes"alwaysLoad": true, and Claude Code loads that server's tools at session start. Other servers stay deferred. Codex builds its config from named fields, so it never sees the key. Cursor and Gemini copy each server entry into their own config unchanged.The field exists only in
v1alpha2.v1alpha1is still served, so conversion tov1alpha1records each flagged server in thekelos.dev/v1alpha2-mcp-always-loadannotation, and conversion back restores it by index and name. This works the same way as the otherv1alpha2-only MCP and skills settings. Without it, reading and saving an AgentConfig throughv1alpha1would drop the flag.Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
N/A
Does this PR introduce a user-facing change?
Summary by cubic
Adds an optional
alwaysLoadfield to MCP servers inAgentConfigso Claude Code loads a flagged server's tools at session start instead of deferring them behind tool search.v1alpha1conversion records the flag in thekelos.dev/v1alpha2-mcp-always-loadannotation and restores it by index and name; Codex builds its config from named fields and never sees the key.Written for commit 7de85c4. Summary will update on new commits.