Add support for expert access to mcp servers with auth#6549
Conversation
NOTE: service disable tests were moved to end to avoid app reinitialise issue
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6549 +/- ##
==========================================
+ Coverage 76.45% 76.62% +0.17%
==========================================
Files 397 398 +1
Lines 20011 20093 +82
Branches 4812 4836 +24
==========================================
+ Hits 15300 15397 +97
+ Misses 4711 4696 -15
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:
|
|
2 issues unearthed while testing:
No 1 requires some design and thought (and a chat with Nick) |
…th setting changes
Meeting scheduled for Tomorrow to resolve this. It is looking likely basic auth will be excluded at this time. As such, this PR will require a small change to filter out MCP servers that have basic auth enabled in the instance settings (both in the MCP Feature request endpoint and in the chat endpoint) (and tests will need adjusting too) |
Not supporting Basic auth at this time. Instead, to help a user understand (at point of use) that an MCP server is "there" but not "available" we should display them disabled (or display them conditionally via a checkbox or similar) See #6553 which is covers this |
Description
This pull request permits the FF Expert to access instance MCP servers by issuing short-lived tokens that are passed to the AI backend for the MCP client connections to authenticate.
These special-purpose tokens (with the
ff-expert:mcpscope) are not exposed to the user in the UI nor are they modifiable like regular project HTTP token APIsExpert MCP HTTP Token Restrictions:
ff-expert:mcpscope) via the standard project HTTP token API routes, ensuring these tokens can only be managed internally. [1] [2] [3] [4]Expert API MCP Server Feature and Token Management:
Code Quality and Documentation:
Unit tests added:
test/unit/forge/routes/api/expert_spec.jsUnit tests added:
test/unit/forge/ee/routes/httpTokens/index_spec.jsUPDATE:
Handle instance auth change cache invalidation
Additional tests added to
test/unit/forge/routes/api/expert_spec.jsRelated Issue(s)
closes #6546 - implementation
closes #6547 - tests
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel