clarity-api-mcp
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 Shellcurl结构化 MCP 输出,外加文本回退
要求
Bun >= 1.1
从 https://clarityai.co/api 获取一个 Clarity AI API 密钥
设置
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-hereBun 会自动加载 .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
发送 POST https://api-upscale.clarityai.co,携带 Authorization: Bearer …。
输入(通用)
字段 | 说明 |
|
|
| 公开图片 URL 或本地文件(适用于所有图片模式) |
| 公开视频 URL 或本地文件( |
|
|
| 可选。结果会 POST 到此地址,而不是直接返回 |
| 可选的本地文件或目录,用于保存结果 |
| 可选的调试标志 |
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 获取原始字节。如果文件需要保留在本机上(Tailscale Funnel,而非 Serve),请使用 publish: "funnel"。
环境变量
名称 | 默认值 | 用途 |
| — | 必需(或 |
|
| 覆盖端点地址 |
|
| curl 超时时间(毫秒) |
| — | 当省略 |
|
| 本地文件的默认发布器 |
|
| litterbox TTL( |
脚本
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Kling AI video generation
MCP server for Wan AI video generation
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thomastraum/clarity-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server