GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(mcp): add repository list/add/rename/remove tools by Ankitsinghsisodya · Pull Request #3823 · knative/func

Conversation

@Ankitsinghsisodya

@Ankitsinghsisodya Ankitsinghsisodya commented May 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Note: Re-submission of #3766, accidentally closed when the head repository was deleted.

/kind enhancement

Summary

This PR exposes func repository subcommands as MCP tools, closing the gap between the CLI surface and the MCP tool surface for template repository management.

Previously, an agent could call create with a --repository flag 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.

Changes

  • Add repository_list MCP tool to list installed template repositories
  • Add repository_add MCP tool to install a repository by name and URL
  • Add repository_rename MCP tool to rename an installed repository
  • Add repository_remove MCP tool to remove an installed repository from local disk
  • Register all four tools and their help resources in the MCP server
  • Add full test coverage for happy path, readonly guards, and error propagation

Tools Added

Implemented in pkg/mcp/tools_repository.go:

Tool CLI equivalent Readonly safe
repository_list func repository list Yes
repository_add func repository add <name> <url> No — blocked in readonly mode
repository_rename func repository rename <old> <new> No — blocked in readonly mode
repository_remove func repository remove <name> No — blocked in readonly mode

Tests

Added pkg/mcp/tools_repository_test.go with 11 test cases covering happy path, --verbose forwarding, readonly guards, and executor error propagation.

Release Note

Added MCP tools `repository_list`, `repository_add`, `repository_rename`, and `repository_remove` to manage installed template repositories from an agent context.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings May 21, 2026 11:19
@knative-prow knative-prow Bot added the kind/enhancement Feature additions or improvements to existing label May 21, 2026
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos May 21, 2026 11:19
@knative-prow knative-prow Bot added size/XL 🤖 PR changes 500-999 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels May 21, 2026
@knative-prow

knative-prow Bot commented May 21, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed May 21, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds MCP tools and server wiring for managing template repositories (list/add/rename/remove), along with unit tests to verify executor invocation, readonly behavior, and error propagation.

Changes:

  • Introduces new MCP repository tools with typed inputs/outputs and handlers.
  • Registers repository tools and related help resources in the MCP server initialization.
  • Adds a comprehensive test suite covering happy paths, readonly mode, and executor errors.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
pkg/mcp/tools_repository.go Implements repository_* MCP tools, inputs/outputs, and handlers that invoke the underlying executor.
pkg/mcp/mcp.go Registers the new repository tools and adds help resources for repository commands.
pkg/mcp/tools_repository_test.go Adds unit tests validating argument passing, readonly blocking, and error propagation for repository tools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/mcp/tools_repository.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/mcp/tools_repository.go Outdated
Comment on lines +78 to +81
if s.readonly {
err = fmt.Errorf("the server is currently in readonly mode. Please set FUNC_ENABLE_MCP_WRITE and restart the client")
return
}
Comment thread pkg/mcp/tools_repository.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/mcp/tools_repository.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/mcp/mcp.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/mcp/tools_repository_test.go
Comment on lines +48 to +54
executor.ExecuteFn = func(ctx context.Context, subcommand string, args ...string) ([]byte, error) {
argsMap := argsToMap(args)
if _, ok := argsMap["--verbose"]; !ok {
t.Fatalf("expected --verbose flag, got args: %v", args)
}
return []byte("default\nboson\thttps://github.com/boson-project/templates\n"), nil
}
@lkingland lkingland added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels May 22, 2026
@Ankitsinghsisodya
mcp: add repository management tools and corresponding tests
1f72e32
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.
@Ankitsinghsisodya
Ankitsinghsisodya force-pushed the feat/mcp-repository-tools branch from eeb129c to 1f72e32 Compare May 22, 2026 12:25
Ankitsinghsisodya and others added 2 commits May 22, 2026 17:57
@Ankitsinghsisodya @cursoragent
fix(mcp): correct readonly error message wording
518c040
Remove double space after period and change "restart the client"
to "restart the MCP server" since readonly mode is controlled
server-side via FUNC_ENABLE_MCP_WRITE.

Co-authored-by: Cursor <[email protected]>
@Ankitsinghsisodya
refactor(mcp): update readonly handling to use atomic operations
e61d5fa
Change the readonly state management to utilize atomic operations for thread safety. Update relevant tests to reflect this change, ensuring that the server correctly checks the readonly state using Load() instead of a direct boolean assignment. This improves the reliability of readonly mode enforcement across repository management operations.
@codecov

