Skip to main content
Glama
prime-intellect-mcp

prime-intellect-mcp

by kvrancic

prime-intellect-mcp

Claude Code가 직접 Prime Intellect GPU 포드를 대여, 구동 및 종료하도록 하세요. 사용자가 제어하는 하드 지출 한도가 적용됩니다.

PyPI Python License CI MCP


소개

Claude Code(또는 모든 MCP 클라이언트)를 Prime Intellect 계정에 연결하는 MCP 서버입니다. 이를 통해 에이전트는 다음 작업을 수행할 수 있습니다:

  • 🔍 검색: 요구 사항에 맞는 가장 저렴한 GPU 포드 찾기

  • 💸 견적: 비용을 지불하기 전에 가격 확인

  • 🛒 프로비저닝: 포드 생성 (confirm=True를 입력한 경우에만)

  • 🖥️ SSH: 포드에 접속 (연결 문자열은 에이전트의 Bash 도구로 전달됨)

  • 🛑 종료: 작업 완료 후 포드 종료 — 잊어버린 경우 강력하게 경고

단일 워크플로우를 위해 구축되었습니다: Claude에게 *"가장 저렴한 H100을 대여해서 학습 스크립트를 실행하고, 끝나면 종료해"*라고 말하고 400달러 청구서를 받지 않도록 방지합니다.


Related MCP server: claude-colab

60초 만에 설치하기

Claude Code를 통해 GPU 대여를 시작하려면 다음만 있으면 됩니다:

1. Prime Intellect API 키 받기

여기를 클릭하여 생성 → 권한 설정:

범위

수준

Instances

읽기 및 쓰기

Availability

읽기 전용

Billing

읽기 전용

SSH Keys

읽기 전용

키를 복사하세요 (pit_…로 시작합니다).

2. Claude Code에 서버 추가

~/Library/Application Support/Claude/claude_desktop_config.json(macOS) 또는 프로젝트의 .mcp.json을 열고 다음을 붙여넣으세요:

{
  "mcpServers": {
    "prime-intellect": {
      "command": "uvx",
      "args": ["prime-intellect-mcp"],
      "env": {
        "PRIME_API_KEY": "pit_PASTE_YOURS_HERE",
        "PRIME_MAX_HOURLY_USD": "5",
        "PRIME_MAX_TOTAL_USD": "40"
      }
    }
  }
}

끝입니다. Claude Code를 재시작하고 다음과 같이 물어보세요: "지금 시간당 1달러 미만으로 사용 가능한 GPU가 뭐야?"

uvx가 없나요? curl -LsSf https://astral.sh/uv/install.sh | sh (또는 brew install uv)로 설치하세요. uv 패키지 관리자를 위한 한 줄 설치 프로그램이며, 다시는 가상 환경을 관리할 필요가 없습니다.


✨ SSH 추가 (선택 사항, +2분) — Claude가 포드에서 코드를 실행하려면 필요

위의 서버는 이미 포드를 프로비저닝/검사/종료할 수 있습니다. 하지만 Claude Code가 실행 중인 포드에 SSH로 접속하여 명령을 실행하려면, Prime Intellect가 사용자의 공개 SSH 키를 알고 있어야 합니다.

3. 머신에서 SSH 키 찾기 또는 생성

