pinterest-mcp
A minimal MCP server for the Pinterest API v5 that reads boards, pins, and analytics and publishes new pins and boards, with human sign-off required before any public changes.
README
pinterest-mcp
A minimal Model Context Protocol server for the Pinterest API v5. Reads boards/pins/analytics; publishes new pins and boards. Built for a multi-agent fleet where a human must sign off before anything reaches the public account.
Setup
npm install
npm run build
Requires a Pinterest Developer App (https://developers.pinterest.com/apps/) with a registered redirect URI of http://localhost:3034/oauth/redirect. Note the App ID and App Secret.
Getting a token
PINTEREST_APP_ID=<id> PINTEREST_APP_SECRET=<secret> \
PINTEREST_CREDENTIALS_FILE=/home/you/.openclaw/credentials/pinterest.env \
node scripts/get-pinterest-token.mjs
Approve in the browser. The script writes PINTEREST_APP_ID, PINTEREST_APP_SECRET, PINTEREST_ACCESS_TOKEN, PINTEREST_REFRESH_TOKEN, PINTEREST_TOKEN_EXPIRES_AT into the file (mode 0600). Tokens are deliberately not printed.
Pass --port <n> if 3034 is taken (register the matching redirect URI in the Pinterest app). The listener binds before printing the authorize URL, so an occupied port fails loudly rather than burning the one-time auth code.
Configuration
{
"mcpServers": {
"pinterest": {
"command": "node",
"args": ["/path/to/pinterest-mcp/dist/index.js"],
"env": {
"PINTEREST_CREDENTIALS_FILE": "/home/you/.openclaw/credentials/pinterest.env"
}
}
}
}
The server rewrites PINTEREST_ACCESS_TOKEN / PINTEREST_TOKEN_EXPIRES_AT in that file when it refreshes (Pinterest access tokens expire after ~30 days). OpenClaw's MCP config bakes env vars at mcp add time and cannot rewrite them; the file it points at can be rewritten — same pattern as x-mcp.
Available tools
| Tool | Description |
|---|---|
pinterest_get_user_info |
Current account (username, id, account type). Safe read. |
pinterest_list_boards |
List boards, paginated. Safe read. |
pinterest_get_board |
One board's details by id. Safe read. |
pinterest_list_pins |
List pins, optionally scoped to one board_id. Safe read. |
pinterest_get_pin |
One pin's details by id. Safe read. |
pinterest_get_pin_analytics |
Impressions / saves / pin clicks / outbound clicks / video views for our own pin. Safe read. |
pinterest_create_board |
Live. Create a new board on the account. |
pinterest_create_pin |
Live. Publish an immediately-visible pin to one of our boards. |
Write tools require agent_id (must hold the social capability) and task_id (task must be Done and carry at least one approved output; brand must match PINTEREST_SERVER_BRAND, default with_nate). Both are ordinary refusals, not crashes — a gate rejection returns isError: true with a readable message.
Pinterest-specific gotchas
- Trial mode. A fresh Pinterest Developer app starts in trial mode, limited to the app owner's own account. That is its own safety net for a first-time integration — write scope cannot touch anyone else's account until the app is submitted for review and approved for standard access.
- Access-token rotation. Tokens expire in ~30 days; the server refreshes proactively via
POST /v5/oauth/tokenwithgrant_type=refresh_token. The refresh token itself usually persists but is written back to the credentials file if Pinterest ever rotates it. image_urlmust be publicly reachable. Pinterest fetches the image server-side. A local filesystem path (e.g. a MUSE-generated PNG under/mnt/d/Fleet/...) will fail — the file has to be hosted somewhere public first, or uploaded via Pinterest's separatePOST /v5/mediaflow (not implemented in this first version).- Put the destination URL in
link, notdescription. Thelinkfield is whatpinterest_get_pin_analyticscounts outbound clicks against. For Etsy promotion the Etsy listing URL goes there. - PNG or JPEG. Other formats are rejected by Pinterest at pin-create time.
Security model: agent_id capability gating + brand + publish-clearance
OpenClaw doesn't propagate per-agent caller identity down to MCP tool calls in this version (all agents share the same MCP process — confirmed platform limitation, openclaw/openclaw#67682). Write tools ask the fleet board's own capability record for the caller before doing anything, via GET /agents/{id}/capabilities at FLEET_BOARD_URL (default http://127.0.0.1:8420).
A second call — GET /tasks/{id}/publish-clearance?brand=<brand> — proves both the task's brand matches this server AND that a human has actually closed the task with an approved output. Same endpoint every outward server uses; the board owns the rule.
Honest limitations:
agent_idis self-reported by the caller, not cryptographically bound. This turns a silent wrong-agent action into a loud, rejected, auditable one — it does not stop a determined actor from lying.- The clearance gate is defence in depth. The load-bearing rule is that the board's own fan-out (
BRAND_CHANNELSinpickup.py) decides whether a publishing subtask is ever created. This gate catches an agent reaching for the tool outside that flow.
Standalone use: either stand up a minimal service at FLEET_BOARD_URL returning a JSON string array for GET /agents/{id}/capabilities and a {cleared: bool, reasons: string[]} for GET /tasks/{id}/publish-clearance, or remove the requireCapability / requireBrand calls from src/index.ts.
Deliberately not exposed
- Deleting a pin (
DELETE /v5/pins/{pin_id}). An unreviewed retraction of live content is a real, unrecoverable outward action. Deletions stay with Nathan, via the Pinterest app. - Deleting a board. Same reason.
- Follows / reactions. Social actions belong behind an explicit ECHO decision, not incidentally callable.
Notes on safety
- Every request goes to
api.pinterest.comorwww.pinterest.comonly — no telemetry, no third-party calls, no dynamic code execution. - Credentials live in a mode-0600 file rewritten in place. Tokens are never printed by either the server or the OAuth catcher.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。