c2pa-watermark-mcp

c2pa-watermark-mcp

MCP server for embedding and verifying C2PA content credentials (provenance) in AI-generated assets, with HMAC-based tamper-evident manifests and optional X.509 support, helping comply with EU AI Act Article 50.

Category
访问服务器

README

c2pa-watermark-mcp

C2PA Content Credentials MCP server — embed and verify machine-readable provenance for AI-generated assets, ahead of the EU AI Act Article 50 deadline (2 December 2026).

Why this exists

EU AI Act Article 50 (Regulation (EU) 2024/1689) requires that AI-generated content be machine-readable + detectable as AI-generated. The c2pa.ai_generated assertion is the C2PA spec's mandated way to do that.

The deadline is 2 December 2026 — about 6 months out. Companies that ship user-facing generative tools without C2PA support face fines up to €35M or 7% of global turnover.

This MCP wraps the official c2pa-python SDK (≥0.9.0) as an MCP server so agents can attach C2PA manifests at generation time and verify provenance at runtime. A pure-stdlib HMAC fallback is included for environments where c2pa-python's native deps won't install (Vercel serverless, CI sandboxes, etc.).

Features

  • 3 MCP toolssign_asset, verify_asset, status
  • EU AI Act Article 50 ready — auto-injects c2pa.ai_generated assertion
  • Pure-stdlib fallback — works without c2pa-python's native deps
  • HMAC-SHA256 signatures — tamper-evident manifests
  • Optional X.509 chain — via c2pa-python[evm] extra
  • Vercel-deployable — see c2pa-watermark-vercel sibling repo

Tools

Tool Purpose Tier
sign_asset Embed a C2PA manifest into an asset, HMAC-signed Pro
verify_asset Verify a manifest against its asset bytes Free
status Report server health + native SDK availability Free

install

# Core (HMAC fallback, no native deps)
pip install c2pa-watermark-mcp

# With full c2pa-python (X.509 chain)
pip install 'c2pa-watermark-mcp[c2pa]'

# For local development
git clone https://github.com/CSOAI-ORG/c2pa-watermark-mcp
cd c2pa-watermark-mcp
pip install -e .[dev]

usage

Sign an asset (Pro tier)

from c2pa_watermark_mcp import sign_asset, verify_asset, status

# Server health
print(status())
# → {'server': 'c2pa-watermark-mcp', 'c2pa_python_available': False, ...}

# Sign an asset
with open("output.png", "rb") as f:
    asset = f.read()
key = b"my-hmac-key-32-bytes-long-aaaaaa"
result = sign_asset(
    asset_bytes=asset,
    asset_mime="image/png",
    claim_generator="MEOK-SDXL/1.0",
    signing_key=key,
    ai_generated=True,
    assertions=[
        {"label": "c2pa.training", "value": {"model": "sdxl-1.0", "dataset": "internal"}},
    ],
)
print(result["manifest_id"])

# Verify
verdict = verify_asset(asset, result["manifest"], key)
print(verdict)  # {'valid': True, 'reasons': [], ...}

Run as MCP server (stdio)

c2pa-watermark-mcp
# or with full c2pa-python
pip install 'c2pa-watermark-mcp[c2pa]'
c2pa-watermark-mcp

Run via Docker

docker build -t c2pa-watermark-mcp .
docker compose up -d
# status endpoint on http://localhost:8000

Deployment to Vercel

See the companion repo c2pa-watermark-vercel for a serverless wrapper exposing /sign, /verify, /status routes.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                c2pa-watermark-mcp                            │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐         │
│  │ sign_asset  │  │verify_asset │  │   status    │         │
│  │  (HMAC +    │  │  (HMAC +    │  │ (health +   │         │
│  │   c2pa.io)  │  │   tamper)   │  │  capability)│         │
│  └─────────────┘  └─────────────┘  └─────────────┘         │
│         │                │                │                  │
│         └────────────────┴────────────────┘                  │
│                          │                                   │
│                   ┌──────┴──────┐                           │
│                   │ HMAC-SHA256 │  (always available)       │
│                   │ + c2pa.io  │   (if c2pa-python installed)│
│                   └──────┬──────┘                           │
│                          │                                   │
│  ┌─────────────┐  ┌──────┴──────┐  ┌─────────────┐         │
│  │  manifest   │  │  signing   │  │  AI-Act     │         │
│  │  generator  │  │   keys     │  │ assertions  │         │
│  └─────────────┘  └─────────────┘  └─────────────┘         │
└─────────────────────────────────────────────────────────────┘

Why we auto-inject c2pa.ai_generated

The C2PA spec defines this as the standard way to disclose AI-generated content. EU AI Act Article 50 says AI content must be "machine-readable and detectable as AI-generated" — the spec's answer is exactly this assertion. Skipping the auto-inject would be a compliance violation waiting to happen.

FAQ

Q: Does this need c2pa-python? A: No. The pure-stdlib HMAC-SHA256 fallback is fully functional for tamper-evident manifests. Install c2pa-python only if you need the full X.509 chain.

Q: Can I sign an asset that's not a PNG/JPEG? A: Yes. The asset_mime parameter is just metadata; the HMAC is over the bytes themselves. Works for video, audio, PDFs, etc.

Q: How do I rotate the signing key? A: Generate a new key, deploy with both OLD_KEY and NEW_KEY, re-sign all manifests with NEW_KEY, then drop OLD_KEY after expiry. This package supports key rotation via the signing_key constructor arg.

Q: Is this production-ready? A: Yes for tamper-evidence (HMAC). For full X.509 C2PA chain + cryptographic non-repudiation, install c2pa-python ≥ 0.9.0.

License

MIT © MEOK AI Labs / CSOAI-ORG

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选