媒体资产管理协议服务器

一个为Iconik媒体资产管理API设计的模型上下文协议服务器,使AI助手能够与Iconik媒体库交互。

  • by postforward
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 postforward/Iconik-MCP-Server

使用说明

Iconik MCP服务器

模型上下文协议(MCP)服务器 Iconik 媒体资产管理API。这使得像克劳德这样的人工智能助手能够与您的Iconik媒体库进行交互。

特性

  • 143 MCP工具 -全面覆盖Iconik API
  • 多配置文件支持 -管理多个Iconik域/帐户
  • 独立脚本 -用于常见批量操作的CLI工具
  • 干运行模式 -安全地预览破坏性操作

安装

# Clone the repository
git clone https://github.com/postforward/Iconik-MCP-Server.git
cd Iconik-MCP-Server

# Install dependencies
npm install

# Build
npm run build

配置

选项1:配置文件(建议用于多个配置文件)

创建 iconik-config.json 在项目目录中:

{
  "default_profile": "production",
  "profiles": {
    "production": {
      "name": "Production Domain",
      "app_id": "your-app-id",
      "auth_token": "your-auth-token"
    },
    "staging": {
      "name": "Staging Domain",
      "app_id": "your-staging-app-id",
      "auth_token": "your-staging-auth-token",
      "api_url": "https://preview.iconik.cloud/API/"
    }
  }
}

在以下位置搜索配置文件:

  1. 当前工作目录: ./iconik-config.json
  2. 主目录: ~/.iconik-config.json
  3. 包目录

选项2:环境变量

对于单个配置文件,使用环境变量:

export ICONIK_APP_ID=your-app-id
export ICONIK_AUTH_TOKEN=your-auth-token
export ICONIK_API_URL=https://app.iconik.io/API/  # Optional

或者创建一个 .env 文件:

ICONIK_APP_ID=your-app-id
ICONIK_AUTH_TOKEN=your-auth-token

跑步

标准(默认)

对于本地使用Claude Code、Cursor、Claude Desktop和其他MCP客户端:

node dist/index.js

超文本传输协议

对于通过Streamable HTTP进行的远程或容器化部署:

MCP_TRANSPORT=http node dist/index.js

终点:

  • POST /mcp --MCP协议(新会话或现有通过 mcp-session-id 头球
  • GET /mcp --现有会话的SSE流
  • DELETE /mcp --结束会话
  • GET /health --健康检查

访问级别

MCP_ACCESS_LEVEL 控制启动时注册哪些工具。默认为 read 为了安全。

级别 工具 计数
read 列表、获取、搜索、检查 85
readwrite 读取+创建、更新、批量 126
full 读写+删除、清除 143
# Read-only (default)
node dist/index.js

# Read + write
MCP_ACCESS_LEVEL=readwrite node dist/index.js

# Full access
MCP_ACCESS_LEVEL=full node dist/index.js

码头工人

# Build and run (read-only by default)
docker compose up --build

# With write access
MCP_ACCESS_LEVEL=readwrite docker compose up --build

# Full access
MCP_ACCESS_LEVEL=full docker compose up --build

环境变量:

  • ICONIK_APP_ID (必填)
  • ICONIK_AUTH_TOKEN (必填)
  • MCP_ACCESS_LEVEL (默认值 read)
  • MCP_PORT (默认值 8000)

使用Claude Desktop

添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "iconik": {
      "command": "node",
      "args": ["/path/to/Iconik-MCP-Server/dist/index.js"],
      "env": {
        "ICONIK_APP_ID": "your-app-id",
        "ICONIK_AUTH_TOKEN": "your-auth-token",
        "MCP_ACCESS_LEVEL": "readwrite"
      }
    }
  }
}

然后重新启动Claude Desktop。

MCP工具

服务器提供按类别组织的工具:

资产

  • search_assets -使用筛选器搜索资产
  • get_asset -获取资产详细信息
  • create_asset -创建新资产
  • update_asset -更新资产属性
  • delete_asset -删除资产
  • get_asset_proxies -列出代理文件
  • delete_proxies_by_collection -批量删除代理
  • 还有30多种资产工具。..

集合

  • list_collections -列出所有收藏
  • get_collection -获取收藏详细信息
  • create_collection -创建收藏
  • get_collection_contents -列出收藏内容
  • add_to_collection -将资产添加到集合

元数据

  • get_asset_metadata -获取资产元数据
  • update_asset_metadata -更新元数据值
  • list_metadata_views -列出可用视图
  • get_metadata_view -获取视图架构

文件和存储

  • list_storages -列出存储位置
  • get_asset_files -列出资产文件
  • create_file -创建文件记录

工作和转码

  • list_jobs -列出转码作业
  • get_job -获取作业状态
  • create_transcode_job -开始转码

用户和共享

  • list_users -列出用户
  • list_shares -列出共享链接
  • create_share -创建共享链接

独立脚本

直接运行脚本进行批量操作:

智能搜索

npx ts-node scripts/smart-search.ts search "interview" --type=video --transcripts
npx ts-node scripts/smart-search.ts export "*" ./all-assets.csv --limit=500
npx ts-node scripts/smart-search.ts recent --limit=10 --profile=staging

删除代理

# Dry run (preview)
npx ts-node scripts/delete-proxies.ts collection <collection_id>

# Actually delete
npx ts-node scripts/delete-proxies.ts collection <collection_id> --live

# Use specific profile
npx ts-node scripts/delete-proxies.ts collection <id> --profile=production --live

存储审核

npx ts-node scripts/storage-audit.ts
npx ts-node scripts/storage-audit.ts --profile=production

存档健康报告

npx ts-node scripts/archive-health-report.ts

批量元数据更新

# List available metadata views
npx ts-node scripts/metadata-bulk-update.ts list-views

# Update by collection (dry run)
npx ts-node scripts/metadata-bulk-update.ts collection <collection_id> <view_id> '{"field":"value"}'

# Update from CSV
npx ts-node scripts/metadata-bulk-update.ts csv ./updates.csv <view_id> --live

获取您的Iconik证书

  1. 登录您的Iconik域名
  2. 首选 管理员 → 设置 → 应用程序
  3. 创建新应用程序或使用现有应用程序
  4. 复制 应用程序ID 并生成 身份验证令牌

API 参考

此MCP服务器包装 API Iconik。有关详细的端点信息,请参阅他们的文档。

许可证

国际协调委员会

贡献

欢迎投稿!请打开问题或PR。