knative / knative/func

MCP: add invoke tool to test deployed Functions from agent context

Open
#3,727 3 comments 0 reactions 1 assignee View on GitHub

@sneharathod7 is already working on this.

Since May 14, 2026.

Dominant language
Go
Stars
365
Forks
223
Avg merge
2d 3h
Merged PRs (30d)
25

Description

Summary

The MCP server currently does not expose an invoke tool, even though func invoke already exists as a CLI command. After deploying a Function through the MCP workflow, agents have no MCP-native way to verify the deployment by sending a test request.

Related to #3646 (LFX: End-to-End Agentic Workflow).

Current Behavior

  1. Agent deploys a Function using the deploy MCP tool
  2. Agent wants to validate the deployed Function
  3. No invoke MCP tool exists
  4. Validation requires external shell commands or manual HTTP requests outside the MCP workflow

Expected Behavior

An MCP invoke tool should allow agents to:

  • send requests to deployed or locally running Functions
  • support HTTP and CloudEvent invocation formats
  • optionally provide request body and content type
  • return invocation response details

Why This Matters

The current MCP workflow supports create → build → deploy, but there is no MCP-native mechanism for validating the deployed Function afterward.

Adding invoke would help complete the Function lifecycle exposed to agents and improve the end-to-end workflow envisioned in #3646.

Possible Implementation Direction

A new pkg/mcp/tools_invoke.go tool could wrap the existing func invoke command following the same registration and handler patterns already used by tools such as tools_create.go.

The implementation could expose fields such as:

  • path
  • invocation format
  • request body
  • content type
  • target mode (local/remote)

Tool registration and tests could follow the existing MCP tool patterns already used throughout pkg/mcp.

Notes

  • func invoke already exists as a fully implemented CLI command in cmd/invoke.go
  • Invocation is effectively a read-only operation, so it should not require write-enabled MCP mode

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.