YuniKorn MCP Server
Provides tools for querying partitions, queues, applications, nodes, user usage, and scheduler health of an Apache YuniKorn scheduler instance.
Allows AI agents to observe and reason about Kubernetes batch workload resource management, queue hierarchies, and application states through the YuniKorn scheduler.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YuniKorn MCP Server show queues in default partition"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YuniKorn MCP Server
A Model Context Protocol (MCP) server that interfaces with the Apache YuniKorn Scheduler, allowing AI agents to observe and reason about Kubernetes batch workload resource management, queue hierarchies, and application states.
Screenshots
Inspecting Yunikorn tools using MCP inspector

Querying the Yunikorn scheduler via MCP using Opencode

Related MCP server: Kubectl MCP Tool
Features
7 MCP Tools: Query partitions, queues, applications, nodes, user usage, and scheduler health
2 MCP Resources: Static data access for partitions list and node utilization
Async HTTP: Non-blocking API calls using
httpxProper Error Mapping: YuniKorn HTTP errors mapped to standard MCP error responses
Resource Awareness: Handles YuniKorn's raw bytes and millicore values
CORS Enabled: Allows connections from any origin for browser-based MCP Inspector
Streamable HTTP: Default transport with stdio fallback for IDE integration
Installation
uv pip install -r requirements.txtIf you are using a virtual environment, make sure it is activated first:
source .venv/bin/activate
uv pip install -r requirements.txtUsage
Running the Server
The default transport is Streamable HTTP on port 8000:
Run locally
uv run python -m mainRun with Docker
docker run -p 8000:8000 -e YUNIKORN_BASE_URL="http://<REPLACE_ME>/ws/v1" docker.io/frenoid/yunikorn-mcp-server:latestCommand line options
Option | Description | Default |
| Transport protocol ( |
|
| Host to bind (HTTP transport only) |
|
| Port to listen on (HTTP transport only) |
|
| Logging level |
|
Examples:
# Streamable HTTP on custom port
uv run python -m main --transport streamable-http --host 127.0.0.1 --port 8080
# Stdio mode for Claude Code / IDE integration
uv run python -m main --transport stdioEnvironment Variables
Variable | Description | Default |
| Base URL of the YuniKorn REST API |
|
| Disable HTTPS certificate verification ( |
|
# Connect to a remote YuniKorn instance
YUNIKORN_BASE_URL=http://yunikorn.example.com:9089/ws/v1/ uv run python -m main
# Connect to an HTTPS endpoint with a self-signed certificate
YUNIKORN_BASE_URL=https://yunikorn.example.com:9089/ws/v1/ TLS_INSECURE=true uv run python -m mainConnecting with MCP Inspector
The Streamable HTTP endpoint is exposed at the /mcp path:
http://localhost:8000/mcpTesting
Run the test suite against a live YuniKorn instance:
YUNIKORN_BASE_URL=http://your-yunikorn-host:9089/ws/v1/ uv run python test_server.pyTo run a quick compliance check:
YUNIKORN_BASE_URL=http://your-yunikorn-host:9089/ws/v1/ uv run python test_updated_server.pyData Format Notes
Memory: Represented in raw bytes (64-bit signed integers).
CPU (vcore): Represented in millicores (thousandths of a core, i.e. 1000m = 1 core).
Other resources: No specific unit assigned.
Active applications: The virtual "active" state represents New, Accepted, Running, Completing, and Failing statuses.
allocationID vs uuid:
uuidis deprecated.allocationIDcontains the same base value asuuidwith a hyphen-counter suffix (e.g.,-0,-1).allocationDelay: The difference between
allocationTimeandrequestTimefor an allocation.
API Conformance
This MCP server conforms to the Apache YuniKorn Scheduler REST API (v1.8.0). Each tool maps directly to a documented endpoint.
Tool | YuniKorn Endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Resources:
Resource | YuniKorn Endpoint |
|
|
|
|
Error Mapping
YuniKorn HTTP Code | MCP Error |
|
|
|
|
|
|
Available Tools
7 toolscheck_scheduler_healthA
Returns the health status of the scheduler, checking for critical logs and negative resource values. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: no named parameters. Returns: result
get_applications_by_stateA
Retrieves applications filtered by their current lifecycle state (active, rejected, or completed). Active is a virtual state representing New, Accepted, Running, Completing, or Failing apps. When state is 'active', you can optionally set status to new, accepted, running, completing, or failing (case-insensitive) to narrow results. Defaults to running if not specified. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: state (required), partitionName (required), status. Returns: result
get_node_detailsA
Fetches all nodes or a specific node managed by YuniKorn, including capacity and utilization percentages. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: partitionName (required), nodeId. Returns: result
get_partition_queuesA
Fetches the full queue hierarchy for a specific partition. Includes maxResource, guaranteedResource, and pendingResource for each queue. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: partitionName (required). Returns: result
get_partitionsA
Retrieves general information and statistics for all partitions in the cluster. Useful for seeing total cluster capacity, used capacity, and node counts. IMPORTANT: resource values (memory, cpu) are returned as raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: no named parameters. Returns: result
get_user_usageA
Retrieves resource usage and quota information for all users or a specific user. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: partitionName (required), userName. Returns: result
inspect_applicationA
Provides detailed metadata for a single application, including its allocation log and resource requests. Both uuid (deprecated) and allocationID fields may appear in allocations; allocationID contains the same base value as uuid plus a hyphen-counter suffix (e.g., -0, -1). Use allocationID to identify specific task allocations. IMPORTANT: resource values are raw integers (bytes for memory, millicores for CPU). Convert these to human-readable formats (e.g., GiB or Cores) before presenting to the user.
Inputs: appId (required), partitionName (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct domain entity: partitions, partition queues, applications, individual application details, nodes, user usage, and scheduler health. There is no overlap in purpose, making selection unambiguous.
All tool names follow a clear verb_noun pattern (get_partitions, get_partition_queues, get_applications_by_state, inspect_application, get_node_details, get_user_usage, check_scheduler_health). The pattern is consistent and predictable.
With 7 tools, the server is well-scoped for its purpose of monitoring and querying a YuniKorn cluster. Each tool covers a necessary aspect without unnecessary bloat.
The tool set covers the core query surfaces: partitions, queues, applications, nodes, user usage, and health. Minor gaps exist (e.g., no scheduler configuration or historical metrics retrieval), but the primary workflows are fully supported.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP-Native LLM Orchestration Agent
MCP Server for an Agent Task Marketplace
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Kubernetes/Minikube clusters through natural language, allowing AI agents like Codename Goose to manage Kubernetes resources via the Model Context Protocol.2MIT
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.169 npm972MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows AI agents to interact with Apache DolphinScheduler through a standardized protocol, enabling AI-driven workflow management.32Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn Model Context Protocol server that lets language models directly manage and visualize Kubernetes clusters through safe, high-level operational tools.1-