feat(mcp): add repository list/add/rename/remove tools#3766
feat(mcp): add repository list/add/rename/remove tools#3766Ankitsinghsisodya wants to merge 1 commit into
Conversation
This commit introduces new tools for managing template repositories, including listing, adding, renaming, and removing repositories. Each tool is accompanied by a handler in the MCP server and relevant input/output structures. Additionally, comprehensive tests have been added to ensure the correct functionality of these tools, including error handling and readonly mode checks.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ankitsinghsisodya The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3766 +/- ##
==========================================
+ Coverage 57.06% 57.21% +0.14%
==========================================
Files 181 182 +1
Lines 21145 21214 +69
==========================================
+ Hits 12067 12138 +71
+ Misses 7855 7853 -2
Partials 1223 1223
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changes
repository_listMCP tool to list installed template repositoriesrepository_addMCP tool to install a repository by name and URLrepository_renameMCP tool to rename an installed repositoryrepository_removeMCP tool to remove an installed repository from local disk/kind enhancement
Summary
This PR exposes
func repositorysubcommands as MCP tools, closing the gap between the CLI surface and the MCP tool surface for template repository management.Previously, an agent could call
createwith a--repositoryflag pointing to a remote URL, but had no way to persistently install, list, rename, or remove template repositories. With these tools, an agent can now manage the full lifecycle of local template repositories before scaffolding new functions.Tools Added
Implemented in
pkg/mcp/tools_repository.go:repository_listfunc repository listrepository_addfunc repository add <name> <url>repository_renamefunc repository rename <old> <new>repository_removefunc repository remove <name>All write tools (
add,rename,remove) return an error when the server is in readonly mode (i.e.FUNC_ENABLE_MCP_WRITEis not set), consistent withdeleteanddeploy.Tests
Added
pkg/mcp/tools_repository_test.gowith 11 test cases:--verboseflag is forwarded when setadd,rename,removego test -v ./pkg/mcp/...All existing tests continue to pass.
Release Note