codecov Bot commented May 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.59%. Comparing base (ec38d52) to head (e61d5fa).
⚠️ Report is 91 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3823      +/-   ##
==========================================
+ Coverage   53.44%   53.59%   +0.15%     
==========================================
  Files         200      201       +1     
  Lines       23450    23519      +69     
==========================================
+ Hits        12533    12606      +73     
+ Misses       9662     9659       -3     
+ Partials     1255     1254       -1     
Flag Coverage Δ
e2e 33.61% <0.00%> (-0.11%) ⬇️
e2e go 29.55% <0.00%> (-0.11%) ⬇️
e2e node 25.87% <0.00%> (-0.09%) ⬇️
e2e python 29.88% <0.00%> (-0.11%) ⬇️
e2e quarkus 25.97% <0.00%> (-0.10%) ⬇️
e2e rust 25.44% <0.00%> (-0.10%) ⬇️
e2e springboot 24.11% <0.00%> (-0.09%) ⬇️
e2e typescript 25.96% <0.00%> (-0.10%) ⬇️
e2e-config-ci 26.68% <0.00%> (-0.10%) ⬇️
integration 15.72% <0.00%> (-0.05%) ⬇️
unit macos-14 42.42% <100.00%> (+0.19%) ⬆️
unit macos-latest 42.42% <100.00%> (+0.19%) ⬆️
unit ubuntu-24.04-arm 42.69% <100.00%> (+0.16%) ⬆️
unit ubuntu-latest 43.28% <100.00%> (+0.18%) ⬆️
unit windows-latest 42.49% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lkingland lkingland added the status/new label Jun 2, 2026
@lkingland lkingland added this to Functions Traige Jun 2, 2026
@lkingland lkingland moved this to New in Functions Traige Jun 2, 2026
@lkingland lkingland removed the status/new label Jul 29, 2026
@lkingland

lkingland commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

/approve
/lgtm

🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot assigned lkingland Aug 10, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Aug 10, 2026
@lkingland lkingland added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Aug 10, 2026
@knative-prow

knative-prow Bot commented Aug 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitsinghsisodya, lkingland

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [lkingland]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow-robot knative-prow-robot added the needs-rebase Cannot be merged due to conflicts with HEAD. label Aug 10, 2026
@Ankitsinghsisodya
merge: resolve conflicts with main
73b9ac4
@knative-prow knative-prow Bot removed the lgtm 🤖 PR is ready to be merged. label Aug 10, 2026
@Ankitsinghsisodya
Merge remote-tracking branch 'upstream/main' into feat/mcp-repository…
c196f8d
…-tools

Co-authored-by: Cursor <[email protected]>

# Conflicts:
#	pkg/mcp/mcp.go
@knative-prow-robot knative-prow-robot removed the needs-rebase Cannot be merged due to conflicts with HEAD. label Aug 10, 2026
@Ankitsinghsisodya

Ankitsinghsisodya commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@lkingland, I have resolved the merge conflicts, which caused the lgtm label to be removed automatically. Could you please review the updates and re-approve when you have a moment?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Ankitsinghsisodya and others added 2 commits August 10, 2026 21:05
@Ankitsinghsisodya @cursoragent
chore: retrigger CI
f56c8dc
Co-authored-by: Cursor <[email protected]>
@Ankitsinghsisodya
chore: retrigger CI
74f85c7
@Ankitsinghsisodya
Ankitsinghsisodya force-pushed the feat/mcp-repository-tools branch from f564305 to 74f85c7 Compare August 10, 2026 19:27
@lkingland

lkingland commented Aug 17, 2026

Copy link
Copy Markdown
Member

/lgtm

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Aug 17, 2026
@knative-prow
knative-prow Bot merged commit 4c88902 into knative:main Aug 17, 2026
43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from New to Done in Functions Traige Aug 17, 2026
@satyambitm satyambitm mentioned this pull request Nov 9, 2026
docs(mcp): sync agent instructions and integration docs with the tool set #4146
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@dsimansk dsimansk Awaiting requested review from dsimansk
@jrangelramos jrangelramos Awaiting requested review from jrangelramos

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lkingland lkingland

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/enhancement Feature additions or improvements to existing lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

Functions Traige
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Ankitsinghsisodya @lkingland @knative-prow-robot
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.