func icon indicating copy to clipboard operation
func copied to clipboard

feat: func mcp

Open lkingland opened this issue 1 month ago • 5 comments

Updates the POC Functions MCP server to be a slightly more mature experimental MCP server.

Enable with FUNC_ENABLE_MCP and start (by configuring one's client LLM) via func mcp start.

lkingland avatar Oct 29 '25 07:10 lkingland

Codecov Report

:x: Patch coverage is 80.70175% with 77 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 63.87%. Comparing base (3d1ee5e) to head (d77ff89). :warning: Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/mcp/tools_delete.go 50.00% 7 Missing and 5 partials :warning:
pkg/mcp/mcp.go 85.29% 9 Missing and 1 partial :warning:
pkg/mcp/resources_help.go 47.05% 8 Missing and 1 partial :warning:
pkg/mcp/mock/executor.go 0.00% 7 Missing :warning:
pkg/mcp/tools_deploy.go 81.81% 4 Missing and 2 partials :warning:
pkg/mock/mcp_server.go 0.00% 6 Missing :warning:
pkg/mcp/resources_function.go 77.77% 2 Missing and 2 partials :warning:
pkg/mcp/tools_build.go 85.00% 2 Missing and 1 partial :warning:
pkg/mcp/tools_config_envs.go 82.35% 2 Missing and 1 partial :warning:
pkg/mcp/tools_config_labels.go 82.35% 2 Missing and 1 partial :warning:
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
+ Coverage   59.35%   63.87%   +4.52%     
==========================================
  Files         134      150      +16     
  Lines       13519    13210     -309     
==========================================
+ Hits         8024     8438     +414     
+ Misses       4552     3783     -769     
- Partials      943      989      +46     
Flag Coverage Δ
e2e-tests 43.01% <13.47%> (+2.81%) :arrow_up:
integration-tests 58.28% <80.70%> (+5.27%) :arrow_up:
unit-tests 50.15% <80.70%> (+3.43%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Oct 29 '25 08:10 codecov[bot]

I'd group prompts and tools into a package. and if needed, even sub-group the tools.

I'd than do something like https://github.com/containers/kubernetes-mcp-server/blob/main/pkg/toolsets/core/toolset.go#L23 for registering those.

matzew avatar Oct 30 '25 08:10 matzew

I'd group prompts and tools into a package. and if needed, even sub-group the tools.

I'd than do something like https://github.com/containers/kubernetes-mcp-server/blob/main/pkg/toolsets/core/toolset.go#L23 for registering those.

The kubernetes-mcp-server toolset registry pattern is good for that use case (dozens of tools across multiple independent domains like Kubernetes, Helm, and Config), but is a bit overly complex here.

  1. No multiple independent tool domains (we have one cohesive domain: Knative Functions)
  2. No need for a plugin system for third-party tools (all our tools are in-tree)
  3. No need for conditional toolset loading (our 8 tools are always loaded)

For our single-domain, static toolset of only 8 tools, explicit registration in New() is simple, without the indirection of init functions, global registries, etc. Lower cognitive load.

I'd say we follow that pattern if our complexity grows 👍

lkingland avatar Oct 30 '25 11:10 lkingland

Updates the POC Functions MCP server to be a slightly more mature experimental MCP server.

Converting back to draft, so we can make it slightly more... slightly more mature.

lkingland avatar Nov 04 '25 06:11 lkingland

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

knative-prow[bot] avatar Nov 06 '25 10:11 knative-prow[bot]

Left a few more comments.

Looks all good! I have mostly cleanup comments. Can (not must) all be done in a follow PR and would polish the code a bit. But you make the call 😸

Solid suggestions @twoGiants ; I'll add those changes in an update PR.

lkingland avatar Nov 06 '25 13:11 lkingland