cnv-lab-mcp
cnv-lab-mcp
GLPI에서 랩 하드웨어를 예약하고, Jenkins에서 CNV 클러스터 배포를 트리거하며, ACM spoke 클러스터를 가져오기 위한 MCP 서버입니다. 인스턴스 URL, 하드웨어 이름, 토큰은 하드코딩되어 있지 않습니다. 모든 값은 도구 인자 또는 환경 변수에서 가져옵니다.
Cursor에 추가
Related MCP server: quads-mcp
사전 요구 사항
Node.js >= 20
GLPI 개인 API 토큰(
My Settings→API tokens). 인스턴스에서 요구하는 경우GLPI_APP_TOKEN은 선택 사항입니다.Jenkins API 토큰(
User→Configure→API Token)과 짧은 사용자 이름. 이메일이 아닙니다.user@example.com은 401을 반환하고user는 정상 동작합니다.GLPI 프로필은 대상 엔티티에 0이 아닌
reservation권한이 있어야 합니다.Jenkins 계정은 트리거할 작업에 대해 Job/Build 및 Job/Read 권한이 필요합니다.
내부 TLS / NODE_EXTRA_CA_CERTS
Node의 fetch(undici)는 curl처럼 OS/키체인 CA 저장소를 사용하지 않습니다. curl은 작동하는데 MCP 서버가 fetch failed를 보고하면 NODE_EXTRA_CA_CERTS를 내부 CA 번들로 설정하고 Cursor를 다시 시작하세요:
export NODE_EXTRA_CA_CERTS=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pemTLS 오류는 일반 네트워크 오류와 별도로 보고되므로 원인을 쉽게 파악할 수 있습니다.
구성
.env.example을 복사하고 다음을 설정하세요:
변수 | 필수 | 참고 |
| 예 |
|
| 예 | 개인 API 토큰 |
| 아니요 | 인스턴스에서 요구하는 경우에만 |
| 예 | Jenkins 루트 URL |
| 예 | 짧은 사용자 이름(이메일 아님) |
| 예 | API 토큰 |
mcp.json 항목 예시(비밀 값은 환경 변수 보간 사용):
{
"mcpServers": {
"cnv-lab-mcp": {
"command": "npx",
"args": ["-y", "cnv-lab-mcp"],
"env": {
"GLPI_BASE_URL": "https://glpi.example.internal",
"GLPI_USER_TOKEN": "${env:GLPI_USER_TOKEN}",
"JENKINS_BASE_URL": "https://jenkins.example.internal",
"JENKINS_USER": "${env:JENKINS_USER}",
"JENKINS_API_TOKEN": "${env:JENKINS_API_TOKEN}",
"NODE_EXTRA_CA_CERTS": "${env:NODE_EXTRA_CA_CERTS}"
}
}
}
}패키지가 npm에 게시될 때까지 args를 이 저장소로 지정하세요:
"args": ["-y", "github:galkremer1/cnv-lab-mcp"]도구
예약:
list_reservable_items— GLPI 예약 가능 자산 탐색find_available_cluster— 요구 사항(구조화 + 자유 텍스트 주석)을 매칭하고 가장 빠른 여유 슬롯 기준으로 순위 지정. 예약하지 않습니다.check_availability— 단일 항목의 예약 + 공백 기간reserve_cluster— 시간 창 예약. 항상 세션의users_id를 설정합니다.cancel_reservation— 예약 해제
Jenkins:
trigger_jenkins_job— 일반 트리거.start_at은delay=NNNsec이 됩니다.get_build_status— 큐/빌드 + 콘솔 꼬리abort_build— 빌드 중지
클러스터 접근:
get_cluster_info—*-data.zip의 비민감 메타데이터 및 콘솔/API URLget_cluster_kubeconfig—auth/kubeconfig+auth/kubeadmin-password를 메모리에만 보관. 클러스터 관리자 자격 증명. 채팅에 다시 출력하지 마세요.
ACM:
import_spoke_cluster— ManagedCluster + KlusterletAddonConfig, import 매니페스트를 spoke에 적용, 조인 폴링get_managed_cluster_status— 허브 측 조인/사용 가능 조건
시나리오(예약 전 확인):
list_scenariosplan_scenario— 클러스터/시간 창/매개변수 제안, 예약하지 않음execute_scenario— 계획에서 예약 + 트리거
기본 제공 시나리오는 src/scenarios/catalog.json에 있으며 PR로 확장할 수 있습니다: basic-bm-cnv, acm-hub-and-spoke, sriov-cnv-cluster.
개발
npm install
npm test
npm run lint
npm run typecheck
npm run build실제 인스턴스에 대한 수동 스모크 테스트(CI에서 실행되지 않음):
npx tsx scripts/smoke.ts
SMOKE_JOB=deploy-ocp-bare-metal-cluster-with-abi-cnv-5.0 SMOKE_CLUSTER=example-cluster npx tsx scripts/smoke.ts보안
.env는 gitignore에 포함됩니다. 예시는 명백히 가짜 플레이스홀더를 사용합니다.CI는 모든 push/PR에서 gitleaks를 실행합니다.
클라이언트 오류는 토큰을 삭제하고
Authorization/user_token값을 절대 기록하지 않습니다.get_cluster_kubeconfig는 zip을 Buffer로 다운로드하고 JSZip으로 메모리에서 추출합니다. 아카이브나auth/*를 디스크에 쓰지 않습니다.get_cluster_info는deploydata.json,metadata.json,install-config.backup.yaml만 읽습니다.
Available Tools
15 toolsabort_buildA
Stop a running or queued Jenkins build (job/{name}/{build}/stop).
Inputs: job_name (required), build_number (required).
cancel_reservationB
Delete/release a GLPI reservation by id.
Inputs: reservation_id (required).
check_availabilityA
Fetch the full reservation list for one ReservationItem (paginated correctly) and compute free gaps / the first slot of duration_minutes.
Inputs: reservation_item_id (required), earliest_start, duration_minutes.
execute_scenarioA
Execute a plan from plan_scenario: reserve each role, trigger Jenkins jobs (delayed if start is in the future). ACM import runs only if wait_timeout_seconds is set and builds complete.
Inputs: plan (required), wait_timeout_seconds.
find_available_clusterA
Find reservable clusters matching requirements and rank them by earliest free slot of duration_minutes. Proposes slots only — does not book.
Inputs: duration_minutes (required), limit, itemtype, requirements, +1 more.
get_build_statusB
Poll Jenkins queue/build state. Returns building/result and a console-log tail.
Inputs: job_name (required), queue_id, build_number.
get_cluster_infoA
Return non-sensitive cluster metadata from a deploy job *-data.zip (deploydata.json, metadata.json, console/API URLs). Does not read kubeconfig or kubeadmin-password.
Inputs: job_name (required), build_number, cluster_name.
get_cluster_kubeconfigA
Extract auth/kubeconfig and auth/kubeadmin-password from a deploy job *-data.zip in memory. Returns cluster-admin credentials — do not echo them back in chat.
Inputs: job_name (required), build_number, cluster_name.
get_managed_cluster_statusB
Read ManagedCluster join/available conditions from the hub.
Inputs: cluster_name (required), hub_kubeconfig (required).
import_spoke_clusterA
Import a spoke into an ACM hub: create ManagedCluster + KlusterletAddonConfig, fetch the generated import Secret, apply manifests to the spoke, poll until Joined/Available.
Inputs: cluster_name (required), hub_kubeconfig (required), spoke_kubeconfig (required), timeout_seconds.
list_reservable_itemsB
Search GLPI for reservable assets (default itemtype Peripheral). Returns id, name, comment/capability text, and linked ReservationItem id.
Inputs: filter, itemtype.
list_scenariosA
List built-in end-to-end scenario presets (id, name, description, overridable fields).
Inputs: no named parameters.
plan_scenarioA
Resolve a scenario into a concrete unbooked plan (candidate clusters, windows, Jenkins parameters). Books and triggers nothing.
Inputs: scenario_id (required), overrides.
reserve_clusterA
Create a GLPI reservation. Always sets users_id from the authenticated session. Re-validates for conflicts immediately before booking.
Inputs: reservation_item_id (required), end, start, comment, +1 more.
trigger_jenkins_jobA
Trigger a Jenkins job with parameters. If start_at is in the future, passes delay=NNNsec so the build does not start immediately.
Inputs: job_name (required), start_at, parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools have distinct resource-action targets, but a few boundaries could be sharper: check_availability and find_available_cluster both deal with availability, and get_cluster_info vs. get_cluster_kubeconfig both extract from the same deploy artifact. Descriptions clarify the difference well enough that an agent can usually choose correctly.
All 15 tool names follow a consistent snake_case verb_noun convention (list, check, find, reserve, cancel, trigger, get, abort, import, plan, execute). There are no camelCase names, vague single verbs, or arbitrary suffixes.
Fifteen tools is at the upper end of the ideal range but appropriate for the server's scope: reservation management, Jenkins build control, cluster artifact access, ACM import/monitoring, and scenario orchestration. Each tool covers a distinct step and no tool feels redundant.
The core path from finding/reserving assets, triggering and monitoring builds, extracting cluster credentials, and importing a spoke into ACM is covered. However, the lifecycle lacks cleanup operations (e.g., deleting/detaching a ManagedCluster, removing an imported spoke) and there is no dedicated way to list or look up existing reservations before canceling.
Maintenance
Related MCP Connectors
MCP server for GLPI: tickets, ITIL, assets, knowledge base. GLPI 10/11. Not affiliated with Teclib'.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
MCP server for Appcircle mobile CI/CD platform.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server for automating VLP lab VM operations, exposing VM management tools to AI agents like Cursor and Claude Code.-
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with QUADS infrastructure systems via API, enabling resource management and automation through LLM applications.MIT
- FlicenseAqualityDmaintenanceAn MCP server for OpenShift Baremetal IPI cluster provisioning, allowing users to generate and validate install-config.yaml files, test BMC connectivity, validate networks, and manage cluster installation lifecycle.24-
- FlicenseAqualityDmaintenanceMCP server for IBM Technology Zone: manage reservations end-to-end and search the catalog from Claude.11-