Repository navigation
feat(add gitconfig MCP tools) - #2
Merged
Merged
Conversation
Expose git configuration management in the MCP server so agents can list, inspect, match, create, and delete git configs through the Epinio API.
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 changed
Added full git configuration management to the MCP core tier, mirroring the existing Epinio CLI/API surface.
New MCP tools (5):
list_gitconfigs — list git configs the caller can access
show_gitconfig — fetch one git config by id
match_gitconfigs — prefix-match git config ids (empty prefix = all; useful before bulk delete)
create_gitconfig — register credentials/settings for a git host (supports global, provider types, certs, skip SSL)
delete_gitconfig — batch-delete one or more git configs
Client layer: new types and REST methods in client/types.go and client/client.go for GET /gitconfigs, GET /gitconfigs/:id, GET /gitconfigsmatch, POST /gitconfigs, and batch DELETE /gitconfigs?gitconfigs[]=....
Registration: wired via RegisterGitconfigTools in tools/register.go.
Docs (in-repo): updated README.md and AGENTS.md to mention git configurations.
Intentionally omitted: no update_gitconfig tool. Epinio has no PATCH /gitconfigs/:id route; EPINIO-343 "updates" meant explicit gitconfig selection at deploy time, the global create flag, and enterprise provider fixes — not edit-in-place. Comments in tools/gitconfigs.go and client/types.go document this.
Passwords and certificates are write-only on create; list/show never return them.
Why
EPINIO-679 — git configuration functionality did not exist in the MCP server. Epinio already supports git configs via CLI, API, and UI (EPINIO-343); agents using MCP had no way to manage them.
Closes Epinio 679
What to test
Against an Epinio cluster where the caller has gitconfig_read / gitconfig_write as appropriate:
list_gitconfigs — returns git configs visible to the caller; no password/cert fields in the response.
show_gitconfig — returns details for a known id; 404/error for unknown id.
match_gitconfigs — with a prefix returns matching ids; with empty prefix returns all ids the caller can see.
create_gitconfig — creates a config with name, url, provider (e.g. github), optional username/password, skipssl, global (admin only). Confirm it appears in list_gitconfigs / show_gitconfig.
delete_gitconfig — deletes one id; batch-deletes multiple ids via names: ["a", "b"]. Confirm removed from list.
Permissions — non-admin global: true on create should fail with Epinio 403; read-only user should list/show but not create/delete.
Tests: no new unit tests in this PR. go test ./... passes locally. Dedicated client tests for gitconfig path/query encoding were descoped.
Possible regressions
None identified for existing tools. This is additive: one new tool file, client methods, and registration in RegisterCore. No changes to elevated tier, push flow, or existing CRUD tools.
Adjacent areas worth a quick smoke check: tool registration order and server startup (RegisterCore still completes without error).
Type
feature
Checklist
make checkpasses (fmt-check, vet, lint, test)EPINIO_MCP_ELEVATED, reaches directly into Kubernetes and needs the standard-elevated RBAC)epinio/docs