Skip to main content

ownta-mcp

OWNTA 的 MCP 服务端:把出图、图像处理、技能与百科只读封装成 Agent 可直接调用的 8 个工具。 两条接入方式——本地 stdio(pip install ownta-mcp)或远程 HTTP (https://ai.ownta.ai/mcp,不用装包)。

安装

pip install ownta-mcp
# 或者
uv tool install ownta-mcp

需要 Python >= 3.10。装完会得到命令 ownta-mcp(也可以 python -m mcp_server)。

1. 拿一把 Key

登录 https://ownta.ai → 设置 → API Key → 新建。

默认 scopes 是五个值:img.gen(出图)、vid.gen、llm.chat、img.ops(图像处理)、 lib.read。只让 Agent 出图就把 img.ops 去掉;Key 建完不能改 scopes,要改只能重建。 存量 Key 会在服务端启动迁移时自动补上 img.ops / lib.read,不需要重建。

Key 等同账户权限(能出图、能扣点),不要提交进仓库或贴进公开对话。

2. 配到客户端

通用形状(Claude Desktop / Cursor 都是 mcpServers 这一层):

{
  "mcpServers": {
    "ownta": {
      "command": "ownta-mcp",
      "env": {
        "OWNTA_GW_API_KEY": "sk-ownta-...",
        "OWNTA_GW_BASE_URL": "https://ai.ownta.ai"
      }
    }
  }
}
  • Claude Desktop:%APPDATA%\Claude\claude_desktop_config.json(Windows)/ ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)
  • Cursor:~/.cursor/mcp.json
  • VS Code:.vscode/mcp.json(键名是 servers,其余字段相同)

Windows 上客户端找不到 ownta-mcp 时,把 command 写成 pip 的 Scripts 全路径, 例如 C:\Users\<you>\AppData\Local\Programs\Python\Python312\Scripts\ownta-mcp.exe。

OWNTA_GW_BASE_URL 可省略,默认就是 https://ai.ownta.ai。

2b. 或者不装包:连远程 HTTP 端点

服务端在 https://ai.ownta.ai/mcp 跑了一份 streamable-http(无状态)。客户端支持 URL 时,不用装包、不用本机 Python:

{
  "mcpServers": {
    "ownta": {
      "url": "https://ai.ownta.ai/mcp",
      "headers": { "Authorization": "Bearer sk-ownta-..." }
    }
  }
}
  • Key 放 Authorization 头;没带 Key 的请求在门口 401。
  • 端点只做协议适配:scope、余额、日封顶仍由网关判定,错误码与 stdio 完全一致。
  • 只支持 streamable-http(Claude Desktop 目前只起子进程,走第 2 步 stdio);旧版 SSE transport(/sse)不提供。
  • 远程与 stdio 是同一套 8 个工具、同一份计价,选哪种只取决于客户端能不能起子进程。

3. 先跑这一句

用 ownta 的 generate_image 画一只在雨林里的蓝顶亚马逊鹦鹉,1024x1024,然后轮询到出图,把图片 URL 给我。

Agent 应该先拿到 job_id,再调 query_job 取 url。第一次调用会扣点; 余额不足会收到 insufficient_credits。

工具

工具 scope 计费 说明
generate_image img.gen 按计价表扣点 提交出图(异步,立即回 job_id);支持参考图、透明底、DTF/DTG
generate_brazil_pattern img.gen 按计价表扣点 巴西 T 恤印花一步提交(10 款技能,透明底 DTF)
query_job — 免费 轮询任务状态与成品 URL,可反复调
list_skills — 免费 平台模板 + 你自己的「我的技能」
get_skill — 免费 取单个技能的提示词全文与图位清单
apply_op img.ops 按档 0~16 点(明细见下) 13 档图像处理;compress 兼做等比下采(没有 resize)
browse_library — 免费 百科知识库目录与检索(10 个域,含 nature 题材 / style 风格层)
read_library_entry — 免费 读百科正文或 references/ 附件,支持分段续读

apply_op 的 13 档按点数分四组(价目真值在网关 Price 表):

  • 0 点:compress / crop / watermark / print_text / whitebg
  • 2 点:matting / kit  4 点:seamless  5 点:upscale  6 点:seamless_pro
  • 8 点:print_extract  10 点:inpaint_swap  16 点:outpaint

apply_op 的 src 只收本站 CDN 对象(image/ uploads/ processed/ 前缀), 不收外链与 base64;generate_image 的参考图反过来只收 data URL / 裸 base64,不收 http URL。

错误码

回包 ok=false 时按 code 分支(原样透传网关的 detail.reason):

code 含义 怎么办
insufficient_credits 余额不足 充值,或换一把有余额账号的 Key
scope_forbidden 这把 Key 没有该动作的 scope apply_op 需要 img.ops,新建一把带它的 Key
rate_limited 触发 RPM / 突发 / 日封顶 按回包 retry_after 退避
content_blocked 内容审核拒了 改写提示词
invalid_request 参数或来源不合规 按 message 改;src 必须是本站对象

已知边界

  • 远程端点只支持 streamable-http(无状态),不提供旧 SSE transport 与会话恢复; stdio 仍要求客户端能起子进程。
  • 一次任务不等待出图;generate_image 返回后必须用 query_job 轮询。
  • stdout 是 JSON-RPC 通道,本包日志只写 stderr;不要用 print 调试。

从源码安装(开发)

cd gateway/mcp_server
pip install -e .

版本:0.1.1(PyPI)。相对 0.1.0 只有两处:包描述补上远程 HTTP; server.py 按 SDK 签名探测构造参数(transport_security 从 mcp 1.12 才有、 max_request_body_size 从 1.29 才有)——0.1.0 声明 mcp>=1.9 却硬传这两个, 在旧 SDK 上会 TypeError。stdio 用法与 0.1.0 完全一致; 远程端点 2026-11-03 上线,不升级包也能连。

Metadata

Release files for ownta-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ownta-mcp 0.1.1
File Size Uploaded Provenance Actions
ownta_mcp-0.1.1.tar.gz 45.2 kB Without provenance Details for ownta_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ownta-mcp 0.1.1
File Interpreter ABI Platform Actions
ownta_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for ownta_mcp-0.1.1-py3-none-any.whl

Total release size: 92.3 kB

Release files / ownta_mcp-0.1.1.tar.gz

Download URL ownta_mcp-0.1.1.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7884973e14a81c82f40b63029d326b4ec00aaaba234627d2be850718bf9b6312
BLAKE2b-256 checksum
How to use checksums
0eb4de9f095a8ea06ee85a6a916f8cca6b6188d151cba547b052168bf2a3c1e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / ownta_mcp-0.1.1-py3-none-any.whl

Download URL ownta_mcp-0.1.1-py3-none-any.whl
Size 47.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62e4f230aa43c0b035902e2cf47aaa2ae750331bbfed492c65e4cd2896c13497
BLAKE2b-256 checksum
How to use checksums
408e010b2925d2da5a6c4de04354c0fe088ee688a532d4c78cd87111ef87ff8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for ownta-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page