redhat-community-ai-tools/dci-mcp-server
If you are the rightful owner of dci-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The DCI MCP Server is a Model Context Protocol server designed to facilitate AI model interactions with the DCI API for data extraction and analysis.
DCI MCP Server
This project provides a Model Context Protocol (MCP) server adapted for the DCI API. It allows AI models to interact with DCI for comprehensive data extraction about DCI jobs, components, topics and files.
Features
- š FastAPI: Built on a modern, fast web framework
- š¤ MCP: Implements the Model Context Protocol for AI integration
- š Comprehensive DCI API: Full access to DCI components, jobs, files, pipelines, products, teams, and topics
- š§ Smart PR Detection: Advanced PR build finder that analyzes job URLs and metadata
- š DCI Integration: Native DCI API support with authentication
- š Easy Configuration: Support for .env files for simple setup
- ā Code Quality: Comprehensive pre-commit checks and linting
- š Google Drive Integration: Convert DCI reports to Google Docs with rich formatting
- š« Jira Integration: Collect comprehensive ticket data from Jira with comments and changelog
Installation
# Clone the repository
git clone https://github.com/redhat-ai-tools/dci-mcp-server
cd dci-mcp-server
# Install dependencies
uv sync
# Activate virtual environment
source .venv/bin/activate
Configuration
The server supports multiple ways to configure DCI authentication:
Copy the example file and customize it:
cp env.example .env
# Edit .env with your DCI credentials
Example .env
file:
# Method 1: API Key Authentication
DCI_CLIENT_ID=<client_type>/<client_id>
DCI_API_SECRET=<api_secret>
# Method 2: User ID/Password (alternative to API key)
# DCI_LOGIN=foo
# DCI_PASSWORD=bar
# Google Drive Integration (optional)
# GOOGLE_CREDENTIALS_PATH=credentials.json
# GOOGLE_TOKEN_PATH=token.json
MCP Configuration
Cursor IDE (stdio transport)
Add to your ~/.cursor/mcp.json
:
{
"mcpServers": {
"dci": {
"command": "uv",
"args": ["run", "/path/to/dci-mcp-server/.venv/bin/python", "/path/to/dci-mcp-server/main.py"],
"description": "MCP server for DCI integration"
}
}
}
Web-based Integration (SSE transport)
For web applications or services that need HTTP-based communication:
{
"mcpServers": {
"dci": {
"url": "http://0.0.0.0:8000/sse/",
"description": "MCP server for DCI integration with direct SSE",
"env": {
"MCP_TRANSPORT": "sse"
}
}
}
}
SSE Endpoint: http://0.0.0.0:8000/sse/
Note: Make sure to start the SSE server separately with
MCP_TRANSPORT=sse uv run main.py
before using this configuration.
Prompts
You can then use to explore the DCI data.
There are also parameterized prompts defined in the MCP server:
/dci/rca <job id>
conducts a Root Cause Analysis of the problem in the job. Storing the downloaded files under/tmp/dci/<job id>
and generating a report at/tmp/dci/rca-<job id>.md
./dci/weekly <team name/id or remoteci name/id>
conducts a report for the last 7 days stored at/tmp/dci
./dci/biweekly <team name/id or remoteci name/id>
conducts a report for the last 14 days stored at/tmp/dci
.
Google Drive Integration
The server includes Google Drive integration to convert DCI reports and markdown content to Google Docs with rich formatting support.
Features
- š Markdown to Google Docs: Convert markdown content to properly formatted Google Docs
- š DCI Report Conversion: Specialized tools for converting DCI weekly/biweekly reports
- šØ Rich Formatting: Support for tables, code blocks, headers, lists, and links
- š OAuth2 Authentication: Secure authentication with Google Drive API
- š Folder Organization: Option to organize documents in specific Google Drive folders
Setup
To use Google Drive features, follow the for detailed configuration instructions.
Quick Setup:
- Set up Google Cloud Project and enable Google Drive API
- Download OAuth2 credentials and save as
credentials.json
- Initialize the service:
uv run python -c "from mcp_server.services.google_drive_service import GoogleDriveService; GoogleDriveService()"
- Complete browser authentication when prompted
Usage Examples
# Convert a DCI report to Google Doc in a specific folder by name
result = await convert_dci_report_to_google_doc(
report_path="/tmp/dci/the_weekly_report_2025-09-09.md",
doc_title="The Weekly Report - September 2025",
folder_name="DCI Reports"
)
# Create a Google Doc from markdown content in a folder by ID
result = await create_google_doc_from_markdown(
markdown_content="# My Report\n\nThis is a **test** document.",
doc_title="My Custom Report",
folder_id="1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
)
# Create a Google Doc from a file in a folder by name
result = await create_google_doc_from_file(
file_path="/path/to/report.md",
doc_title="My Report",
folder_name="Project Documents"
)
Jira Integration
The server includes Jira integration to collect comprehensive ticket data from Red Hat Jira, including comments and changelog information.
Features
- š« Ticket Data Collection: Retrieve comprehensive ticket information including summary, description, status, and dates
- š¬ Comments Analysis: Get up to 50 recent comments with author and timestamp information
- š Changelog Tracking: Access complete ticket history and field changes
- š JQL Search: Search tickets using Jira Query Language (JQL)
- š Project Information: Get project details and metadata
- š DCI Integration: Seamlessly extract Jira tickets from DCI job comments
Setup
To use Jira features, follow the for detailed configuration instructions.
Quick Setup:
- Get your Jira API token from https://issues.redhat.com/secure/ViewProfile.jspa
- Set environment variables in your
.env
file:JIRA_API_TOKEN=your_jira_api_token_here JIRA_URL=https://issues.redhat.com
Usage Examples
# Get comprehensive ticket data with comments
ticket_data = await get_jira_ticket("CILAB-1234", max_comments=10)
# Search for tickets using JQL
open_tickets = await search_jira_tickets("project = CILAB AND status = Open")
# Get project information
project_info = await get_jira_project_info("CILAB")
# Extract Jira tickets from DCI job comments
jobs_with_tickets = await search_dci_jobs("comment=~'.*CILAB.*'")
for job in jobs_with_tickets:
if job.get('comment'):
ticket_data = await get_jira_ticket(job['comment'])
Available Tools exposed by the MCP server
The server provides tools for interacting with DCI API components:
Component Tools
query_dci_components(query, limit, offset, sort, fields)
: Query components with advanced query language and pagination
Date Tools
today()
: Returns today's date in YYYY-MM-DD format.now()
: Returns current date and time in DCI compatible format (GMT).
Job Tools
search_dci_jobs(query, sort, limit, offset, fields)
: Search jobs with advanced query language and pagination
File Tools
download_dci_file(job_id, file_id, output_path)
: Download a file to local path
Google Drive Tools
create_google_doc_from_markdown(markdown_content, doc_title, folder_id, folder_name)
: Create a Google Doc from markdown contentcreate_google_doc_from_file(file_path, doc_title, folder_id, folder_name)
: Create a Google Doc from a markdown fileconvert_dci_report_to_google_doc(report_path, doc_title, folder_id, folder_name)
: Convert a DCI report to Google Doclist_google_docs(query, max_results)
: List Google Docs in your Drive
Note: For folder placement, you can use either folder_id
(exact folder ID) or folder_name
(searches for folder by name). Do not use both parameters together.
Jira Tools
get_jira_ticket(ticket_key, max_comments)
: Get comprehensive ticket data including comments and changelogsearch_jira_tickets(jql, max_results)
: Search tickets using JQL (Jira Query Language)get_jira_project_info(project_key)
: Get project information and metadata
Note: Jira tools require JIRA_API_TOKEN
environment variable to be set.
Code Quality Checks
The project includes comprehensive code quality checks:
Manual Checks
# Run all checks
bash scripts/run-checks.sh
# Or run individual checks
./.venv/bin/python -m black --check .
./.venv/bin/python -m isort --check-only .
./.venv/bin/python -m ruff check .
./.venv/bin/python -m mypy mcp_server/
./.venv/bin/python -m bandit -r .
Pre-commit Hooks (Optional)
# Install pre-commit hooks
./.venv/bin/python -m pre_commit install
# Run pre-commit on all files
./.venv/bin/python -m pre_commit run --all-files
Development
Project Structure
mcp_server/
āāā config.py # Configuration and authentication
āāā main.py # Server entry point
āāā services/ # DCI API services
ā āāā dci_base_service.py
ā āāā dci_component_service.py
ā āāā dci_job_service.py
ā āāā dci_file_service.py
ā āāā dci_log_service.py
ā āāā dci_pipeline_service.py
ā āāā dci_product_service.py
ā āāā dci_team_service.py
ā āāā dci_remoteci_service.py
ā āāā dci_topic_service.py
ā āāā google_drive_service.py
āāā promps/ # Templatized prompts
ā āāā prompts.py
āāā tools/ # MCP tools
ā āāā component_tools.py
ā āāā date_tools.py
ā āāā job_tools.py
ā āāā file_tools.py
ā āāā google_drive_tools.py
ā āāā log_tools.py
āāā utils/ # Utility functions
āāā http_client.py
Adding New Tools
- Create a new service in
mcp_server/services/
if needed - Create a new tool file in
mcp_server/tools/
- Register the tools in
mcp_server/main.py
- Update this README with documentation