Skip to content

feat(mcp-capabilities): add MCP Capabilities plugins#9732

Draft
jh-sh wants to merge 6 commits into
backstage:mainfrom
jh-sh:mcp-capabilities
Draft

feat(mcp-capabilities): add MCP Capabilities plugins#9732
jh-sh wants to merge 6 commits into
backstage:mainfrom
jh-sh:mcp-capabilities

Conversation

@jh-sh

@jh-sh jh-sh commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Hey, I just made a Pull Request!

Adds a new workspaces/mcp-capabilities workspace with three plugins that enrich
native MCP server catalog entities (kind: API, spec.type: mcp-server) with
their live capabilities fetch — the tools, resources, and prompts each server
exposes. It builds on the upstream native mcp-server kind rather than
introducing a new kind or a separate page.

On UI part, it extends what is available for the user in terms of mcp-discovery:

MCP Server Info card:

mcp-server-info-card

Tools, Resources, and Prompts tabs:

capabilities-tab-tools capabilities-tab-resources capabilities-tab-prompts

What's inside

  • @backstage-community/plugin-mcp-capabilities-backend — connects to each
    server over the MCP streamable-http transport (JSON-RPC handshake, SSE-aware,
    session handling). A catalog processor writes the discovered summary onto
    the entity (powering the card + search); an on-demand router,
    GET /api/mcp-capabilities/spec?entityRef=…, returns the full live
    tool/resource/prompt detail. Both read spec.remotes off the entity, so the
    server URL lives in one place. Unreachable servers are skipped gracefully.

  • @backstage-community/plugin-mcp-capabilities — frontend for the new
    frontend system
    , built with pure Backstage UI (BUI). Two entity extensions
    (shown only for spec.type: mcp-server): an MCP Server Info overview card
    and a Capabilities tab listing tools (with Markdown descriptions +
    input-schema tables), resources, and prompts.

  • @backstage-community/plugin-mcp-capabilities-common — shared types and a
    catalog model layer that additively extends the native mcp-server schema
    via updateKind (deep-merged), so existing entities stay valid. It adds
    optional spec fields: capabilities, serverInfo, instructions,
    tool/resource/prompt counts, and a flat toolNames list for catalog search.

How it works

Each mcp-server API entity declares its endpoint in spec.remotes. The backend
discovers what the server offers; the model layer makes the summary a valid part
of the entity's schema; the frontend renders both the persisted summary (card)
and the live detail (tab).

Credits

Made at EPAM, with love for the community. ❤️

Notes for reviewers

  • Frontend system: the frontend plugin targets the new frontend system
    only (matching what backstage-cli new scaffolds). Legacy-frontend-system
    support is a planned step. We may go for follow-up PR or upcoming commits within this PR.
  • Tests: cover our own logic — the MCP client handshake/SSE/capability-gating,
    the enrichment processor (merge / graceful-skip / caching), and the docstring
    dedent. The model-layer deep-merge itself is Backstage behaviour and is covered
    by upstream catalog-model tests, so it isn't re-tested here.
  • Known limitation: remotes needing per-request auth (e.g. AWS Bedrock
    AgentCore Gateway / SigV4) are not yet signed — discovery skips them gracefully
    and /spec returns an error for them. Per-remote auth is a planned enhancement.

✔️ Checklist

  • A changeset describing the change and affected packages.
  • Added or updated documentation (workspace + per-plugin READMEs).
  • Tests for new functionality and regression tests for bug fixes.
  • Screenshots attached (for UI changes) — in the
    frontend plugin README
    (docs/): MCP Server Info card + Capabilities tab (tools / resources / prompts).
  • All your commits have a Signed-off-by line in the message.

