This project implements a Model Context Protocol (MCP) server that provides tools for interacting with Red Hat APIs, making it easy to integrate with LLM applications.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Available Tools
- Examples
- Troubleshooting
- Advanced Usage
- Contributing
The server exposes the following Red Hat API tools:
- Search Red Hat KCS Solutions - Search for knowledge base solutions
- Get Solution by ID - Retrieve full solution content
- Search Red Hat Cases - Find cases matching a query
- Get Case Details - Retrieve detailed information about a specific case
- Python 3.13 or higher
- UV package manager (recommended Python package manager)
- Red Hat API offline token (obtained from your Red Hat account)
git clone <your-repository-url>
cd redhat-api-mcp
uv sync- Visit the Red Hat API Token Management page per KCS
- Log in to your Red Hat account
- Generate an offline token
- Copy and save the token securely
Create a .env file in the project root with your Red Hat API token:
# Create .env file
echo "RH_API_OFFLINE_TOKEN=your_offline_token_here" > .envReplace your_offline_token_here with your actual offline token from step 1.
You can test the server using the MCP development tools:
uv run mcp dev redhat_mcp_server.pyThis will start the MCP inspector, allowing you to interact with your tools interactively.
To install the server in Claude Desktop, add this configuration to your Claude Desktop config file.
{
"mcpServers": {
"redhat": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/redhat-api-mcp",
"run",
"redhat_mcp_server.py"
],
"env": {
"RH_API_OFFLINE_TOKEN": "your_actual_offline_token_here"
}
}
}
}Search for Red Hat KCS Solutions and Articles.
search_kcs(query: str, rows: int = 50, start: int = 0) -> List[Dict]Parameters:
query(str): Search terms (supports advanced Solr syntax)rows(int, optional): Number of results to return (default: 50, max: 100)start(int, optional): Starting index for pagination (default: 0)
Returns: List of solution objects with id, title, score, and view_uri
Get a Red Hat solution by its ID and extract structured content.
get_kcs(solution_id: str) -> DictParameters:
solution_id(str): The KCS solution ID
Returns: Dictionary with title, environment, issue, resolution, and root_cause
Search for Red Hat support cases.
search_cases(query: str, rows: int = 10, start: int = 0) -> List[Dict]Parameters:
query(str): Search termsrows(int, optional): Number of results to return (default: 10)start(int, optional): Starting index for pagination (default: 0)
Returns: List of case objects with case_number, summary, status, product, etc.
Get detailed information about a specific Red Hat support case.
get_case(case_number: str) -> DictParameters:
case_number(str): The Red Hat case number (e.g., "01234567")
Returns: Detailed case information with summary, description, severity, and comments
For detailed information about using advanced Solr query expressions with the Red Hat Hydra API, see expression.md.
The server includes sophisticated prompt templates for case analysis:
- Case Summary: Generates C.A.S.E. format summaries
- Case Resolution: Provides investigation workflows
- Multi-phase Analysis: Advanced case resolution protocols
You can override default API endpoints by adding these to your .env file:
# Optional: Custom API endpoints
RH_API_BASE_URL=https://access.redhat.com
RH_SSO_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/tokenThis project is licensed under the MIT License - see the LICENSE file for details.
Note: This MCP server requires a valid Red Hat account and API access. Ensure you have the appropriate permissions for the Red Hat services you intend to access.