Repository navigation
fix(init): project client context connection env onto the DIR MCP entry - #1876
Merged
Merged
Conversation
akijakya
force-pushed
the
fix/init-mcp-server-env
branch
from
July 23, 2026 09:22
db5f07d to
2a7ded8
Compare
Signed-off-by: András Jáky <[email protected]>
akijakya
force-pushed
the
fix/init-mcp-server-env
branch
from
July 23, 2026 09:36
2a7ded8 to
14883fd
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
paralta
approved these changes
Jul 23, 2026
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
dirctl initnow writes the client context's connection settings into the DIR MCP server entry'senv, instead of leaving it empty.Why
dirctl mcp servereads its Directory connection settings only fromDIRECTORY_CLIENT_*environment variables — it consults neither the client config file norcurrent_context. The installed entry shippedenv: {}, so every spawned server ignored the context just configured duringinitand fell back to the0.0.0.0:8888default. Worse, with an empty auth mode the client attempts OIDC auto-detection, which fails outright on machines with multiple cached issuers — surfacing asagntcy-dir · ✘ failedin the host.What's projected
From the resolved context (env overrides applied, validation skipped so a partial config still works):
SERVER_ADDRESSandAUTH_MODE(empty mode defaults toinsecure, matching the local daemon default).TLS_SKIP_VERIFY, SPIFFE socket, OIDC issuer/client-id, JWT audience.AUTH_TOKENandSPIFFE_TOKEN— the two secrets are excluded so a bearer token never lands in an agent config file.Injection happens in the
initflow only (via a newArtifacts.SetMCPEnvhelper), so the generic published record anddirctl install <record>are unaffected.Testing
SetMCPEnv(overlay onto existing entries; create theenvmap when absent).dirctl inittest asserts the written config carries both the address and auth-mode env keys.