jh-sh added 3 commits July 2, 2026 16:13
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
@jh-sh jh-sh requested a review from backstage-service as a code owner July 2, 2026 12:50
Copilot AI review requested due to automatic review settings July 2, 2026 12:50
@jh-sh jh-sh requested a review from a team as a code owner July 2, 2026 12:50
@jh-sh jh-sh requested a review from awanlin July 2, 2026 12:50
@backstage-goalie

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-mcp-capabilities-backend workspaces/mcp-capabilities/plugins/mcp-capabilities-backend minor v0.0.0
@backstage-community/plugin-mcp-capabilities-common workspaces/mcp-capabilities/plugins/mcp-capabilities-common minor v0.0.0
@backstage-community/plugin-mcp-capabilities workspaces/mcp-capabilities/plugins/mcp-capabilities minor v0.0.0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new workspaces/mcp-capabilities workspace that adds a three-package plugin suite (frontend, backend, common) to enrich native API / spec.type: mcp-server catalog entities with discovered MCP server capabilities (tools/resources/prompts), exposing both a persisted summary (catalog enrichment) and live details (on-demand backend route + UI tab).

Changes:

  • Added backend support to discover MCP server capabilities via streamable-http (JSON-RPC + SSE-aware parsing), including a catalog processor for entity enrichment and a /api/mcp-capabilities/spec route for live spec retrieval.
  • Added a new-frontend-system UI (pure Backstage UI / BUI) that renders an overview card plus a “Capabilities” entity tab (tools/resources/prompts).
  • Added a shared common package with types + a catalog model layer that additively extends the native mcp-server schema via updateKind.

Reviewed changes

Copilot reviewed 53 out of 58 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
workspaces/mcp-capabilities/tsconfig.json Workspace TypeScript configuration for the new MCP capabilities workspace.
workspaces/mcp-capabilities/README.md Workspace-level documentation describing the suite and how it works.
workspaces/mcp-capabilities/plugins/README.md Standard plugins folder README.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/utils/dedent.ts Frontend utility to dedent docstring-like Markdown safely.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/utils/dedent.test.ts Unit tests for the dedent behavior.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/setupTests.ts Frontend test setup.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/plugin.tsx Frontend plugin registration + entity extensions (card + tab).
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/index.ts Frontend package exports.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/components/SchemaTable.tsx Renders JSON schema properties as a BUI table.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/components/MCPToolsContent.tsx Capabilities entity content tab rendering tools/resources/prompts.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/components/MCPServerOverviewCard.tsx Overview card rendering persisted capability summary from entity spec.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/components/Markdown.tsx Markdown renderer using BUI primitives plus dedent.
workspaces/mcp-capabilities/plugins/mcp-capabilities/src/api.ts Frontend API client for /api/mcp-capabilities/spec.
workspaces/mcp-capabilities/plugins/mcp-capabilities/report.api.md API extractor report for the frontend package.
workspaces/mcp-capabilities/plugins/mcp-capabilities/README.md Frontend package README (installation, screenshots, exports).
workspaces/mcp-capabilities/plugins/mcp-capabilities/package.json Frontend package manifest and dependencies.
workspaces/mcp-capabilities/plugins/mcp-capabilities/dev/index.tsx Frontend dev app entrypoint.
workspaces/mcp-capabilities/plugins/mcp-capabilities/.eslintrc.js Frontend package ESLint config.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/src/types.ts Shared type definitions for MCP tools/resources/prompts/spec/enrichment.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/src/setupTests.ts Common package test setup.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/src/model/mcpServerEnrichmentModelLayer.ts Catalog model layer extending native mcp-server schema via updateKind.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/src/index.ts Common package exports + package documentation header.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/report.api.md API extractor report for the common package.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/README.md Common package README and registration instructions.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/package.json Common package manifest and dependencies.
workspaces/mcp-capabilities/plugins/mcp-capabilities-common/.eslintrc.js Common package ESLint config.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/setupTests.ts Backend package test setup.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/service/createRouter.ts Backend router exposing /spec endpoint for live MCP discovery.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/processor/McpServerCapabilitiesProcessor.ts Catalog processor that enriches mcp-server entities with a cached summary.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/processor/McpServerCapabilitiesProcessor.test.ts Unit tests for enrichment behavior and caching/graceful skip.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/plugin.ts Backend plugin definition mounting the router under /api/mcp-capabilities.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/module.ts Catalog module registering the enrichment processor.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/lib/MCPClient.ts MCP streamable-http client (handshake + capability-gated discovery).
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/lib/MCPClient.test.ts Unit tests for handshake, SSE parsing, and error handling.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/index.ts Backend package exports.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/report.api.md API extractor report for the backend package.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/README.md Backend package README and installation/configuration guidance.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/package.json Backend package manifest and dependencies.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/dev/index.ts Backend dev setup with mocked auth + mock catalog entity.
workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/.eslintrc.js Backend package ESLint config.
workspaces/mcp-capabilities/package.json Workspace package manifest and repo scripts for local development.
workspaces/mcp-capabilities/bcp.json Workspace Backstage community plugin metadata/settings.
workspaces/mcp-capabilities/backstage.json Workspace Backstage version pin.
workspaces/mcp-capabilities/.yarnrc.yml Workspace Yarn settings.
workspaces/mcp-capabilities/.prettierignore Workspace prettier ignore patterns.
workspaces/mcp-capabilities/.gitignore Workspace gitignore.
workspaces/mcp-capabilities/.eslintrc.js Workspace-level ESLint config.
workspaces/mcp-capabilities/.eslintignore Workspace ESLint ignore patterns.
workspaces/mcp-capabilities/.dockerignore Workspace dockerignore.
workspaces/mcp-capabilities/.changeset/README.md Changesets scaffolding README.
workspaces/mcp-capabilities/.changeset/config.json Changesets configuration for the workspace.
workspaces/mcp-capabilities/.changeset/add-mcp-capabilities.md Changeset describing the new plugin suite release.
.github/CODEOWNERS Adds codeowners entry for the new workspace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/CODEOWNERS Outdated
Comment thread workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/lib/MCPClient.ts Outdated
Comment thread workspaces/mcp-capabilities/plugins/mcp-capabilities-backend/src/lib/MCPClient.ts Outdated
jh-sh added 2 commits July 2, 2026 17:53
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
Copilot AI review requested due to automatic review settings July 2, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 60 changed files in this pull request and generated 4 comments.

