MCP服务器板和引脚
一 MCP(模型上下文协议) 让Claude与Pinterest交互的服务器-通过Pinterest API v5浏览、创建和管理板、引脚、部分和用户配置文件。
特性
- 使用基于书签的分页浏览板和引脚
- 从图像URL创建板、部分和引脚
- 在电路板和部分之间更新和移动引脚
- 按关键字搜索引脚
- 直接在Claude内部查看pin图像(base64图像块)
- OAuth 2.0,带有自动令牌刷新或直接访问令牌
需求
- Node.js>=20
- Pinterest帐户和应用程序(请参阅 配置)
快速开始
git clone https://github.com/sapyx/sapyx-mcp.git
cd sapyx-mcp
npm install
npm run build复制环境模板并填写您的凭据:
cp .env.example .env然后将服务器添加到MCP客户端(请参阅 配置).
认证
支持两种模式:
| 模式 | 环境变量 | 访问 |
|---|---|---|
| 直接代币 | PINTEREST_ACCESS_TOKEN | 只读 |
| OAuth 2.0 | PINTEREST_APP_ID + PINTEREST_APP_SECRET | 完全读写 |
对于OAuth,通过以下方式触发流 pinterest_auth 工具。代币存储在 ~/.mcp-credentials/pinterest-tokens.json 并自动刷新。
详细信息: docs/authentication.md
工具
四组共14种工具:
| 组 | 工具 |
|---|---|
| 认证 | pinterest_auth, pinterest_auth_status |
| 板子 | list_boards, create_board, list_board_sections, create_board_section |
| 图钉 | list_pins, get_pin, get_pin_image, update_pin, move_pin, create_pin |
| 搜索 | search_pins, get_user_profile |
完整参考: docs/tools.md
项目结构
src/
index.ts # Entry point — env validation, server setup, STDIO transport
auth.ts # OAuth 2.0 flow, token storage, refresh logic
api.ts # Typed HTTP client wrapping Pinterest API v5
types.ts # TypeScript interfaces (Pin, Board, tokens, etc.)
tools/
auth.ts # pinterest_auth, pinterest_auth_status
boards.ts # list_boards, create_board, list_board_sections, create_board_section
pins.ts # list_pins, get_pin, get_pin_image, update_pin, move_pin, create_pin
search.ts # search_pins, get_user_profile
docs/
authentication.md # OAuth flow, token storage, refresh logic
tools.md # Full tool reference with parameters
api-client.md # Internal API client documentation
configuration.md # Env vars, MCP client setup, Pinterest app setup技术栈
- 语言: TypeScript(ES2022,Node16模块)
- 运行时间: Node.js>=20
- MCP框架:
@modelcontextprotocol/sdk - 验证: 黄道带
- 运输: 工作室
