MCP: add invoke tool to test deployed Functions from agent context
@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
- Agent deploys a Function using the
deployMCP tool - Agent wants to validate the deployed Function
- No
invokeMCP tool exists - 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 invokealready exists as a fully implemented CLI command incmd/invoke.go- Invocation is effectively a read-only operation, so it should not require write-enabled MCP mode
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.