Pinterest Image Search
STDIOA Model Context Protocol server for Pinterest image search and information retrieval.
A Model Context Protocol server for Pinterest image search and information retrieval.
A Model Context Protocol (MCP) server for Pinterest image search and information retrieval.
The easiest way to use Pinterest MCP Server is via npx:
npx pinterest-mcp-server
You can configure the server with command-line options:
# Specify download directory npx pinterest-mcp-server --downloadDir /path/to/downloads # Specify filename template npx pinterest-mcp-server --filenameTemplate "pinterest_{id}" # Specify both options npx pinterest-mcp-server --downloadDir ./images --filenameTemplate "pinterest_{id}"
To install the package globally and use it directly from the command line:
npm install -g pinterest-mcp-server
After installation, you can run the server with:
pinterest-mcp-server
With the same command line options as the NPX version:
pinterest-mcp-server --downloadDir /path/to/downloads --filenameTemplate "pinterest_{id}"
To install mcp-pinterest for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-pinterest --client claude
Clone this repository:
git clone https://github.com/terryso/mcp-pinterest.git pinterest-mcp-server cd pinterest-mcp-server
Install dependencies:
npm install
Build the server:
npm run build
Run the server:
npm start
Open Cursor IDE
Go to Settings (⚙️) > Extensions > MCP
Click "Add Server"
Enter the following details:
node
["/path/to/mcp-pinterest/dist/pinterest-mcp-server.js"]
或者直接编辑Cursor的MCP配置文件(通常位于~/.cursor/mcp.json
),添加以下内容:
"pinterest": { "command": "node", "args": ["/path/to/mcp-pinterest/dist/pinterest-mcp-server.js"] }
Click "Save"
You can also configure Cursor to use the npx version of the server:
npx
["pinterest-mcp-server"]
For the most flexibility, you can configure the server with environment variables in your Cursor MCP configuration:
"pinterest": { "command": "npx", "env": { "MCP_PINTEREST_DOWNLOAD_DIR": "/Users/xxx/Desktop/Images", "MCP_PINTEREST_FILENAME_TEMPLATE": "pin_{imageId}_{timestamp}.{fileExtension}", "MCP_PINTEREST_PROXY_SERVER": "http://127.0.0.1:7890" }, "args": ["pinterest-mcp-server"] }
This configuration:
Add this to your ~/.cursor/mcp.json
file or set up through the Cursor IDE interface.
The server exposes the following MCP functions:
pinterest_search
: Search for images on Pinterest by keyword
keyword
: Search term (required)limit
: Number of images to return (default: 10)headless
: Whether to use headless browser mode (default: true)pinterest_get_image_info
: Get detailed information about a Pinterest image
image_url
: URL of the Pinterest image (required)pinterest_search_and_download
: Search and download images from Pinterest
keyword
: Search term (required)limit
: Number of images to return (default: 10)headless
: Whether to use headless browser mode (default: true)Once configured, you can use the Pinterest MCP functions directly in Cursor's AI chat:
Search for robot images on Pinterest
The AI will use the MCP server to search Pinterest and display the results.
Screenshot showing a search for 20 images of 三上悠亚 with all images successfully downloaded.
pinterest-mcp-server.ts
: Main server filedist/pinterest-mcp-server.js
: Built JavaScript file for productionpackage.json
: Project configuration and dependenciesTo add new MCP functions:
pinterest-mcp-server.ts
npm run build
npm install
tsconfig.json
filenpm install -D typescript @types/node
This project is licensed under the MIT License - see the LICENSE file for details.
When using the server via npx, you can configure it using the following command line options:
--downloadDir
: Specifies the root directory for downloading images
npx pinterest-mcp-server --downloadDir /path/to/downloads
--filenameTemplate
: Specifies the filename template for downloaded images
npx pinterest-mcp-server --filenameTemplate "pin_{imageId}_{timestamp}"
--port
: Specifies the port for the server to listen on (default: 3000)
npx pinterest-mcp-server --port 8080
--proxyServer
: Specifies the proxy server to use for connecting to Pinterest
npx pinterest-mcp-server --proxyServer "http://127.0.0.1:7890"
You can combine multiple options:
npx pinterest-mcp-server --downloadDir ./images --filenameTemplate "pinterest_{id}" --port 8080 --proxyServer "http://127.0.0.1:7890"
The server also supports the following environment variables for configuration:
MCP_PINTEREST_DOWNLOAD_DIR
: Specifies the root directory for downloading images. If not set, the default is the ../downloads
directory relative to the server script.MCP_PINTEREST_FILENAME_TEMPLATE
: Specifies the filename template for downloaded images. If not set, the default is pinterest_{imageId}.{fileExtension}
.MCP_PINTEREST_PROXY_SERVER
: Specifies the proxy server to use for connecting to Pinterest. Format should be protocol://host:port
, for example http://127.0.0.1:7890
or socks5://127.0.0.1:1080
.These environment variables can be set in several ways:
env
field (see Complete Configuration Example).env
file in the project root directorynpx pinterest-mcp-server --downloadDir /path/to/your/download/directory
# Linux/macOS export MCP_PINTEREST_DOWNLOAD_DIR=/path/to/your/download/directory npx pinterest-mcp-server # Windows (CMD) set MCP_PINTEREST_DOWNLOAD_DIR=C:\path\to\your\download\directory npx pinterest-mcp-server # Windows (PowerShell) $env:MCP_PINTEREST_DOWNLOAD_DIR="C:\path\to\your\download\directory" npx pinterest-mcp-server
../downloads
).npx pinterest-mcp-server --filenameTemplate "pin_{imageId}_{timestamp}.{fileExtension}"
# Linux/macOS export MCP_PINTEREST_FILENAME_TEMPLATE="pin_{imageId}_{timestamp}.{fileExtension}" npx pinterest-mcp-server # Windows (CMD) set MCP_PINTEREST_FILENAME_TEMPLATE="pin_{imageId}_{timestamp}.{fileExtension}" npx pinterest-mcp-server # Windows (PowerShell) $env:MCP_PINTEREST_FILENAME_TEMPLATE="pin_{imageId}_{timestamp}.{fileExtension}" npx pinterest-mcp-server
The template supports the following variables:
{imageId}
: The unique ID of the Pinterest image{fileExtension}
: The file extension (e.g., jpg, png){timestamp}
: Current UTC timestamp in YYYYMMDDHHMMSS format{index}
: The index number when downloading multiple images (starts from 1)Example templates:
pinterest_{imageId}.{fileExtension}
(default)pin_{timestamp}_{imageId}.{fileExtension}
pinterest_image_{index}_{imageId}.{fileExtension}
{timestamp}_pinterest.{fileExtension}
If the template is invalid (e.g., contains unsupported variables or has mismatched brackets), the server will log a warning and use the default template.
If you need to use a proxy to access Pinterest (especially in regions where Pinterest might be restricted), you can set the proxy configuration:
npx pinterest-mcp-server --proxyServer "http://127.0.0.1:7890"
# Linux/macOS export MCP_PINTEREST_PROXY_SERVER="http://127.0.0.1:7890" npx pinterest-mcp-server # Windows (CMD) set MCP_PINTEREST_PROXY_SERVER=http://127.0.0.1:7890 npx pinterest-mcp-server # Windows (PowerShell) $env:MCP_PINTEREST_PROXY_SERVER="http://127.0.0.1:7890" npx pinterest-mcp-server
Supported proxy protocols:
http://host:port
https://host:port
socks4://host:port
socks5://host:port
The proxy configuration affects both the browser used for searching and the image downloading process.
/
, \
, :
, *
, ?
, "
, <
, >
, |
) with underscores.The server provides the following MCP tools:
pinterest_search
: Search for Pinterest images by keywordpinterest_get_image_info
: Get detailed information about a Pinterest imagepinterest_search_and_download
: Search and download Pinterest imagesFor detailed interface parameter references, please refer to the MCP tool definitions.