by konflux-ci
Enables natural‑language querying of Konflux DevLake databases by converting plain English questions into validated, secure SQL queries and returning structured data.
The server acts as a bridge between AI assistants and a Konflux DevLake database, allowing users to ask questions in everyday language and receive precise, structured results. It translates natural language into safe SQL, supports OIDC authentication, and offers specialized tools for incidents, deployments, and pull‑request retest analysis.
pip install -r requirements.txt and start the server using the konflux-devlake-mcp.py script with appropriate flags (e.g., --transport http --host 0.0.0.0 --port 3000).docker build -t konflux-devlake-mcp:latest .) and run it, supplying database credentials and optional environment variables for timeouts, logging, and OIDC settings.DB_HOST, DB_PORT, OIDC_ENABLED, and various timeout variables. Health checks are available at GET /health.Q: Which transport protocols are supported?
A: Both HTTP and stdio (--transport http|stdio).
Q: How are security concerns handled? A: The server validates and sanitizes every generated query, detects potential SQL injection, supports optional OIDC/JWT authentication, and enforces LDAP‑based RBAC for administrator‑only tools.
Q: What is TOON format? A: A compact, human‑readable serialization that reduces token usage by 30‑60 % compared with JSON, used for incident and PR retest tool responses.
Q: Can I run the server locally without Docker? A: Yes, install Python dependencies and start the script with the required flags.
Q: How do I configure timeouts for LLM connections?
A: Set environment variables like SERVER_TIMEOUT_KEEP_ALIVE, DB_READ_TIMEOUT, etc., or rely on the high default values (e.g., 600 s keep‑alive).
A MCP server that enables natural language querying of Konflux DevLake databases. This server acts as a bridge between AI assistants and your DevLake database, allowing you to ask questions in plain language and get structured data back.
pip install -r requirements.txt
python konflux-devlake-mcp.py --transport http --host 0.0.0.0 --port 3000 --db-host localhost --db-port 3306 --db-user root --db-password password --db-database lake
docker build -t konflux-devlake-mcp:latest .
docker run -d \
--name konflux-mcp-server \
-p 3000:3000 \
-e DB_HOST=your_db_host \
-e DB_PORT=3306 \
-e DB_USER=root \
-e DB_PASSWORD=your_password \
-e DB_DATABASE=lake \
-e LOG_LEVEL=INFO \
konflux-devlake-mcp:latest
docker tag konflux-devlake-mcp:latest quay.io/flacatus/mcp-lake:1.0.0
docker push quay.io/flacatus/mcp-lake:1.0.0
| Argument | Description | Example |
|---|---|---|
--transport |
Transport protocol (stdio/http) | --transport http |
--host |
Server host | --host 0.0.0.0 |
--port |
Server port | --port 3000 |
--db-host |
Database host | --db-host localhost |
--db-port |
Database port | --db-port 3306 |
--db-user |
Database username | --db-user root |
--db-password |
Database password | --db-password your_password |
--db-database |
Database name | --db-database lake |
--log-level |
Logging level | --log-level INFO |
The server includes configurable timeout settings optimized for LLM connections:
| Environment Variable | Description | Default |
|---|---|---|
SERVER_TIMEOUT_KEEP_ALIVE |
HTTP keep-alive timeout in seconds | 600 (10 minutes) |
SERVER_TIMEOUT_GRACEFUL_SHUTDOWN |
Graceful shutdown timeout in seconds | 120 (2 minutes) |
DB_CONNECT_TIMEOUT |
Database connection timeout in seconds | 60 (1 minute) |
DB_READ_TIMEOUT |
Database read timeout in seconds | 600 (10 minutes) |
DB_WRITE_TIMEOUT |
Database write timeout in seconds | 120 (2 minutes) |
These high default values ensure that long-running LLM requests and complex database queries don't timeout prematurely.
The server supports OIDC authentication for securing MCP endpoints. When enabled, all requests to /mcp endpoints require a valid token.
| Environment Variable | Description | Default |
|---|---|---|
OIDC_ENABLED |
Enable OIDC authentication | false |
OIDC_ISSUER_URL |
OIDC issuer URL (e.g., https://sso.redhat.com/auth/realms/redhat-external) |
- |
OIDC_CLIENT_ID |
OIDC client ID / audience | - |
OIDC_REQUIRED_SCOPES |
Comma-separated list of required scopes | - |
OIDC_JWKS_CACHE_TTL |
JWKS cache TTL in seconds | 3600 |
OIDC_SKIP_PATHS |
Comma-separated paths to skip auth | /health,/security |
OIDC_VERIFY_SSL |
Verify SSL certificates | true |
OIDC_OFFLINE_TOKEN_ENABLED |
Accept offline tokens (server exchanges for access token) | false |
OIDC_TOKEN_EXCHANGE_CLIENT_ID |
Client ID for token exchange (defaults to OIDC_CLIENT_ID) |
- |
OIDC_ACCESS_TOKEN_CACHE_BUFFER |
Seconds before expiry to refresh access token | 60 |
Example: Enable Red Hat SSO authentication with access tokens
export OIDC_ENABLED=true
export OIDC_ISSUER_URL="https://sso.redhat.com/auth/realms/redhat-external"
export OIDC_CLIENT_ID="cloud-services"
Example: Enable offline token mode (server handles token exchange)
export OIDC_ENABLED=true
export OIDC_ISSUER_URL="https://sso.redhat.com/auth/realms/redhat-external"
export OIDC_CLIENT_ID="cloud-services"
export OIDC_OFFLINE_TOKEN_ENABLED=true
export OIDC_TOKEN_EXCHANGE_CLIENT_ID="cloud-services"
With offline token mode, clients can use their long-lived offline token directly. The server automatically exchanges it for a short-lived access token and caches the result.
Clients must include the Authorization: Bearer <token> header. The token can be either:
OIDC_OFFLINE_TOKEN_ENABLED=true)When OIDC is enabled, the server also enforces LDAP/Rover-based RBAC. The offline token is
used only for token exchange; its claims are not used for identity or authorization. The
The LDAP user ID is derived from the final component of the validated exchanged access token's
sub claim, which must use the f:<idp-id>:<username> format. Members of devlakemcpadmin receive administrator
access, while other authenticated users receive restricted access. The execute_query tool
is administrator-only.
| Environment Variable | Description | Default |
|---|---|---|
LDAP_SERVER_URL |
IPA LDAP server URL, or a comma-separated list of replicas to fail over between | the six ldaps://s{1,2}.idm-001.prod.{us-east-1.aws,rdu2.dc,iad2.dc}.redhat.com replicas |
LDAP_BASE_DN |
LDAP base DN | dc=ipa,dc=redhat,dc=com |
LDAP_USER_BASE_DN |
User search base DN | cn=users,cn=accounts,dc=ipa,dc=redhat,dc=com |
LDAP_CACHE_TTL |
Group membership cache lifetime in seconds | 300 |
LDAP_ADMIN_GROUP |
Rover group mapped to administrator access | devlakemcpadmin |
LDAP_BIND_DN |
IPA LDAP service-account bind DN | - |
LDAP_BIND_PASSWORD |
IPA LDAP service-account password | - |
LDAP_BIND_DN and LDAP_BIND_PASSWORD should be provided through a Kubernetes Secret.
export DB_HOST=localhost
export DB_PORT=3306
export DB_USER=root
export DB_PASSWORD=your_password
export DB_DATABASE=lake
export TRANSPORT=http
export SERVER_HOST=0.0.0.0
export SERVER_PORT=3000
export LOG_LEVEL=INFO
# Timeout Configuration (for LLM connections)
export SERVER_TIMEOUT_KEEP_ALIVE=600 # HTTP keep-alive timeout in seconds (default: 600)
export SERVER_TIMEOUT_GRACEFUL_SHUTDOWN=120 # Graceful shutdown timeout in seconds (default: 120)
export DB_CONNECT_TIMEOUT=60 # Database connection timeout in seconds (default: 60)
export DB_READ_TIMEOUT=600 # Database read timeout in seconds (default: 600)
export DB_WRITE_TIMEOUT=120 # Database write timeout in seconds (default: 120)
Then run:
python konflux-devlake-mcp.py
python konflux-devlake-mcp.py --help
This server provides several specialized tools for working with your DevLake data:
/retest or /rerun). Provides detailed statistics including:
ClosedResourceError) and server shutdowns (CancelledError) without noisy error logsYour data security is our priority:
The server uses TOON format (Token-Optimized Object Notation) for tool responses to reduce token consumption:
TOON format is a compact, human-readable serialization format that significantly reduces token costs when working with LLMs while maintaining full data fidelity.
Keep track of your server's health and performance:
logs/konflux_devlake_mcp_server.log - General server activity and operationslogs/konflux_devlake_mcp_server_error.log - Detailed error information for troubleshootingGET http://localhost:3000/health - Monitor server status and connectivityClosedResourceError, CancelledError)Use Makefile to easily run local tests on MCP tools (requires docker engine and LLM API key):
make install
make test-unit
make test-integration
make test-e2e
make test-all
Automatically run linters when making a commit:
make install
pre-commit install
pre-commit run --all-files
Configured tools:
We welcome contributions to improve this project:
This MCP server is particularly useful for:
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by mindsdb
Enables humans, AI agents, and applications to retrieve highly accurate answers across large‑scale data sources, unifying heterogeneous databases, warehouses, and SaaS platforms.
by mckinsey
Build high-quality data visualization apps quickly using a low-code toolkit that leverages Plotly, Dash, and Pydantic.
by antvis
Offers over 25 AntV chart types for automated chart generation and data analysis, callable via MCP tools, CLI, HTTP, SSE, or streamable transports.
by dbt-labs
Provides a Model Context Protocol server that exposes a rich set of dbt‑related tools—SQL execution, semantic‑layer queries, discovery APIs, dbt CLI commands, admin operations, code generation, lineage analysis, and product documentation retrieval—so AI agents can safely interact with dbt projects and platforms.
by reading-plus-ai
A versatile tool that enables interactive data exploration through prompts, CSV loading, and script execution.
by Canner
Provides a semantic engine that lets MCP clients and AI agents query enterprise data with contextual understanding, precise calculations, and built‑in governance.
by surendranb
Provides natural‑language access to Google Analytics 4 data via MCP, exposing over 200 dimensions and metrics for Claude, Cursor and other compatible clients.
by OpenLabs-so
Provides privacy‑first, cookieless web analytics with revenue attribution and an MCP server, enabling self‑hosted tracking without cookies or cross‑site identifiers.
by ergut
Provides secure, read‑only access to BigQuery datasets, allowing large language models to query and analyze data through a standardized interface.