Skip to content

Migrate web UI to /v1/mcp-servers and /v1/virtual-servers #85

Description

@marekdano

Related: IBM/mcp-context-forge#4956, IBM/mcp-context-forge#6257

Motivation: mcp-context-forge now serves /v1/mcp-servers (alias of /gateways) and /v1/virtual-servers (alias of /servers) with identical behavior - added in IBM/mcp-context-forge#4956 and shipped via IBM/mcp-context-forge#6257. Legacy paths stay supported server-side indefinitely, but the UI should cut over to the product-language paths.

Scope — hand-written call sites to repoint (the app uses hand-written fetch wrappers for these resources, not orval-generated functions, so this is a string-literal swap, not a codegen regen):

MCP Servers → /gateways to /v1/mcp-servers

  • src/api/servers.ts (list, get, update, delete, test — 4+ literal paths)
  • src/hooks/useMCPServerForm.ts (create/update/delete gateway)
  • src/hooks/useMcpServers.ts
  • src/hooks/useMiniCardStatuses.ts
  • src/components/dashboard/McpHealthCard.tsx
  • src/pages/Servers.tsx (placeholder cache key "/gateways/_placeholder_")

Virtual Servers → /servers to /v1/virtual-servers

  • src/api/virtualServers.ts (create, delete, set-state, update)

No BFF changes needed: server/src/routes/proxy/catch-all.ts is a generic /api/* → upstream passthrough (1:1 path forwarding), so the new v1 paths work through the proxy with zero server-side code changes. SSE routes (server/src/routes/sse/routes.ts) don't touch gateways/servers paths at all.

Tests to update:

  • Unit: src/api/servers.test.ts, src/api/virtualServers.test.ts, src/pages/Gateways.test.tsx, src/pages/Servers.test.tsx,
    src/hooks/useMiniCardStatuses.test.tsx, src/components/gateways/utils.test.ts
  • MSW mocks: src/test/mocks/handlers.ts
  • E2E: e2e/servers.spec.ts, e2e/virtual-servers.spec.ts, e2e/utils/paths.ts

Acceptance criteria:

  • Every MCP Server and Virtual Server operation issued by the UI hits /v1/mcp-servers / /v1/virtual-servers
  • grep -rn "['\"\]/gateways|['"`]/servers" src` (excluding the flagged connection-URL case, if kept legacy) returns nothing outside test fixtures
  • Unit + e2e suites green
  • No BFF proxy or SSE route changes required (confirm, don't assume)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions