feat: MCP-client federation surface (v0.12.0)

Picks up the four new HubAdmin RPCs that drive Studio's
MCP-clients editor:

- `listMcpClients()` — config + last-discovery snapshot.
- `refreshMcpClients()` — re-run discovery against the live
  daemon.
- `addMcpClient(name, endpoint, apiKeyEnv?, description?)` —
  persist + refresh in one round-trip.
- `removeMcpClient(name)` — drop persisted entry and live
  synthetic capabilities.

Typedefs for `ListMcpClientsResponse`, `McpClientStatus`,
`McpClientConfigEntry` so callers don't import generated/.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-07 22:39:19 +02:00
parent a893361ff9
commit 776e3c0221
5 changed files with 463 additions and 1 deletions

View file

@ -57,6 +57,9 @@ typedef ClearEventLogResponse = pb.ClearEventLogResponse;
typedef DaemonPathsResponse = pb.DaemonPathsResponse;
typedef UninstallModuleResponse = pb.UninstallModuleResponse;
typedef FetchModuleDocsResponse = pb.FetchModuleDocsResponse;
typedef ListMcpClientsResponse = pb.ListMcpClientsResponse;
typedef McpClientStatus = pb.McpClientStatus;
typedef McpClientConfigEntry = pb.McpClientConfigEntry;
typedef ModuleInfoResponse = pb.ModuleInfoResponse;
typedef FlowSummary = pb.FlowSummary;
typedef StoreEntry = pb.StoreEntry;
@ -236,6 +239,40 @@ class HubClient {
return _admin.fetchModuleDocs(pb.FetchModuleDocsRequest(name: name));
}
/// List every configured MCP server with the last-discovery
/// snapshot. Drives Studio's MCP-clients editor.
Future<ListMcpClientsResponse> listMcpClients() {
return _admin.listMcpClients(Empty());
}
/// Re-run discovery against every configured MCP server and
/// update the running daemon's store-index in place.
Future<ListMcpClientsResponse> refreshMcpClients() {
return _admin.refreshMcpClients(Empty());
}
/// Persist a new MCP server in `~/.fai/config.yaml` and
/// trigger discovery in one round-trip.
Future<ListMcpClientsResponse> addMcpClient({
required String name,
required String endpoint,
String apiKeyEnv = '',
String description = '',
}) {
return _admin.addMcpClient(pb.McpClientConfigEntry(
name: name,
endpoint: endpoint,
apiKeyEnv: apiKeyEnv,
description: description,
));
}
/// Remove an MCP server by name + drop its synthetic
/// capabilities from the running store-index.
Future<ListMcpClientsResponse> removeMcpClient(String name) {
return _admin.removeMcpClient(pb.RemoveMcpClientRequest(name: name));
}
/// Read-only system-AI status. `enabled=false` lets Studio
/// render "configure in Settings" without making a request.
Future<SystemAiStatusResponse> systemAiStatus() {