const mcpToolsContent = EntityContentBlueprint.make({
name: 'mcp-tools',
params: {
path: '/mcp-capabilities',
Comment on lines +49 to +53
const { entity } = useEntity();
const spec = (entity.spec ?? {}) as EnrichedSpec;
const caps = spec.capabilities ?? {};
const remote = spec.remotes?.[0];

</Text>
),
em: ({ children }) => <Text as="em">{children}</Text>,
a: ({ href, children }) => <Link href={href ?? '#'}>{children}</Link>,
}

const remote = getRemote(entity);
logger.info(`Discovering MCP server ${entityRef} at ${remote.url}`);

@awanlin awanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jh-sh, thanks for the contribution. Before moving forward with this can you please bring it up during the next Framework SIG as I feel this might be better as part of the core and not a community plugin. 👍

@jh-sh

jh-sh commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Hey, @awanlin! You're quite insightful, contributing to the core is actually a final goal ;)
But we decided to take a bit longer, "adoption from community-plugins" road.
Hopefully we could make it to next SIG to discuss and raise a hand.
In the meanwhile, if you don't mind, I'd still like proceed with small polishing here and there. Just to finalize the plugin into some solid contrib state.

@awanlin

awanlin commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Hi @jh-sh, I'd much prefer that you didn't and get resolution on the path forward first. There's nothing preventing you from working on this branch in your fork, I'm sure if you check the GitHub docs it's pretty easy to get the CI up and running there. I'd also suggest you convert this to a Draft will you work though the decision process.

Just something to consider, very much giving you the benefit of the doubt, but if you knew that having this in core was your intended goal would it not have been a more considerate approach to have logged the issue in the main repo first?

@jh-sh

jh-sh commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I'll convert that into a draft until PR is discussed on SIG and we have some grounds to decide next major steps.

As for your second question: I owe you a pardon for misleading.
"Landing into core is a final goal", is more like "it's the final, possible step". The intent was to go over with humble "community contribution -> usage -> adoption" in smaller steps.

@jh-sh jh-sh marked this pull request as draft July 3, 2026 14:14
Signed-off-by: Evgeny Shevyakov <jh.sh@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants