Skip to main content
Glama

clarity-api-mcp

Clarity AI 업스케일러용 Bun MCP 서버입니다. 하나의 POST 엔드포인트로 모든 공식 모드를 지원합니다.

기능

  • 도구: clarity_list_models, clarity_upscale

  • 모드: crystal, crystal-video, clarity (creative 별칭), clarity-pro

  • 로컬 파일: Clarity POST 전에 원시 공개 URL(uguu, litterbox, 또는 Tailscale Funnel)로 게시

  • Dropbox 공유 페이지와 tmpfiles.org HTML 페이지는 직접 파일 URL로 재작성됩니다.

  • Bun 네이티브: 컴파일 단계 없는 TypeScript, 자동 .env, Bun.file / Bun.write, Bun Shell curl

  • 구조화된 MCP 출력과 텍스트 폴백

Related MCP server: imagine-mcp

요구 사항

설정

git clone https://github.com/thomastraum/clarity-api-mcp.git
cd clarity-api-mcp
bun install
cp .env.example .env

.env 파일에 키를 넣으세요 (이 파일은 절대 커밋하지 마세요):

CLARITY_API_KEY=your-key-here

Bun은 .env를 자동으로 로드합니다. 또한 코딩 에이전트가 다른 디렉터리에서 서버를 시작할 때 이 패키지의 .env도 읽습니다.

MCP 클라이언트 구성

경로를 클론한 위치로 바꾸세요:

{
  "mcpServers": {
    "clarity-api": {
      "command": "bun",
      "args": ["/absolute/path/to/clarity-api-mcp/src/index.ts"]
    }
  }
}

키는 .env 또는 MCP env 블록에 둘 수 있습니다. Claude, Cursor, Codex, Grok 스니펫은 docs/INSTALL.md를 참조하세요.

도구

clarity_list_models

공식 API 페이지의 모든 모드, 매개변수 목록, 예시 본문을 반환합니다.

clarity_upscale

Authorization: Bearer …와 함께 POST https://api-upscale.clarityai.co를 전송합니다.

입력 (공통)

필드

설명

mode

crystal | crystal-video | clarity | creative | clarity-pro

image

공개 이미지 URL 또는 로컬 파일 (모든 이미지 모드)

video

공개 동영상 URL 또는 로컬 파일 (crystal-video)

publish

uguu (기본값) | litterbox | funnel | none — 로컬 파일을 원시 바이트로 노출하는 방법

webhook

선택 사항. 결과가 반환되는 대신 여기로 POST됩니다.

output_path

결과를 저장할 선택적 로컬 파일 또는 디렉터리

include_raw_response

선택적 디버그 플래그

Crystal — scale_factor 1–200, creativity 0–10, output_format jpg/png, target_megapixels 0.001–1500

Crystal Video — scale_factor 1–200

Clarity — creativity / resemblance / dynamic / fractality −10–10, scale_factor 2–16, style default/portrait/anime, postprocessing none/sharpen, prompt

Clarity Pro — creativity −10–10, scale_factor 2/4/8/16, output_format png/jpg. 출력 MP당 $0.03, 최대 64 MP.

출력

{
  "mode": "crystal",
  "requested_mode": "crystal",
  "url": "https://…",
  "credit_cost": 3,
  "cost_usd": 0.03,
  "balance": 97,
  "webhook": null,
  "saved_to": "/path/to/out.jpg",
  "published_url": "https://a.uguu.se/…",
  "published_via": "uguu",
  "note": null
}

Clarity는 1크레딧 = $0.01을 청구합니다. 로컬 파일은 Clarity가 원시 바이트를 가져올 수 있도록 먼저 게시됩니다. 파일을 이 머신에 유지해야 한다면 publish: "funnel"을 사용하세요 (Tailscale Funnel, Serve 아님).

환경 변수

이름

기본값

용도

CLARITY_API_KEY

—

필수 (CAI_API_KEY도 가능)

CLARITY_BASE_URL

https://api-upscale.clarityai.co

엔드포인트 재정의

CLARITY_TIMEOUT

300000

curl 타임아웃 (ms)

CLARITY_OUTPUT_DIR

—

output_path가 생략된 경우 결과 자동 저장

CLARITY_PUBLISH

uguu

로컬 파일의 기본 게시자

CLARITY_LITTERBOX_TIME

1h

litterbox TTL (1h / 12h / 24h / 72h)

스크립트

bun start
bun test
bun run smoke-test
bun run smoke-test -- --live

--live는 실제 API를 호출하고 크레딧을 사용합니다.

참고 사항

  • 이 프로세스에서는 MCP 전송을 제외하고 stdout에 쓰지 마세요. 진단은 stderr로 출력됩니다.

  • HTTP 클라이언트는 공식 예제와 동일한 Bun Shell curl이며, Response 본문을 stdin으로 사용합니다.

라이선스

MIT

Related MCP Connectors

Related MCP Servers