You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deliver a bidirectional integration between Backstage and ContextForge that positions ContextForge as the MCP federation, A2A agent gateway, and governance layer behind Backstage's developer portal experience. This includes a Backstage backend plugin, a frontend plugin, a catalog entity provider, and ContextForge-side API extensions — enabling developers to discover, manage, invoke, and govern MCP tools, A2A agents, and federated services directly from their Backstage portal.
Why Now?
The Internal Developer Platform (IDP) space and the AI tooling ecosystem are converging rapidly, but the integration seam between them remains underserved:
Backstage Has MCP — But No Registry: Backstage shipped @backstage/plugin-mcp-actions-backend in v1.40 (mid-2025), exposing Backstage actions as MCP tools. However, the community MCP Registry proposal (backstage/community-plugins #4034) remains open and stalled. There is no built-in way to discover, register, or govern MCP servers at scale within Backstage.
Backstage Has No A2A Support: There is zero A2A protocol integration in Backstage — no plugins, no proposals, no community efforts. As agentic AI adoption accelerates, this becomes a significant gap. ContextForge already supports A2A agent registration, invocation, team scoping, and metrics.
Federation Gap: Organisations deploying multiple MCP servers across teams need a federation layer that aggregates, governs, and exposes them through a single endpoint. Backstage alone cannot federate upstream MCP servers — ContextForge can.
Governance and Multi-Tenancy: Backstage's permission framework handles UI-level access control. ContextForge adds wire-level governance: RBAC, team-scoped visibility, rate limiting, plugin-based policy enforcement, and audit logging for every tool invocation. Together they cover the full stack.
Market Positioning: Spotify Portal (commercial Backstage) already registers MCP servers as catalog API entities. Red Hat Developer Hub has shipped MCP integration. An open-source ContextForge integration fills this space for the broader Backstage community — and does more by adding A2A, federation, and policy enforcement.
Developer Experience: Engineers should not need to leave their portal to manage AI tools, agents, and service integrations. Surfacing ContextForge capabilities inside Backstage reduces context-switching and makes governed AI tooling a first-class part of the developer workflow.
📖 User Stories
US-1: Platform Engineer — Register ContextForge as a Backstage Integration
As a Platform Engineer I want to connect my Backstage instance to a ContextForge gateway So that all federated MCP tools, A2A agents, and resources appear in our developer portal
Acceptance Criteria:
Given the ContextForge Backstage backend plugin is installed
When I configure app-config.yaml:
contextforge:
baseUrl: https://contextforge.internal.example.com
auth:
method: bearer
token: ${CONTEXTFORGE_TOKEN}
sync:
intervalSeconds: 300
entityKinds:
- tools
- resources
- prompts
- servers
- a2a-agents
- gateways
Then the plugin should:
- Connect to the ContextForge API on startup
- Authenticate using the configured method
- Begin periodic sync of entities into the Backstage catalog
- Expose ContextForge health status on the plugin's health endpoint
- Log sync results with entity counts and any errors
Technical Requirements:
Backstage backend plugin using createBackendPlugin() (New Backend System)
Support bearer, basic, and OAuth authentication to ContextForge
Configurable sync interval with jitter to prevent thundering herd
Health check endpoint for monitoring
Graceful degradation if ContextForge is unreachable
US-2: Developer — Discover MCP Tools in the Backstage Catalog
As a Developer I want to browse all available MCP tools from ContextForge in the Backstage software catalog So that I can find and understand AI tools available to my team without leaving the portal
Acceptance Criteria:
Given ContextForge has 50 federated tools across 5 upstream gateways
When the catalog entity provider syncs
Then each tool should appear as a Backstage catalog entity:
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: contextforge-tool-customer-lookup
description: "Look up customer details by ID"
annotations:
contextforge.io/tool-id: "abc-123"
contextforge.io/gateway-id: "gateway-456"
contextforge.io/gateway-name: "crm-service"
contextforge.io/transport: "STREAMABLEHTTP"
contextforge.io/visibility: "team"
contextforge.io/team-id: "engineering"
tags:
- mcp-tool
- contextforge
- crm
links:
- url: https://contextforge.internal/tools/abc-123
title: "View in ContextForge"
spec:
type: mcp-tool
lifecycle: production
owner: group:engineering
system: contextforge-crm-gateway
definition:
$text: |
name: customer-lookup
description: Look up customer details by ID
inputSchema:
type: object
properties:
customer_id:
type: string
description: The customer identifier
required:
- customer_id
And tools should be searchable by name, tag, gateway, and team
And team-scoped tools should respect Backstage group membership
Map ContextForge tools → kind: API with spec.type: mcp-tool
Map ContextForge resources → kind: API with spec.type: mcp-resource
Map ContextForge prompts → kind: API with spec.type: mcp-prompt
Map ContextForge servers → kind: Component with spec.type: mcp-server
Map ContextForge gateways → kind: Component with spec.type: mcp-gateway
Map ContextForge A2A agents → kind: Component with spec.type: a2a-agent
Preserve ContextForge team scoping via Backstage group ownership
Include input schemas in API definitions for documentation rendering
Incremental sync (delta updates) to avoid catalog churn
US-3: Developer — Invoke MCP Tools from Backstage
As a Developer I want to invoke an MCP tool directly from its Backstage catalog page So that I can test and use tools without switching to a separate UI or CLI
Acceptance Criteria:
Given I am viewing an MCP tool entity in the Backstage catalog
And the tool has an input schema with required parameters
When I click "Invoke Tool" on the entity page
Then I should see:
- A form generated from the tool's input schema
- Pre-populated defaults where available
- A "Run" button to execute the tool
When I submit the form
Then the backend plugin should:
- Forward the invocation to ContextForge: POST /tools/{tool_id}/invoke
- Pass my Backstage identity for ContextForge RBAC evaluation
- Display the tool result in a formatted output panel
- Show execution time, status, and any errors
- Log the invocation in ContextForge's audit trail
Technical Requirements:
Frontend card component for tool invocation on API entity pages
JSON Schema form renderer for tool input schemas
Backend proxy route to ContextForge tool invocation endpoint
Identity forwarding: map Backstage user → ContextForge JWT claims
Result rendering with syntax highlighting for JSON/text/markdown
Error handling with user-friendly messages
Rate limiting awareness (show 429 status clearly)
US-4: Developer — Interact with A2A Agents from Backstage
As a Developer I want to discover and invoke A2A agents registered in ContextForge from Backstage So that I can interact with AI agents without managing direct API integrations
Acceptance Criteria:
Given ContextForge has 3 A2A agents registered:
- "code-review-agent" (anthropic, team: engineering)
- "test-generator-agent" (openai, team: engineering)
- "docs-agent" (custom, team: documentation)
When I navigate to the A2A Agents section in Backstage
Then I should see agents available to my team
And each agent card should show:
- Agent name, type, and description
- Capabilities and supported models
- Team ownership and visibility
- Health status and response time metrics
- Last invocation timestamp
When I click "Chat" on an agent
Then I should see a conversational interface
And messages should be proxied through ContextForge: POST /a2a-agents/{id}/invoke
And the conversation should respect ContextForge RBAC and rate limits
Technical Requirements:
A2A agent entities in catalog (kind: Component, spec.type: a2a-agent)
Frontend page: /contextforge/agents with agent cards
Conversational UI component for agent interaction
Backend proxy to ContextForge A2A invocation API
Streaming response support (SSE) for long-running agent tasks
US-5: Platform Engineer — Manage ContextForge Gateways from Backstage
As a Platform Engineer I want to view and manage ContextForge's federated gateways from Backstage So that I can monitor upstream MCP server health and manage federation from the portal
Acceptance Criteria:
Given ContextForge has 8 upstream gateways registered
When I navigate to the ContextForge Gateways page in Backstage
Then I should see each gateway with:
- Name, URL, and transport type (SSE, STREAMABLEHTTP, STDIO)
- Health status (healthy, unhealthy, disabled)
- Last refresh timestamp
- Count of tools, resources, and prompts provided
- Team ownership and visibility scope
When I click on a gateway
Then I should see:
- Detailed gateway configuration
- List of tools/resources/prompts it provides
- Health check history
- Dependency graph showing which virtual servers use this gateway
When I click "Refresh"Then the plugin should call POST /gateways/{id}/refresh
And update the catalog entities with any new or removed capabilities
Technical Requirements:
Gateway management page: /contextforge/gateways
Real-time health status via polling or SSE
Gateway → tool/resource dependency visualization
Refresh capability with progress indication
Gateway registration form (for platform engineers with admin RBAC)
US-6: Platform Engineer — Sync Backstage Groups with ContextForge Teams
As a Platform Engineer I want Backstage groups to sync with ContextForge teams So that team-scoped visibility in ContextForge aligns with our organisational structure in Backstage
Acceptance Criteria:
Given Backstage has groups:
- group:engineering (members: alice, bob)
- group:security (members: carol)
- group:platform (members: dave)
And ContextForge has teams:
- engineering (members: alice@corp.com, bob@corp.com)
- security (members: carol@corp.com)When team sync runs
Then ContextForge teams should match Backstage groups
And team-scoped tools visible to "engineering" in ContextForge
should appear owned by "group:engineering" in Backstage
And a developer in group:engineering should see engineering-scoped
tools but not security-scoped tools in their catalog view
Technical Requirements:
Configurable group → team mapping (name-based or explicit mapping)
Sync direction: Backstage → ContextForge (Backstage as source of truth for org structure)
Member email resolution from Backstage user entities
Conflict resolution strategy for mismatched memberships
Dry-run mode for validating sync before applying
US-7: AI Assistant — Use ContextForge Tools via Backstage MCP Endpoint
As an AI Assistant (Claude, Cursor, ChatGPT) connected to Backstage's MCP endpoint I want to discover and invoke ContextForge's federated tools through Backstage So that I can access the full tool ecosystem without direct ContextForge connectivity
Acceptance Criteria:
Given Backstage's MCP Actions backend is running at /api/mcp-actions/v1
And the ContextForge plugin registers federated tools as Backstage actions
When an MCP client connects to Backstage's MCP endpoint
And calls tools/list
Then the response should include ContextForge tools alongside native Backstage actions
And each tool should have:
- Correct name and description from ContextForge
- Input schema matching the original tool definition
- Annotations indicating ContextForge origin
When the MCP client calls tools/call for a ContextForge tool
Then Backstage should proxy the call to ContextForge
And return the result to the MCP client
And ContextForge's plugin chain (PII filter, rate limiter, etc.) should execute
Technical Requirements:
Register ContextForge tools as Backstage Actions via ActionsRegistryService
Map ContextForge tool schemas to Backstage Action schemas (Zod)
Proxy tool invocations through ContextForge's /tools/{id}/invoke endpoint
Handle tool pagination (ContextForge may have hundreds of tools)
Respect team scoping: only register actions visible to the requesting user
US-8: Security Engineer — Audit ContextForge Activity from Backstage
As a Security Engineer I want to view ContextForge audit logs and access metrics from within Backstage So that I can monitor AI tool usage and governance compliance from a single pane
Acceptance Criteria:
Given ContextForge has observability and audit logging enabled
When I navigate to the ContextForge Observability page in Backstage
Then I should see:
- Tool invocation counts by team, user, and tool
- A2A agent usage metrics
- Plugin violation summary (blocked requests, policy hits)
- Gateway health overview
- Recent audit log entries with filtering
And I should be able to filter by:
- Time range
- Team / user
- Tool / agent
- Decision (allow / deny / violation)
sequenceDiagram
participant Scheduler as Backstage Scheduler
participant Provider as Catalog Entity Provider
participant CF as ContextForge API
participant Catalog as Backstage Catalog
Scheduler->>Provider: Trigger sync (every N seconds)
Provider->>CF: GET /tools?visibility=public,team
CF-->>Provider: Tool list (paginated)
Provider->>CF: GET /a2a-agents?visibility=public,team
CF-->>Provider: Agent list (paginated)
Provider->>CF: GET /gateways
CF-->>Provider: Gateway list
Provider->>CF: GET /servers
CF-->>Provider: Virtual server list
Provider->>Provider: Transform CF entities → Backstage entities
Provider->>Provider: Compute delta (added, updated, removed)
Provider->>Catalog: Apply delta mutations
Catalog-->>Provider: Mutation result
Provider->>Provider: Log sync summary
Note over Provider,Catalog: Next sync in N seconds...
Loading
Tool Invocation Flow
sequenceDiagram
participant Dev as Developer
participant BS_FE as Backstage Frontend
participant BS_BE as Backstage Backend Plugin
participant CF as ContextForge API
participant Plugins as CF Plugin Chain
participant GW as CF Gateway Service
participant Upstream as Upstream MCP Server
Dev->>BS_FE: Click "Invoke Tool" on catalog page
BS_FE->>BS_FE: Render form from input schema
Dev->>BS_FE: Fill parameters and submit
BS_FE->>BS_BE: POST /api/contextforge/tools/{id}/invoke
Note over BS_FE,BS_BE: Backstage auth token included
BS_BE->>BS_BE: Map Backstage identity → CF JWT claims
BS_BE->>CF: POST /tools/{id}/invoke (CF bearer token)
CF->>Plugins: tool_pre_invoke hooks
Note over Plugins: RBAC check, rate limit,<br/>PII filter, clearance check
alt Plugin violation
Plugins-->>CF: Blocked (violation)
CF-->>BS_BE: 403 / 429 with violation details
BS_BE-->>BS_FE: Error with user-friendly message
BS_FE-->>Dev: Display error
else Allowed
Plugins-->>CF: Continue
CF->>GW: Route to source gateway
GW->>Upstream: Forward invocation
Upstream-->>GW: Tool result
GW-->>CF: Result
CF->>Plugins: tool_post_invoke hooks
Plugins-->>CF: Result (possibly modified)
CF-->>BS_BE: Tool result
BS_BE-->>BS_FE: Formatted result
BS_FE-->>Dev: Display output
end
// packages/backend/src/index.tsimport{createBackend}from'@backstage/backend-defaults';constbackend=createBackend();// ... other plugins ...// ContextForge integrationbackend.add(import('@contextforge/backstage-plugin-backend'));backend.add(import('@contextforge/backstage-plugin-catalog-module'));backend.start();
Frontend Registration
// packages/app/src/App.tsximport{contextforgePlugin,ContextForgePage}from'@contextforge/backstage-plugin';// In routes:<Routepath="/contextforge"element={<ContextForgePage/>}/>// Entity page cards (in EntityPage.tsx):import{
ContextForgeToolInvocationCard,
ContextForgeAgentCard,
ContextForgeGatewayHealthCard,}from'@contextforge/backstage-plugin';// On API entity pages (for mcp-tool type):<EntitySwitch.Caseif={isContextForgeTool}><ContextForgeToolInvocationCard/></EntitySwitch.Case>
✅ Success Criteria
Catalog Sync: ContextForge tools, resources, prompts, servers, gateways, and A2A agents appear in Backstage catalog within configured sync interval
Entity Mapping: All 6 entity types correctly mapped with annotations, tags, ownership, and relations
Tool Invocation: Developers can invoke MCP tools from Backstage entity pages with schema-driven forms and formatted results
A2A Agents: Developers can discover and interact with A2A agents via conversational interface in Backstage
MCP Bridge: AI assistants connected to Backstage's MCP endpoint can discover and invoke ContextForge tools
Gateway Management: Platform engineers can view gateway health, refresh capabilities, and register new gateways
Team Scoping: ContextForge team visibility is respected through Backstage group ownership mapping
RBAC: Backstage permissions correctly gate access to ContextForge operations
Observability: Audit logs, metrics, and plugin violation data visible from Backstage dashboard
Performance: Sync <30s for 500 entities; invocation overhead <100ms
Testing: Unit, integration, and compatibility tests pass across supported Backstage versions
Documentation: Installation guide, user guide, administrator guide, and ADR complete
🏁 Definition of Done
Three npm packages published: @contextforge/backstage-plugin, @contextforge/backstage-plugin-backend, @contextforge/backstage-plugin-catalog-module
Catalog entity provider syncs all 6 entity types with delta detection
Unit tests for backend and frontend with >80% coverage
Integration tests for full sync cycle, tool invocation, and MCP client compatibility
Tested against Backstage v1.40+ and current ContextForge release
Installation, user, and administrator documentation complete
Architecture Decision Record documented
Code passes lint, format, and type checks for all packages
Security review completed (no credential leakage, input validation, CORS)
Published to npm with Backstage compatibility badges
📝 Additional Notes
🔹 Backstage MCP Ecosystem Context:
Backstage v1.40+ ships @backstage/plugin-mcp-actions-backend — exposes Backstage actions as MCP tools via Streamable HTTP/SSE
Spotify Portal (commercial) registers MCP servers as kind: API with spec.type: mcp-server
Community MCP Registry proposal (#4034) is open but inactive
Red Hat Developer Hub has shipped basic MCP integration
No A2A protocol support exists anywhere in the Backstage ecosystem
🔹 Why Not Just Use Backstage's Built-In MCP Plugin?:
Backstage's MCP plugin exposes Backstage actions as tools — it does not federate external MCP servers
It has no concept of upstream gateways, multi-transport proxying, or tool governance
It cannot discover or aggregate tools from multiple MCP server instances
It has no plugin chain (PII filtering, rate limiting, content moderation) for tool invocations
It has no A2A agent support
ContextForge fills these gaps while Backstage provides the developer portal experience
🔹 Entity Mapping Rationale:
Tools, resources, and prompts map to kind: API because they are interfaces that components consume — consistent with Backstage's system model where APIs are "boundaries between components"
Servers, gateways, and A2A agents map to kind: Component because they are running software that provides APIs
Backstage Search Integration: Index ContextForge tools and agents in Backstage's federated search
Event-Driven Architecture: Replace polling with CloudEvents for sub-second sync
Multi-Instance Support: Connect multiple ContextForge gateways from a single Backstage instance
ContextForge Plugin for Backstage Catalog: A ContextForge plugin that reads Backstage catalog and auto-registers Backstage components as ContextForge resources
🔌 Epic: Backstage Integration - MCP/A2A federation, catalog sync, and developer portal experience
Goal
Deliver a bidirectional integration between Backstage and ContextForge that positions ContextForge as the MCP federation, A2A agent gateway, and governance layer behind Backstage's developer portal experience. This includes a Backstage backend plugin, a frontend plugin, a catalog entity provider, and ContextForge-side API extensions — enabling developers to discover, manage, invoke, and govern MCP tools, A2A agents, and federated services directly from their Backstage portal.
Why Now?
The Internal Developer Platform (IDP) space and the AI tooling ecosystem are converging rapidly, but the integration seam between them remains underserved:
Backstage Has MCP — But No Registry: Backstage shipped
@backstage/plugin-mcp-actions-backendin v1.40 (mid-2025), exposing Backstage actions as MCP tools. However, the community MCP Registry proposal (backstage/community-plugins #4034) remains open and stalled. There is no built-in way to discover, register, or govern MCP servers at scale within Backstage.Backstage Has No A2A Support: There is zero A2A protocol integration in Backstage — no plugins, no proposals, no community efforts. As agentic AI adoption accelerates, this becomes a significant gap. ContextForge already supports A2A agent registration, invocation, team scoping, and metrics.
Federation Gap: Organisations deploying multiple MCP servers across teams need a federation layer that aggregates, governs, and exposes them through a single endpoint. Backstage alone cannot federate upstream MCP servers — ContextForge can.
Governance and Multi-Tenancy: Backstage's permission framework handles UI-level access control. ContextForge adds wire-level governance: RBAC, team-scoped visibility, rate limiting, plugin-based policy enforcement, and audit logging for every tool invocation. Together they cover the full stack.
Market Positioning: Spotify Portal (commercial Backstage) already registers MCP servers as catalog API entities. Red Hat Developer Hub has shipped MCP integration. An open-source ContextForge integration fills this space for the broader Backstage community — and does more by adding A2A, federation, and policy enforcement.
Developer Experience: Engineers should not need to leave their portal to manage AI tools, agents, and service integrations. Surfacing ContextForge capabilities inside Backstage reduces context-switching and makes governed AI tooling a first-class part of the developer workflow.
📖 User Stories
US-1: Platform Engineer — Register ContextForge as a Backstage Integration
As a Platform Engineer
I want to connect my Backstage instance to a ContextForge gateway
So that all federated MCP tools, A2A agents, and resources appear in our developer portal
Acceptance Criteria:
Technical Requirements:
createBackendPlugin()(New Backend System)US-2: Developer — Discover MCP Tools in the Backstage Catalog
As a Developer
I want to browse all available MCP tools from ContextForge in the Backstage software catalog
So that I can find and understand AI tools available to my team without leaving the portal
Acceptance Criteria:
Technical Requirements:
EntityProviderinterfacekind: APIwithspec.type: mcp-toolkind: APIwithspec.type: mcp-resourcekind: APIwithspec.type: mcp-promptkind: Componentwithspec.type: mcp-serverkind: Componentwithspec.type: mcp-gatewaykind: Componentwithspec.type: a2a-agentUS-3: Developer — Invoke MCP Tools from Backstage
As a Developer
I want to invoke an MCP tool directly from its Backstage catalog page
So that I can test and use tools without switching to a separate UI or CLI
Acceptance Criteria:
Technical Requirements:
US-4: Developer — Interact with A2A Agents from Backstage
As a Developer
I want to discover and invoke A2A agents registered in ContextForge from Backstage
So that I can interact with AI agents without managing direct API integrations
Acceptance Criteria:
Technical Requirements:
kind: Component,spec.type: a2a-agent)/contextforge/agentswith agent cardsUS-5: Platform Engineer — Manage ContextForge Gateways from Backstage
As a Platform Engineer
I want to view and manage ContextForge's federated gateways from Backstage
So that I can monitor upstream MCP server health and manage federation from the portal
Acceptance Criteria:
Technical Requirements:
/contextforge/gatewaysUS-6: Platform Engineer — Sync Backstage Groups with ContextForge Teams
As a Platform Engineer
I want Backstage groups to sync with ContextForge teams
So that team-scoped visibility in ContextForge aligns with our organisational structure in Backstage
Acceptance Criteria:
Technical Requirements:
US-7: AI Assistant — Use ContextForge Tools via Backstage MCP Endpoint
As an AI Assistant (Claude, Cursor, ChatGPT) connected to Backstage's MCP endpoint
I want to discover and invoke ContextForge's federated tools through Backstage
So that I can access the full tool ecosystem without direct ContextForge connectivity
Acceptance Criteria:
Technical Requirements:
ActionsRegistryService/tools/{id}/invokeendpointUS-8: Security Engineer — Audit ContextForge Activity from Backstage
As a Security Engineer
I want to view ContextForge audit logs and access metrics from within Backstage
So that I can monitor AI tool usage and governance compliance from a single pane
Acceptance Criteria:
Technical Requirements:
/contextforge/observability🏗 Architecture
Integration Overview
graph TB subgraph "Developer Experience" IDE[IDE / AI Assistant] BS_UI[Backstage Frontend] end subgraph "Backstage" BS_FE[Frontend Plugin<br/>@contextforge/backstage-plugin] BS_BE[Backend Plugin<br/>@contextforge/backstage-plugin-backend] BS_CAT[Catalog Entity Provider<br/>@contextforge/backstage-plugin-catalog-module] BS_ACT[MCP Actions Bridge<br/>registers CF tools as actions] BS_MCP[MCP Actions Backend<br/>@backstage/plugin-mcp-actions-backend] CATALOG[(Backstage Catalog)] end subgraph "ContextForge" CF_API[ContextForge API<br/>REST + MCP + A2A] CF_PLUG[Plugin Chain<br/>PII, Rate Limit, RBAC] CF_FED[Federation Layer] CF_REG[(Service Registry<br/>Tools, Resources,<br/>Prompts, Agents)] end subgraph "Upstream Services" MCP1[MCP Server 1<br/>SSE] MCP2[MCP Server 2<br/>Streamable HTTP] A2A1[A2A Agent<br/>Claude] A2A2[A2A Agent<br/>Custom] REST1[REST API<br/>via Reverse Proxy] end IDE -->|MCP Protocol| BS_MCP BS_UI --> BS_FE BS_FE -->|REST| BS_BE BS_BE -->|REST| CF_API BS_CAT -->|Periodic Sync| CF_API BS_ACT -->|Register Actions| BS_MCP BS_CAT -->|Write Entities| CATALOG BS_MCP -->|tools/call| BS_ACT BS_ACT -->|Proxy Invoke| CF_API CF_API --> CF_PLUG CF_PLUG --> CF_FED CF_FED --> CF_REG CF_FED --> MCP1 CF_FED --> MCP2 CF_API --> A2A1 CF_API --> A2A2 CF_API --> REST1Entity Mapping
graph LR subgraph "ContextForge Entities" CF_T[Tool] CF_R[Resource] CF_P[Prompt] CF_S[Virtual Server] CF_G[Gateway] CF_A[A2A Agent] CF_TM[Team] end subgraph "Backstage Catalog Entities" BS_API_T["kind: API<br/>spec.type: mcp-tool"] BS_API_R["kind: API<br/>spec.type: mcp-resource"] BS_API_P["kind: API<br/>spec.type: mcp-prompt"] BS_COMP_S["kind: Component<br/>spec.type: mcp-server"] BS_COMP_G["kind: Component<br/>spec.type: mcp-gateway"] BS_COMP_A["kind: Component<br/>spec.type: a2a-agent"] BS_GRP["kind: Group"] end CF_T --> BS_API_T CF_R --> BS_API_R CF_P --> BS_API_P CF_S --> BS_COMP_S CF_G --> BS_COMP_G CF_A --> BS_COMP_A CF_TM --> BS_GRPSync Flow
sequenceDiagram participant Scheduler as Backstage Scheduler participant Provider as Catalog Entity Provider participant CF as ContextForge API participant Catalog as Backstage Catalog Scheduler->>Provider: Trigger sync (every N seconds) Provider->>CF: GET /tools?visibility=public,team CF-->>Provider: Tool list (paginated) Provider->>CF: GET /a2a-agents?visibility=public,team CF-->>Provider: Agent list (paginated) Provider->>CF: GET /gateways CF-->>Provider: Gateway list Provider->>CF: GET /servers CF-->>Provider: Virtual server list Provider->>Provider: Transform CF entities → Backstage entities Provider->>Provider: Compute delta (added, updated, removed) Provider->>Catalog: Apply delta mutations Catalog-->>Provider: Mutation result Provider->>Provider: Log sync summary Note over Provider,Catalog: Next sync in N seconds...Tool Invocation Flow
sequenceDiagram participant Dev as Developer participant BS_FE as Backstage Frontend participant BS_BE as Backstage Backend Plugin participant CF as ContextForge API participant Plugins as CF Plugin Chain participant GW as CF Gateway Service participant Upstream as Upstream MCP Server Dev->>BS_FE: Click "Invoke Tool" on catalog page BS_FE->>BS_FE: Render form from input schema Dev->>BS_FE: Fill parameters and submit BS_FE->>BS_BE: POST /api/contextforge/tools/{id}/invoke Note over BS_FE,BS_BE: Backstage auth token included BS_BE->>BS_BE: Map Backstage identity → CF JWT claims BS_BE->>CF: POST /tools/{id}/invoke (CF bearer token) CF->>Plugins: tool_pre_invoke hooks Note over Plugins: RBAC check, rate limit,<br/>PII filter, clearance check alt Plugin violation Plugins-->>CF: Blocked (violation) CF-->>BS_BE: 403 / 429 with violation details BS_BE-->>BS_FE: Error with user-friendly message BS_FE-->>Dev: Display error else Allowed Plugins-->>CF: Continue CF->>GW: Route to source gateway GW->>Upstream: Forward invocation Upstream-->>GW: Tool result GW-->>CF: Result CF->>Plugins: tool_post_invoke hooks Plugins-->>CF: Result (possibly modified) CF-->>BS_BE: Tool result BS_BE-->>BS_FE: Formatted result BS_FE-->>Dev: Display output end📋 Implementation Tasks
Phase 1: Backstage Backend Plugin — Core
Project Scaffolding
@contextforge/backstage-plugin-backendpackagecreateBackendPlugin()with core services (Config, Logger, Database, HTTP Router, Discovery, Auth)app-config.yaml(contextforge.baseUrl,contextforge.auth,contextforge.sync)ContextForge API Client
listTools(),listResources(),listPrompts(),listServers(),listGateways(),listA2AAgents()invokeTool(),invokeAgent(),refreshGateway()getMetrics(),searchAuditLogs()Backend API Routes
GET /api/contextforge/health— Connection and sync statusGET /api/contextforge/tools— Proxied tool listingPOST /api/contextforge/tools/:id/invoke— Proxied tool invocationGET /api/contextforge/agents— Proxied A2A agent listingPOST /api/contextforge/agents/:id/invoke— Proxied agent invocationGET /api/contextforge/gateways— Proxied gateway listingPOST /api/contextforge/gateways/:id/refresh— Proxied gateway refreshGET /api/contextforge/metrics— Proxied metrics/observabilityGET /api/contextforge/audit— Proxied audit log searchPhase 2: Catalog Entity Provider
Entity Provider Implementation
EntityProviderinterface for Backstage catalogkind: API, spec.type: mcp-toolkind: API, spec.type: mcp-resourcekind: API, spec.type: mcp-promptkind: Component, spec.type: mcp-serverkind: Component, spec.type: mcp-gatewaykind: Component, spec.type: a2a-agentprovidesApi/dependsOnrelations between servers and their toolsownedByrelations to Backstage groups based on ContextForge team IDsCatalog Backend Module
@contextforge/backstage-plugin-catalog-modulepackagecreateBackendModule()Team → Group Mapping
app-config.yamlPhase 3: MCP Actions Bridge
Action Registration
ActionsRegistryServicecontextforge:tool:<tool-name>Action Execution
/tools/{id}/invokeMCP Client Compatibility
tools/listfor MCP clients connecting to Backstagetools/callcorrectly proxies through ContextForgePhase 4: Backstage Frontend Plugin
Plugin Scaffolding
@contextforge/backstage-pluginfrontend package/contextforge,/contextforge/agents,/contextforge/gateways,/contextforge/observabilityTool Invocation Card
spec.type: mcp-toolentitiesA2A Agent Page
Gateway Management Page
Observability Dashboard
Entity Page Enhancements
mcp-toolentities: invocation card, metrics card, gateway info cardmcp-gatewayentities: health card, provided tools list, refresh buttona2a-agententities: chat card, metrics card, capabilities cardmcp-serverentities: associated tools/resources list, status cardPhase 5: Identity and RBAC Bridge
Identity Mapping
userEntityRefto ContextForge user emailtoken_teamsJWT claimsPermission Integration
contextforge.tool.invoke,contextforge.agent.invoke,contextforge.gateway.manage,contextforge.audit.view@backstage/plugin-permission-backend)Team Sync Service
Phase 6: ContextForge-Side Extensions
Backstage Webhook Notifications
POST /webhooksfor registering notification targetsCatalog Metadata Endpoint
GET /catalog/backstagereturning pre-formatted Backstage entity descriptorsIf-Modified-Sincefor efficient delta syncIdentity Federation Endpoint
POST /auth/backstage/token-exchangePhase 7: Testing
Backend Plugin Unit Tests
Frontend Plugin Tests
Integration Tests
Compatibility Tests
Phase 8: Documentation
Installation Guide
yarn add)packages/backend/src/index.tspackages/app/src/App.tsxapp-config.yamlconfiguration referenceUser Guide
Administrator Guide
Architecture Decision Record
APIvsComponent)Phase 9: Quality and Polish
Code Quality
lintandtestpassanytypes in TypeScriptPerformance
Security Review
Packaging and Release
@contextforge/backstage-plugin,@contextforge/backstage-plugin-backend,@contextforge/backstage-plugin-catalog-module⚙️ Configuration Example
app-config.yaml
Backend Registration
Frontend Registration
✅ Success Criteria
🏁 Definition of Done
@contextforge/backstage-plugin,@contextforge/backstage-plugin-backend,@contextforge/backstage-plugin-catalog-module📝 Additional Notes
🔹 Backstage MCP Ecosystem Context:
@backstage/plugin-mcp-actions-backend— exposes Backstage actions as MCP tools via Streamable HTTP/SSEkind: APIwithspec.type: mcp-server🔹 Why Not Just Use Backstage's Built-In MCP Plugin?:
🔹 Entity Mapping Rationale:
kind: APIbecause they are interfaces that components consume — consistent with Backstage's system model where APIs are "boundaries between components"kind: Componentbecause they are running software that provides APIsspec.typeusesmcp-tool,mcp-resource,mcp-prompt,mcp-server,mcp-gateway,a2a-agent— prefixed for namespace clarity🔹 Sync Strategy:
🔹 Security Considerations:
🔹 Future Enhancements:
catalog-info.yamlwith ContextForge annotations from software templates🔗 Related Issues
📚 References
@backstage/plugin-mcp-actions-backend