Interacting with Model Context Protocol tools for Red Hat Developer Hub
Leveraging the Model Context Protocol (MCP) server to integrate Red Hat Developer Hub (RHDH) with AI clients
Abstract
- 1. Interact with Model Context Protocol tools for Red Hat Developer Hub
- 1.1. Understanding Model Context Protocol
- 1.2. Install the MCP server and tool plugins in Red Hat Developer Hub
- 1.3. Configure Model Context Protocol in Red Hat Developer Hub
- 1.4. Accessing RHDH data using the Software Catalog MCP tools
- 1.5. Accessing and analyzing documentation using the TechDocs MCP tools
- 1.6. Troubleshoot MCP server and client problems
Leverage the Model Context Protocol (MCP) server to integrate Red Hat Developer Hub with AI clients through a standardized method for accessing RHDH information and workflows using defined MCP tools.
1. Interact with Model Context Protocol tools for Red Hat Developer Hub
Use the Model Context Protocol (MCP) server to enable AI clients to access Developer Hub data and workflows through standardized MCP tools for software catalogs and TechDocs.
1.1. Understanding Model Context Protocol
Model Context Protocol (MCP) connects AI applications to external systems, enabling Developer Hub MCP tools through the mcp-actions-backend plugin.
This section describes Developer Preview features in the Model Context Protocol plugin. Developer Preview features are not supported by Red Hat in any way and are not functionally complete or production-ready. Do not use Developer Preview features for production or business-critical workloads. Developer Preview features provide early access to functionality in advance of possible inclusion in a Red Hat product offering. Customers can use these features to test functionality and provide feedback during the development process. Developer Preview features might not have any documentation, are subject to change or removal at any time, and have received limited testing. Red Hat might provide ways to submit feedback on Developer Preview features without an associated SLA.
For more information about the support scope of Red Hat Developer Preview features, see Developer Preview Support Scope.
Model Context Protocol (MCP) connects AI models and applications (MCP clients) to external systems (MCP servers) to access information and workflows. MCP servers define the tools that MCP clients can interact with. Red Hat Developer Hub (RHDH) supports MCP tools through the mcp-actions-backend plugin available in Backstage 1.40 or later.
You must verify that your model supports tool calling before you enable Model Context Protocol (MCP) features. Using an incompatible model results in error messages.
1.2. Install the MCP server and tool plugins in Red Hat Developer Hub
Enable MCP support by installing the backend MCP server plugin and MCP tool plugins for Software Catalog and TechDocs features.
To enable MCP support in Red Hat Developer Hub, you must install the following components:
- Backend MCP server plugin
- Responsible for running MCP tools.
- MCP tool plugins
- Individual MCP plugins that expose capabilities relating to the Software Catalog and TechDocs features in RHDH.
Prerequisites
- Your RHDH instance is installed and running.
Procedure
Install the backend MCP server plugin: In your dynamic plugins ConfigMap (for example,
dynamic-plugins-rhdh.yaml), add the MCP server plugin as shown in the following example:plugins: - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:bs_1.45.3__0.1.5 disabled: falseInstall any of the following MCP tools that you want to use:
Software Catalog MCP tool:
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.45.3__0.4.1 disabled: falseTechDocs MCP
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-techdocs-mcp-tool:bs_1.45.3__0.3.2 disabled: false
1.3. Configure Model Context Protocol in Red Hat Developer Hub
Enable MCP client applications to access RHDH information and workflows by configuring authentication tokens and server endpoints.
You can enable your MCP client applications to use the MCP protocol to access RHDH information and workflows. This configuration is a prerequisite for MCP clients to use the defined MCP tools and access the exposed capabilities of RHDH.
Prerequisites
Procedure
In your Red Hat Developer Hub
app-config.yamlfile, configure a static token for authentication against the MCP server endpoint. MCP clients (such asCursor,Continue, orLightspeed Core) use these tokens to authenticate against the Backstage MCP server. For example:backend: auth: externalAccess: - type: static options: token: ${MCP_TOKEN} subject: mcp-clientswhere:
${MCP_TOKEN}Set the token value that you generate manually and share with your MCP clients.
NoteTokens must be long and complex strings without whitespace to prevent brute-force guessing.
- To generate a sample token, use the following command:
$ node -p `require("crypto").randomBytes(24).toString("base64")`
Register the MCP tools that you install as a plugin source:
backend: actions: pluginSources: - software-catalog-mcp-tool - techdocs-mcp-tool# Full
app-config.yamlfile example with MCP configuration app: title: AI Dev Developer Hub baseUrl: "${RHDH_BASE_URL}" auth: environment: development session: secret: "${BACKEND_SECRET}" providers: guest: dangerouslyAllowOutsideDevelopment: true backend: actions: pluginSources: - 'software-catalog-mcp-tool' - 'techdocs-mcp-tool' auth: externalAccess: - type: static options: token: ${MCP_TOKEN} subject: mcp-clients keys: - secret: "${BACKEND_SECRET}" baseUrl: "${RHDH_BASE_URL}" cors: origin: "${RHDH_BASE_URL}" signInPage: oidc
1.3.1. Configure MCP clients to access the RHDH server
Configure MCP client applications with server URLs and authentication to enable interaction with the RHDH MCP server.
You must configure an MCP client before it can interact with the MCP server. For more information on the list of clients and the configuration for each client, see Example Clients.
Prerequisites
You have configured one of the following endpoints as the server URL, where
<my_developer_hub_domain>is the hostname of your RHDH instance.-
Streamable:
https://<my_developer_hub_domain>/api/mcp-actions/v1 SSE (Legacy):
https://<my_developer_hub_domain>/api/mcp-actions/v1/sseNoteSome clients do not yet support the Streamable endpoint, and you might need to use the SSE endpoint instead.
-
Streamable:
-
You have set the
${MCP_TOKEN}environment variable in your MCP server configuration as the bearer token when authenticating with the MCP server.
Procedure
Configure Cursor as a client.
- From your Desktop app, navigate to Cursor Settings and select MCP Tools > New MCP Server.
Add the following configuration:
{ "mcpServers": { "backstage-actions": { "url": "https://<my_developer_hub_domain>/api/mcp-actions/v1", "headers": { "Authorization": "Bearer <MCP_TOKEN>" } } } }where:
<MCP_TOKEN>- Enter the previously configured static token
<my_developer_hub_domain>- Enter the hostname of your RHDH instance
Configure Continue as a client.
In your agent yaml configuration file, add the following configuration:
mcpServers: - name: backstage-actions type: sse url: https://<my_developer_hub_domain>/api/mcp-actions/v1/sse requestOptions: headers: Authorization: "Bearer <MCP_TOKEN>"where:
<MCP_TOKEN>- Enter the previously configured static token
<my_developer_hub_domain>- Enter the hostname of your RHDH instance
Configure Developer Lightspeed for RHDH as a client. For more details, see Red Hat Developer Lightspeed for Red Hat Developer Hub.
In the
lightspeed-stack.yamlconfiguration, add the following configuration formcp_servers:mcp_servers: - name: mcp::backstage provider_id: model-context-protocol url: https://<my_developer_hub_domain>/api/mcp-actions/v1 authorization_headers: Authorization: "client"where:
model-context-protocol-
This is the tool runtime provider defined and configured in the llama-stack
run.yamlconfiguration for use in LCS.
Optional: If you want to use your own Llama Stack configuration, add the following code to your Llama Stack configuration file (
run.yaml).providers: tool_runtime: - provider_id: model-context-protocol provider_type: remote::model-context-protocol config: {}To authorize requests to the MCP endpoint using
<MCP_TOKEN>, add it in the Developer Lightspeed for RHDHapp-config.yamlfile, to make POST requests to LCS, as shown in the following code:lightspeed: mcpServers: - name: mcp::backstage token: ${MCP_TOKEN}Optional: You can query the LCS
/v1/streaming_queryendpoint directly by providing theMCP_TOKENin the header, as shown in the following code:curl -X POST \ -H `Content-Type: application/json` \ -H `MCP-HEADERS: {"mcp::backstage": {"Authorization": "Bearer <MCP_TOKEN>"}}` \ -d `{"query": "Can you give me all catalog templates of type 'service', "model": "gpt-4o-mini", "provider": "openai"}` \ _<url>_/v1/streaming_query
where:
<url>-
Enter the LCS endpoint. You can use localhost(pass:c,a,q:[
<RHDH_servicename>.my-rhdh-project.svc.cluster.local:8080]) or the service name for this field if you are inside the Backstage container.
1.4. Accessing RHDH data using the Software Catalog MCP tools
Manage and retrieve Software Catalog entities including Components, Systems, Resources, APIs, Locations, Users, and Groups using MCP tools.
Use Software Catalog MCP tools to manage and retrieve RHDH entities such as Components, Systems, Resources, APIs, Locations, Users, and Groups.
Software Catalog tool reference
The software-catalog-mcp-tool plugin provides tools to interact with the software catalog. By default, these tools return data in a JSON array format.
Table 1. Available tools in the software-catalog-mcp-tool plugin
| Tool | Description | Parameters |
|---|---|---|
|
|
Lists RHDH entities such as components, APIs, and resources. |
|
|
|
Registers a new entity in the software catalog using a |
|
|
|
Removes an existing entity from the software catalog. |
|
|
|
Retrieves metadata for a specific software template. |
|
1.4.1. Fetching entities using fetch-catalog-entities
List Developer Hub entities including components, APIs, and resources using the fetch-catalog-entities tool.
The fetch-catalog-entities tool lists RHDH entities, including components, APIs, and resources.
Common query examples
- "Fetch all ai-model resources in the Backstage catalog"
- "Fetch the API definition for the beneficiary-management-api API"
- "Construct a curl command based on the API definition for the “insert beneficiary” endpoint in the beneficiary-management-api"
Table 2. Parameters for the fetch-catalog-entities tool
| Parameter | Description | Example |
|---|---|---|
|
|
Filters by entity kind. |
|
|
|
Filters by entity type. [NOTE]: You must use the |
|
|
|
Specifies a specific entity name. |
|
|
|
Filters entities by their owner. |
|
|
|
Filters entities by their lifecycle. |
|
|
|
Filters entities by their tags. |
|
|
|
Retrieves the full Backstage entity object instead of a shortened output when set to |
|
1.4.2. Registering entities using catalog-register-tool
Add new entities to the Software Catalog using the catalog-register-tool.
Use the catalog-register-tool to add new entities to your Software Catalog.
Table 3. catalog-register-tool parameters
| Parameter | Description |
|---|---|
|
|
The URL to the |
1.4.3. Unregistering entities using catalog-unregister-tool
Remove existing entities from the Software Catalog using the catalog-unregister-tool.
Use the catalog-unregister-tool to remove an existing entity from the Software Catalog.
Table 4. Parameters for catalog-unregister-tool
| Parameter | Description |
|---|---|
|
|
A valid catalog location URL or a UUID. |
1.4.4. Retrieving Software Template metadata
Retrieve metadata for specific Software Templates using the software-template-metadata-tool.
Use the software-template-metadata-tool to retrieve metadata for a specific Software Template.
Table 5. Parameters for software-template-metadata-tool
| Parameter | Description |
|---|---|
|
|
The reference identifier for the Software Template. |
1.5. Accessing and analyzing documentation using the TechDocs MCP tools
Use TechDocs MCP tools to search, retrieve, and analyze documentation content from Developer Hub for AI applications.
The TechDocs MCP tool enables MCP clients to search and retrieve documentation from RHDH for use as context in AI applications.
Table 6. TechDocs tools and parameters
| Tool | Description | Parameters |
|---|---|---|
|
|
Lists all entities with registered TechDocs. Includes metadata such as |
|
|
|
Calculates the percentage of entities with TechDocs configured to identify documentation gaps. |
|
|
|
Retrieves the content of a specific TechDocs resource. |
|
1.5.1. Retrieving TechDocs URLs and metadata using fetch-techdocs
List all Backstage entities with TechDocs including URLs, metadata, timestamps, and build information using the fetch-techdocs tool.
The fetch-techdocs TechDocs MCP tool lists all Backstage entities with TechDocs. By default, the tool returns results in a JSON array format. Each entry includes entity details and TechDocs metadata, like last update timestamp and build information.
By default, each entry in the JSON array is an entity with the following fields: name, title, tags, description, owner, lifecycle, namespace, kind, techDocsUrl, matadataUrl and metadata.
The following examples show common queries:
- “Fetch all techdocs from the Backstage server”
- “Fetch all techdocs of the default namespace”
- “Fetch all techdocs created by user:john.doe”
Table 7. fetch-techdocs TechDocs MCP tool.
| Name | Description | Example |
|---|---|---|
|
|
Filters entities by their type. |
"Component" |
|
|
Filter entities by their namespace. |
"default" |
|
|
Filters entities by owner. |
"user:john.doe" |
|
|
Filters entities by their lifecycle. |
"development" |
|
|
Filters entities by their tags. |
["genai, "ibm", "llm", "granite", "conversational", "task-text-generation"] |
1.5.2. Measuring documentation gaps using analyze-techdocs-coverage
Calculate documentation coverage percentage and identify gaps using the analyze-techdocs-coverage tool with entity attribute filters.
The analyze-techdocs-coverage TechDocs MCP tool calculates the percentage of entities that have TechDocs configured. Use this tool to identify documentation gaps and improve overall documentation coverage.
You can filter results by the following entity attributes: * type * namespace * owner * lifecycle * tags By default, analyze-techdocs-coverage returns a JSON entity that includes the totalEntities, entitiesWithDocs, and coveragePercentage fields.
The following examples show common queries:
- “What is the coverage of techdocs in the backstage server”
- “What is the coverage of techdocs in the default namespace”
Table 8. Parameters for the analyze-techdocs-coverage TechDocs MCP tool
| Name | Description | Example |
|---|---|---|
|
|
Filters entities by their type. |
"Component" |
|
|
Filter entities by their namespace. |
"default" |
|
|
Filters entities by owner. |
"user:john.doe" |
|
|
Filters entities by their lifecycle. |
"development" |
|
|
Filters entities by their tags. |
["genai, "ibm", "llm", "granite", "conversational", "task-text-generation"] |
1.5.3. Finding a specific TechDoc using retrieve-techdocs-content
Retrieve TechDocs content for specific Software Catalog entities using the retrieve-techdocs-content tool with entityRef, name, title, and content fields.
The retrieve-techdocs-content TechDocs MCP tool retrieves the content of a TechDocs resource, enabling AI clients to access documentation content for specific Software Catalog entities. By default, the tool returns a JSON entity with the following fields: entityRef, name, title, kind, namespace, content, path, contentType, lastModified, and metadata.
The following examples show common queries:
- “Fetch techdoc with reference component:default/my-service”
- “Fetch page about.html from techdoc with reference component:default/my-service”
The following table describes the parameters for the retrieve-techdocs-content TechDocs MCP tool.
| Name | Description | Example |
|---|---|---|
|
|
Specifies the entity to retrieve using the |
"component:default/my-service" |
|
|
Specifies the path to a specific documentation page. Defaults to |
"index.html" |
1.6. Troubleshoot MCP server and client problems
Resolve common issues when using the Model Context Protocol (MCP) server including installation verification, log checking, error messages, and authentication problems.
1.6.1. Verify successful installation of MCP plugins
Verify MCP plugin installation by checking pod logs for successful plugin loading and MCP tool registration.
Procedure
Log in to the OCP cluster running RHDH and go to your RHDH project using the following code:
$ oc project my-rhdh-project
Inspect the logs for the installation of the RHDH dynamic plugins using the following code:
$ oc logs -c install-dynamic-plugins deployment/<my-product-deployment>
Verification
You must see an entry for the MCP backend server plugin as shown in the following code:
..... prior logs .... ======= Installing dynamic plugin oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:bs_1.42.5__0.1.2!backstage-plugin-mcp-actions-backend ==> Copying image oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:next__0.2.0 to local filesystem ==> Successfully installed dynamic plugin oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:bs_1.42.5__0.1.2!backstage-plugin-mcp-actions-backend
You must see entries for any of the MCP tool plugins you installed as shown in the following code:
..... prior logs .... ======= Installing dynamic plugin oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.42.5__0.2.3!red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool ==> Copying image oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.42.5__0.2.3!red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool to local filesystem ==> Successfully installed dynamic plugin oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.42.5__0.2.3!red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool
1.6.2. Checking MCP tool logs for status and errors
Review Backstage LoggerService logs for MCP tool execution status and error messages.
The Backstage LoggerService target name starts with the name of the MCP tool (either software-catalog-mcp-tool or techdocs-mcp-tool). The MCP tools generate a log by default. For example:
`[backend]: 2025-09-25T16:24:22.660Z software-catalog-mcp-tool info fetch-catalog-entities: Fetching catalog entities with options: kind="Component"`
If any errors occur in the MCP tools, check the logs.
1.6.3. Understand and respond to MCP tool error messages
MCP tools provide optional error messages that communicate issues including input validation errors encountered during tool use.
The MCP tools response provides an optional error message that communicates any issues encountered during the use of the tool, including potential input validation errors.
1.6.4. Resolve the Model does not support tool calling error
Resolve tool calling errors by confirming your AI model supports tool calls and switching to a compatible model if needed.
This error indicates that the model configured in your MCP client lacks the required functionality to handle tool calls. The error message appears similar to: Invalid request: model gemma3:27b does not support tool calls.
Procedure
- Consult your model documentation to confirm its support for tool calling.
- If the current model does not support tool calling, change the model that your MCP client uses to a tool-calling compatible model.
1.6.5. Resolve authentication issues when tools are not found
Verify authentication tokens and configuration when MCP clients connect but cannot find deployed tools.
If your MCP client connects to the server but cannot find deployed tools, an authentication or configuration issue is likely.
Procedure
Verify the authentication token.
- Configure a static token for the RHDH MCP server.
-
Set this token as the bearer token in your MCP client and make sure the authorization header is the configuration that specifies
Bearerbefore the token, for example,Bearer <mcp_token>.
Check the MCP endpoint configuration.
- Confirm that the MCP server URL properly resolves, particularly if you are using a desktop client.
- Use legacy SSE endpoint if your MCP client requires it instead of the Streamable endpoint. (For more details, see the Configuration topic).
Verify your RHDH
app-config.yamlfile for duplicate backend entries and make sure that the indentation is accurate.- Make sure that the configuration for the static token and MCP plugin sources go under an existing backend field, if one is present.
- If you are unsure, see the sample app configuration provided in the reference procedure.
1.6.6. Resolve nonsensical MCP tool output
Improve MCP tool output quality by using larger models or models with larger context windows when nonsensical results occur.
Nonsensical output often occurs when smaller models or models with smaller context sizes cannot effectively manage repeated tool calls within the same context window.
Procedure
To improve the quality of the tool output, take the following actions:
Select an appropriate model for tool calling.
- Verify that the model has good support for tool calling.
- Make sure your model is not too small. We recommend a model with at least 7 billion parameters and a context window of 32k.
Refine your queries.
- Use more well-defined queries that limit the amount of data returned in the response from the tool.
- If possible, increase the context window size of the model. We recommend at least 32k for these MCP tools.