feat(mcp): connection-profile registry for multi-environment switching#20
Open
Starushenko wants to merge 2 commits into
Open
feat(mcp): connection-profile registry for multi-environment switching#20Starushenko wants to merge 2 commits into
Starushenko wants to merge 2 commits into
Conversation
Adds a connection-profile convention so one MCP server can target many Corezoid environments (markets / projects / dev+prod) without per-folder .env juggling and process restarts. - registry.example.json: coordinates-only template (tokens stay per-user) - docs/connection-profiles.md: profile abstraction, signal-based resolution (host / JIRA prefix / alias), dev-safety, and MCP-server implementation notes (reuse the existing withAuthLock reload path from handleLogin). Data + docs only; the Go wiring is described for follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the use-profile MCP tool that switches the running server to a named connection profile from ~/.corezoid/profiles/registry.json WITHOUT rewriting the shared cwd/.env — which is what let two chats rooted in the same directory clobber each other's environment. - mcp_handlers_profile.go: registry load, signal resolver (key / URL host / JIRA prefix / alias, dev-preferred on ambiguity), handleUseProfile (sets auth globals via withAuthLock + token from per-profile env_file; in-memory only). - registered in mcp_handlers.go (dispatch + noAuth) and tools_registry.go. - registry.example.json gains env_file; docs updated to 'implemented'. Registry is optional — with no registry.json, behaviour is unchanged (.env). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
.envjuggling + restarts.use-profileMCP tool: switches the running session to a named profile from~/.corezoid/profiles/registry.json, resolved by registry key / Corezoid URL host / JIRA prefix (AZ-123) / alias. It sets the auth globals via the existingwithAuthLockpath and loads the token from a per-profileenv_file— without rewriting the sharedcwd/.env.registry.example.json(coordinates only — tokens stay per-user) +docs/connection-profiles.md.Why
.envswap + restart.loginpersists tocwd/.env, so two chats rooted in the same directory clobber each other's environment (observed live: a chat meant for env A started hitting env B's host).use-profilemutates in-memory state only, so parallel chats stay isolated.registry.json, behaviour is unchanged (.envas before).Changes
mcp-server/mcp_handlers_profile.go— registry load, signal resolver (dev-preferred on ambiguous prefix; prod requiresconfirm=true),handleUseProfile.mcp-server/mcp_handlers.go,mcp-server/tools_registry.go— register the tool.mcp-server/registry.example.json,docs/connection-profiles.md.Test plan
go build ./...passesregistry.example.jsonis valid JSON@MalishkinMV — review please.
🤖 Generated with Claude Code