feat: ApplicationSet support to the MCP server - #134
Open
rishabh625 wants to merge 1 commit into
Open
Conversation
rishabh625
force-pushed
the
feature/add-applicationset-support
branch
2 times, most recently
from
July 13, 2026 04:44
455b968 to
4ce9724
Compare
Signed-off-by: rishabh625 <rishabhmishra625@gmail.com> Original commits: - 2865497 Add ApplicationSet support - 718ab61 Fix ApplicationSet query parameter (appNamespace -> appsetNamespace) - 7a4aa34 fix(argocd): update appset API and add namespace support - 057414a refactor: standardize ApplicationSet generate type names - 5f3a698 chore: update README to include ApplicationSets Signed-off-by: rishabh625 <rishabhmishra625@gmail.com>
rishabh625
force-pushed
the
feature/add-applicationset-support
branch
from
July 13, 2026 04:50
4ce9724 to
862acd4
Compare
Author
|
Can you please help with review and share your valuable comments. |
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.
Add Full ArgoCD ApplicationSet Support
Summary
This change adds full ArgoCD ApplicationSet support to the MCP server, covering:
Test video is shared at the end of Description
Previously, the MCP server only supported standalone Application resources. ApplicationSets—the controller-based mechanism for templating multiple Applications from generators such as
list,git,cluster,matrix, etc.—had no representation, preventing callers from inspecting or managing them.Fixes #82
Closes #135
Changes
ArgoCDClientAdded new client methods that mirror the existing
ApplicationAPIs.List ApplicationSets
GET /api/v1/applicationsetsGet ApplicationSet
GET /api/v1/applicationsets/{name}Create ApplicationSet
POST /api/v1/applicationsetsUpdate ApplicationSet
POST /api/v1/applicationsetsto match ArgoCD API semantics.
Delete ApplicationSet
DELETE /api/v1/applicationsets/{name}Supports:
Resource Tree
GET /api/v1/applicationsets/{name}/resource-treeGenerate (Dry Run)
POST /api/v1/applicationsets/generateReturns the Applications that would be created from the supplied spec without persisting anything.
Type Exports
Added generated types:
V1alpha1ApplicationSetV1alpha1ApplicationSetListV1alpha1ApplicationSetTreeV1alpha1ApplicationSetGenerateRequestV1alpha1ApplicationSetGenerateResponseZod Schema
Added:
ApplicationSetSchemaStrongly Typed
Flexible
ApplicationSet specs intentionally remain flexible because different generator types (
list,git,matrix,cluster, etc.) have different schemas.MCP Tools
Read-Only Tools
Always registered (even when
MCP_READ_ONLY=true).list_applicationsetsget_applicationsetget_applicationset_resource_treegenerate_applicationsetpreview_applicationsetMutating Tools
Only registered when:
create_applicationsetupdate_applicationsetdelete_applicationsetpreview_applicationsetA convenience tool that:
generateApplicationSet()using its specThis answers:
without manually reconstructing its specification.
Existing MCP Behavior Preserved
All new tools automatically inherit:
argocdBaseUrloverrideaddJsonOutputToolNo additional implementation work is required.
Tests
Added test coverage for:
Tool Registration
Verifies that all five read-only ApplicationSet tools are registered.
Token Resolution
Ensures:
list_applicationsetsfollows the exact same security model as
listApplications.If an overridden
argocdBaseUrlhas no matching token in the registry:Read-Only Mode
Verifies:
When:
the following tools are not registered:
while the five read-only tools remain available.
Behavior Notes
MCP_READ_ONLY.updateApplicationSet()always sends:to match ArgoCD API behavior.
Unlike
listApplications, which strips most of the Application spec,listApplicationSetsintentionally preserves:specstatus.conditionsstatus.applicationStatusbecause the ApplicationSet specification itself is the primary resource callers need to inspect.
Known Gap
README.mdhas not yet been updated.Recommended before merge:
Add a new section:
alongside:
to document the new MCP tools.
Examples
Generate (Dry Run)
Generate the Applications an ApplicationSet would produce without creating anything.
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "generate_applicationset", "arguments": { "applicationSet": { "metadata": { "name": "guestbook-set", "namespace": "argocd" }, "spec": { "generators": [ { "list": { "elements": [ { "cluster": "engineering-dev" }, { "cluster": "engineering-prod" } ] } } ], "template": { "metadata": { "name": "guestbook-{{cluster}}" }, "spec": { "project": "default", "source": { "repoURL": "https://github.com/argoproj/argocd-example-apps.git", "targetRevision": "HEAD", "path": "guestbook" }, "destination": { "server": "{{cluster}}", "namespace": "guestbook" } } } } } } } }Preview an Existing ApplicationSet
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "preview_applicationset", "arguments": { "applicationSetName": "guestbook-set" } } }Testing
Run before merging:
pnpm testIncludes:
Runtime Validation
Verify behavior with:
Expected:
Registered:
Not Registered:
Tested MCP client using mcp-inspector
https://drive.google.com/file/d/1-GOezvGESTKDIMkCKHo2u7LjOk0mW8Q6/view?usp=sharing