pinterest-business-mcp
Enables Pinterest Business account management through OAuth, including authorization URL generation, connection status checking, and secure token storage.
README
Pinterest Business MCP
Local Model Context Protocol server for Pinterest Business workflows. This repository includes a stdio MCP server, Pinterest OAuth connection tools, encrypted local token storage, and server status reporting.
Requirements
- Node.js 22+
- pnpm 11+
- A Pinterest developer app with the redirect URI below
Pinterest developer dashboard setup
-
Sign in at Pinterest Developers.
-
Create or open your app.
-
Under Configure, add this exact redirect URI:
http://127.0.0.1:3333/oauth/callback -
Copy your App ID and App secret key.
-
Request the scopes your workflow needs. At minimum, connection testing commonly uses read scopes such as
boards:read,pins:read, anduser_accounts:read. -
For sandbox testing, keep
PINTEREST_ENVIRONMENT=sandbox. Pinterest uses the same OAuth authorize page for both environments; token exchange uses the sandbox API host when sandbox is selected.
Local setup
pnpm install
cp .env.example .env
Edit .env and set at minimum:
PINTEREST_ENVIRONMENT=sandbox
PINTEREST_APP_ID=your-app-id
PINTEREST_APP_SECRET=your-app-secret
PINTEREST_TOKEN_ENCRYPTION_KEY=your-base64-key
PINTEREST_OAUTH_SCOPES=boards:read,pins:read,user_accounts:read
Generate an encryption key:
openssl rand -base64 32
Development
pnpm dev # watch mode (tsx)
pnpm build # compile to dist/
pnpm start # run compiled server
pnpm verify # typecheck, lint, test, build
MCP client configuration (Cursor)
Add a project-scoped MCP server entry in .cursor/mcp.json (recommended) or your user MCP settings. Do not commit real secrets.
{
"mcpServers": {
"pinterest-business": {
"command": "node",
"args": ["/absolute/path/to/pinterest-business-mcp/dist/index.js"],
"env": {
"PINTEREST_ENVIRONMENT": "sandbox",
"PINTEREST_APP_ID": "your-app-id",
"PINTEREST_APP_SECRET": "your-app-secret",
"PINTEREST_TOKEN_ENCRYPTION_KEY": "your-base64-key",
"PINTEREST_OAUTH_SCOPES": "boards:read,pins:read,user_accounts:read",
"PINTEREST_WRITES_ENABLED": "false",
"LOG_LEVEL": "info"
}
}
}
}
Restart Cursor after changing MCP configuration.
Connecting your Pinterest Business account
- Start the MCP server in Cursor.
- Call
pinterest_get_authorization_url. - Open the returned authorization URL in your browser.
- Approve the Pinterest app when prompted.
- Wait for the local callback page at
http://127.0.0.1:3333/oauth/callbackto report success. - Call
pinterest_connection_statusto confirm the connection.
The MCP server never asks for your Pinterest password. Authentication happens only on Pinterest's official OAuth page.
Sandbox setup
- Set
PINTEREST_ENVIRONMENT=sandbox. - Use the same redirect URI:
http://127.0.0.1:3333/oauth/callback. - OAuth authorization still starts at
https://www.pinterest.com/oauth/. - Token exchange and refresh use
https://api-sandbox.pinterest.com/v5/oauth/token.
Tools
pinterest_server_status
Returns server metadata and configuration flags only — never credential values.
pinterest_get_authorization_url
Starts the local callback listener on 127.0.0.1:3333, creates a single-use OAuth state value, and returns the Pinterest authorization URL plus safe instructions. Tokens are never returned by this tool.
Optional input:
scopes: array of official Pinterest scopes. If omitted,PINTEREST_OAUTH_SCOPESis used.
pinterest_connection_status
Reports whether a Pinterest account is connected locally, including scope and expiry metadata. Tokens are never returned. Expired access tokens are refreshed automatically when a valid refresh token is available.
pinterest_disconnect
Securely removes locally stored OAuth authorization data. To revoke access on Pinterest itself, remove the app from Pinterest settings under Security and logins → Apps.
Environment variables
See .env.example for the full list.
| Variable | Required | Description |
|---|---|---|
PINTEREST_ENVIRONMENT |
Yes | sandbox or production |
PINTEREST_APP_ID |
OAuth | Pinterest app ID |
PINTEREST_APP_SECRET |
OAuth | Pinterest app secret |
PINTEREST_TOKEN_ENCRYPTION_KEY |
OAuth | Base64 or passphrase used for AES-256-GCM token encryption |
PINTEREST_TOKEN_STORE_PATH |
No | Encrypted token file path (default: .tokens/pinterest-oauth.enc) |
PINTEREST_OAUTH_SCOPES |
OAuth | Default scopes unless overridden by the authorization tool |
PINTEREST_WRITES_ENABLED |
No | true or false (default: false) |
LOG_LEVEL |
No | debug, info, warn, or error |
Troubleshooting
| Problem | What to check |
|---|---|
| Callback port already in use | Another OAuth attempt or process is using 127.0.0.1:3333. Wait for it to finish or stop the other process. |
| Redirect URI mismatch | The Pinterest app must contain the exact URI http://127.0.0.1:3333/oauth/callback. |
| Missing scopes | Set PINTEREST_OAUTH_SCOPES or pass scopes to pinterest_get_authorization_url. |
| Connection not stored | Confirm PINTEREST_TOKEN_ENCRYPTION_KEY is set and writable, then repeat the OAuth flow. |
| Sandbox token exchange failed | Keep PINTEREST_ENVIRONMENT=sandbox so token exchange uses the sandbox API host. |
| Refresh failed | Reconnect with pinterest_get_authorization_url if the refresh token expired or was revoked. |
Token revocation and disconnect
- Local disconnect: call
pinterest_disconnect. - Pinterest-side revocation: open Pinterest settings → Security and logins → Apps and remove this app.
- Pinterest's remote revocation endpoint is unreliable in some app states, so local disconnect plus manual app removal is the supported recovery path.
Security
See SECURITY.md for credential handling and threat boundaries.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。