ls ~/.ssh/*.pub          # if you have id_ed25519.pub or similar, you're set
# otherwise:
ssh-keygen -t ed25519 -C "you@example.com"   # press Enter through the prompts

4. Prime Intellect에 공개 키 등록

cat ~/.ssh/id_ed25519.pub    # or whichever .pub file you have

출력된 내용(ssh-ed25519 …로 시작하는 한 줄)을 복사하여 app.primeintellect.ai/dashboard/ssh-keys의 Add SSH key 양식에 붙여넣으세요.

끝입니다. 향후 생성되는 포드에는 authorized_keys에 사용자의 공개 키가 포함되며, Claude Code의 Bash 도구가 바로 SSH로 접속할 수 있습니다:

ssh ubuntu@<pod-ip-from-pod_status> "nvidia-smi"

v0.2 예정: Claude 내부에서 4단계를 수행하는 register_ssh_key MCP 도구 (브라우저 방문 불필요). 이슈 트래커에서 진행 상황을 확인하세요.


Claude가 수행할 수 있는 작업 (9가지 도구)

도구

사용 사례

list_gpu_types

"Prime Intellect에서 제공하는 GPU 유형은 무엇인가요?"

list_availability

"시간당 3달러 미만으로 사용 가능한 1×H100 포드를 보여줘."

get_wallet_balance

"남은 크레딧이 얼마인가요?"

pod_quote

"200GB 디스크가 포함된 1×A100 견적을 내줘." (비용 발생 없음)

pod_create

"해당 견적으로 포드를 프로비저닝해." (confirm=True 필요)

pod_list

"실행 중인 포드를 보여줘."

pod_status

"포드 X가 준비되었나요? SSH 정보가 나올 때까지 기다려."

pod_terminate

"포드 X를 종료해." (confirm=True 필요)

pod_check_runaway

"종료하지 않은 포드가 있나요?"


안전: 자동 프로비저닝 방지

다음 3단계 안전장치가 있습니다:

  1. 견적 우선. pod_quote는 가격과 60초 유효 토큰을 반환합니다. 부작용은 없습니다. 달러 금액은 이제 에이전트의 컨텍스트에 포함됩니다.

  2. 명시적 확인. pod_create(및 pod_terminate)는 confirm=True가 필요합니다. 없으면 드라이런(dry-run) 미리보기만 제공됩니다.

  3. 환경 변수 하드 캡. PRIME_MAX_HOURLY_USD는 해당 요금 이상의 포드를 차단합니다. PRIME_MAX_TOTAL_USD는 예산을 초과하는 (요금 × 최대_수명_시간) 포드를 차단합니다. 지갑 잔액도 강제 적용됩니다. 이러한 캡은 도구 인수로 재정의할 수 없으며, 호출될 때마다 읽어옵니다.

기본값: PRIME_MAX_HOURLY_USD=5, PRIME_MAX_TOTAL_USD=40. 설정의 env 블록에서 설정하세요.

모든 pod_create / pod_terminate는 ~/.prime-intellect-mcp/audit.log에 JSON으로 추가되므로, 에이전트가 사용자의 돈으로 무엇을 했는지 전체 기록을 확인할 수 있습니다.


예시 프롬프트 (Claude Code에 붙여넣기)

List the cheapest 1×H100 pods available right now. Show me the top 3 by hourly price.
Quote a 1×A100 80GB with 100GB disk, 8 vCPU, 64GB RAM. Don't provision yet —
just show me what it would cost.
I need to fine-tune a 7B model overnight. Find the cheapest 1×H100 with 200GB
disk, max $40 total budget, max 12 hours. Provision it, give me the SSH command,
and remind me to terminate when I'm done.
Check if I have any running pods I forgot about and show me their hourly cost.
Terminate pod abc123. Confirm before doing it.

문제 해결

Claude Code 설정이 env 블록을 가져오지 못했거나, PRIME_API_KEY를 다른 변수로 입력했을 수 있습니다. 다음으로 확인하세요:

$ env | grep PRIME

Claude Code를 실행하는 동일한 셸 내부에서 확인하거나, (${PRIME_API_KEY}를 사용하는 대신) 키를 JSON env 블록에 직접 붙여넣으세요.

에이전트가 하드 캡을 초과하는 포드를 선택했습니다. 다음 중 하나를 수행하세요:

  • 더 저렴한 GPU를 선택하세요 (list_availability에 지역 필터를 사용하면 더 저렴한 커뮤니티 가격 행이 나타나는 경우가 많습니다).

  • 설정에서 PRIME_MAX_HOURLY_USD를 높이고 Claude Code를 재시작하세요.

견적은 60초 동안 유효합니다. 에이전트가 pod_quote와 pod_create 사이에서 너무 오래 기다렸습니다. pod_quote를 다시 호출하세요. 비용이 발생하지 않는 작업입니다.

프로비저닝이 완전히 완료되지 않았습니다. 포드는 살아있지만 여전히 설치 스크립트를 실행 중입니다. pod_status(pod_id, wait_for_ssh=True)를 호출하면 SSH가 활성화될 때까지 (5초마다 폴링하며) 대기합니다.

Prime Intellect에 공개 키를 알리지 않았거나(또는 등록하기 전에 포드가 프로비저닝됨) 발생합니다. 해결 방법:

  1. app.primeintellect.ai/dashboard/ssh-keys에서 공개 키가 등록되었는지 확인하세요.

  2. 재프로비저닝 — 포드의 authorized_keys는 생성 시점에 설정되므로, 기존 포드는 나중에 등록한 키를 가져오지 않습니다.

  3. 개인 키에 암호가 있는 경우, macOS에서 ssh-add --apple-use-keychain ~/.ssh/your_key를 한 번 실행하면 에이전트가 자동으로 잠금을 해제합니다.

app.primeintellect.ai/wallet에서 충전 후 다시 시도하세요.


왜 또 다른 서버인가요?

PyPI에 prime-mcp-server 0.1.2가 있습니다. 이는 간단한 개념 증명이며, 이 프로젝트는 포크가 아닙니다. 무인 야간 사용을 위한 차이점은 다음과 같습니다:

prime-intellect-mcp

prime-mcp-server 0.1.2

2단계 견적 → 확인

✅

❌

환경 변수 하드 지출 캡

✅

❌

지갑 사전 확인

✅

❌

실행 중인 포드 감지

✅

❌

에이전트로 SSH 핸드오프

✅

❌

테스트

32개 단위 + 선택적 라이브

없음


로컬 개발

git clone https://github.com/kvrancic/prime-intellect-mcp
cd prime-intellect-mcp
uv sync
uv run pytest -m "not live"        # 32 fast tests, no network, no spend
uv run ruff check .
uv run mypy src

라이브 스모크 테스트 (가장 저렴한 GPU 프로비저닝, nvidia-smi 실행, 종료; 약 $0.05 소요):

PRIME_API_KEY=pit_... PRIME_LIVE_TEST=1 PRIME_LIVE_MAX_HOURLY=0.60 \
PRIME_MAX_HOURLY_USD=0.60 PRIME_MAX_TOTAL_USD=2.00 \
uv run pytest tests/test_smoke_live.py -v -s

로드맵

  • v0.2 — register_ssh_key MCP 도구 (대시보드 단계 제거), 샌드박스(prime-sandboxes SDK), 환경 허브

  • v0.3 — 선택적 자동 종료 데몬 (서버 측 max_lifetime_hours 강제 적용); 비용 원격 측정

  • v1.0+ — Prime Intellect가 OAuth를 출시할 때 호스팅/OAuth 배포; Anthropic 커넥터 디렉토리에 제출


감사의 말

라이선스

MIT — LICENSE 참조.

기여

이슈와 PR을 환영합니다. 제출하기 전에 uv run pytest -m "not live"와 uv run ruff check .를 실행해 주세요.

Available Tools

9 tools
get_wallet_balanceA

Return the current Prime Intellect wallet balance and recent billings.

Use this to estimate how long a quoted pod can run, or to check why pod_create returned an insufficient-funds error.

Inputs: no named parameters. Returns: object

list_availabilityA

List currently-available GPU pods that match the filters.

Returns the SDK's GPUAvailability rows (cloud_id, gpu_type, gpu_count, prices, disk/vcpu/memory bounds, stock_status, ...). Use this to pick a target before pod_quote, or to show the user options.

Inputs: gpu_type, gpu_count, regions. Returns: object

list_gpu_typesA

List every GPU type Prime Intellect currently offers (e.g. "H100_80GB", "A100_80GB").

Use this when the user is vague about what they want. Pass the result into list_availability or pod_quote.

Inputs: no named parameters. Returns: result

pod_check_runawayA

Return locally-tracked pods that have run past max_lifetime_hours OR whose accumulated cost is approaching PRIME_MAX_TOTAL_USD.

Call this at the start of long-running sessions to catch forgotten pods.

Inputs: no named parameters. Returns: result

pod_createA

Provision a Prime Intellect GPU pod (or preview the provisioning).

With confirm=False: returns a dry-run preview describing what would happen. With confirm=True: validates spend caps + quote freshness, then provisions.

The server enforces:

  • quote_token must be fresh (TTL 60s)

  • hourly_usd ≤ PRIME_MAX_HOURLY_USD

  • hourly_usd × max_lifetime_hours ≤ PRIME_MAX_TOTAL_USD

  • estimated total ≤ wallet balance

On success, the pod is recorded in local state.json so pod_check_runaway can warn about overdue pods later.

Inputs: quote_token (required), name (required), max_lifetime_hours, confirm, +1 more. Returns: object

pod_listA

List every pod the API key can see (active + provisioning + stopped).

Inputs: no named parameters. Returns: result

pod_quoteA

Get a non-binding price quote + reserved provisioning payload.

Returns a quote_token (TTL=60s) that you pass to pod_create with confirm=True to actually provision. This tool has NO side effects.

The server picks the cheapest matching GPUAvailability row that satisfies the requested disk/vcpu/memory. If none matches, returns an error explaining what's available.

Inputs: gpu_type (required), gpu_count, disk_size_gb, vcpus, +2 more. Returns: object

pod_statusA

Get the current status (provisioning / active / failed) for a pod.

With wait_for_ssh=True, blocks (polls every 5s) until ssh_connection is available — that's when you can SSH in. Returns the SSH connection string in ssh_connection (e.g. "root@1.2.3.4 -p 22000"). Use it from your Bash tool: ssh -o StrictHostKeyChecking=no <ssh_connection> "<cmd>".

Inputs: pod_id (required), wait_for_ssh, timeout_s. Returns: object

pod_terminateA

Destroy (terminate) a pod. Idempotent on already-deleted pods.

Without confirm=True, returns a no-op preview so you can re-read your decision.

Inputs: pod_id (required), confirm. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a unique and clearly distinct purpose, from wallet balance and GPU availability listing to pod creation, quoting, and termination. There is no overlap that could cause an agent to select the wrong tool.

    Naming Consistency5/5

    Tool names follow a consistent pattern: utility functions use verb_noun (e.g., get_wallet_balance, list_availability) and pod operations all start with pod_ (e.g., pod_create, pod_terminate). The naming is predictable and easily understood.

    Tool Count5/5

    With 9 tools covering wallet, GPU types, availability, pod lifecycle (create, list, status, quote, terminate), and runaway monitoring, the count is well-scoped for the server's purpose. Each tool earns its place with no redundancy.

    Completeness5/5

    The tool surface covers the full lifecycle of GPU pod management: discovering availability, quoting, creating, monitoring status, listing, terminating, and checking for runaway pods. The inclusion of wallet balance and wait-for-SSH functionality addresses common operational needs.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers