Integrations
Allows searching for images on Pinterest by keywords and retrieving detailed information about Pinterest images
Pinterest MCP Server
A Model Context Protocol (MCP) server for Pinterest image search and information retrieval.
Features
- Search for images on Pinterest by keywords
- Retrieve detailed information about Pinterest images
- Seamless integration with Cursor IDE through MCP
- Support for headless browser mode
- Limit control for search results
- Search and download images from Pinterest
Prerequisites
- Node.js (v18 or higher)
- Cursor IDE for MCP integration
Installation
Using NPX (Recommended)
The easiest way to use Pinterest MCP Server is via npx:
You can configure the server with command-line options:
Global Installation
To install the package globally and use it directly from the command line:
After installation, you can run the server with:
With the same command line options as the NPX version:
Installing via Smithery
To install mcp-pinterest for Claude Desktop automatically via Smithery:
Manual Installation
- Clone this repository:Copy
- Install dependencies:Copy
- Build the server:Copy
- Run the server:Copy
Configuring as MCP Server in Cursor
- Open Cursor IDE
- Go to Settings (⚙️) > Extensions > MCP
- Click "Add Server"
- Enter the following details:
- Name: Pinterest MCP
- Type: Command
- Command:
node
- Args:
["/path/to/mcp-pinterest/dist/pinterest-mcp-server.js"]
或者直接编辑Cursor的MCP配置文件(通常位于
~/.cursor/mcp.json
),添加以下内容:Copy - Click "Save"
Alternative: Using NPX for Cursor Configuration
You can also configure Cursor to use the npx version of the server:
- Open Cursor IDE
- Go to Settings (⚙️) > Extensions > MCP
- Click "Add Server"
- Enter the following details:
- Name: Pinterest MCP
- Type: Command
- Command:
npx
- Args:
["pinterest-mcp-server"]
- Click "Save"
Complete Configuration Example with Environment Variables
For the most flexibility, you can configure the server with environment variables in your Cursor MCP configuration:
This configuration:
- Uses npx to run the server
- Sets a custom download directory on your desktop
- Uses a custom filename template with both image ID and timestamp
- Configures a proxy server for users in regions where Pinterest might be blocked
Add this to your ~/.cursor/mcp.json
file or set up through the Cursor IDE interface.
Available MCP Functions
The server exposes the following MCP functions:
pinterest_search
: Search for images on Pinterest by keyword- Parameters:
keyword
: Search term (required)limit
: Number of images to return (default: 10)headless
: Whether to use headless browser mode (default: true)
- Parameters:
pinterest_get_image_info
: Get detailed information about a Pinterest image- Parameters:
image_url
: URL of the Pinterest image (required)
- Parameters:
pinterest_search_and_download
: Search and download images from Pinterest- Parameters:
keyword
: Search term (required)limit
: Number of images to return (default: 10)headless
: Whether to use headless browser mode (default: true)
- Parameters:
Example Usage in Cursor
Once configured, you can use the Pinterest MCP functions directly in Cursor's AI chat:
The AI will use the MCP server to search Pinterest and display the results.
Example Screenshot
Screenshot showing a search for 20 images of 三上悠亚 with all images successfully downloaded.
Development
Project Structure
pinterest-mcp-server.ts
: Main server filedist/pinterest-mcp-server.js
: Built JavaScript file for productionpackage.json
: Project configuration and dependencies
Adding New Features
To add new MCP functions:
- Modify
pinterest-mcp-server.ts
- Register new functions using the MCP SDK
- Implement the function logic
- Rebuild with
npm run build
Troubleshooting
- If the server fails to start, check if the port is already in use
- Ensure all dependencies are correctly installed with
npm install
- Make sure TypeScript is properly configured with a
tsconfig.json
file - If you encounter build errors, try running
npm install -D typescript @types/node
- Verify network connectivity for Pinterest access
License
This project is licensed under the MIT License - see the LICENSE file for details.
Configuration Options
Command Line Options (NPX Mode)
When using the server via npx, you can configure it using the following command line options:
--downloadDir
: Specifies the root directory for downloading imagesCopy--filenameTemplate
: Specifies the filename template for downloaded imagesCopy--port
: Specifies the port for the server to listen on (default: 3000)Copy--proxyServer
: Specifies the proxy server to use for connecting to PinterestCopy
You can combine multiple options:
Environment Variables
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 ispinterest_{imageId}.{fileExtension}
.MCP_PINTEREST_PROXY_SERVER
: Specifies the proxy server to use for connecting to Pinterest. Format should beprotocol://host:port
, for examplehttp://127.0.0.1:7890
orsocks5://127.0.0.1:1080
.
These environment variables can be set in several ways:
- Directly in your terminal (as shown in the examples below)
- In your Cursor MCP configuration through the
env
field (see Complete Configuration Example) - In a
.env
file in the project root directory - Through command line options with npx (as shown in the Command Line Options section)
Usage
Setting Download Directory
- Using npx with command line options:
- Set the download directory using an environment variable:
- If the environment variable is not set, the server will use the default download directory (relative to the server script's
../downloads
).
Setting Filename Template
- Using npx with command line options:
- Using an environment variable:
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.
Setting Proxy Server
If you need to use a proxy to access Pinterest (especially in regions where Pinterest might be restricted), you can set the proxy configuration:
- Using npx with command line options:
- Using an environment variable:
Supported proxy protocols:
- HTTP:
http://host:port
- HTTPS:
https://host:port
- SOCKS4:
socks4://host:port
- SOCKS5:
socks5://host:port
The proxy configuration affects both the browser used for searching and the image downloading process.
Notes
- The server will verify the existence and writability of the download directory when starting. If the directory does not exist, it will attempt to create it; if it cannot be created or written to, the server will exit.
- Clients should not specify download paths or filename templates through parameters when calling download-related tools, as all downloads will use the server's environment variable configuration or defaults.
- The server automatically sanitizes filenames by replacing illegal characters (such as
/
,\
,:
,*
,?
,"
,<
,>
,|
) with underscores.
Interface Description
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 images
For detailed interface parameter references, please refer to the MCP tool definitions.
This server cannot be installed
A Pinterest Model Context Protocol (MCP) server for image search and information retrieval
- Features
- Prerequisites
- Installation
- Configuring as MCP Server in Cursor
- Available MCP Functions
- Example Usage in Cursor
- Development
- Troubleshooting
- License
- Configuration Options
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityModel Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.Last updated -127815JavaScriptMIT License
- AsecurityAlicenseAqualityThis MCP server aids users in searching and analyzing their photo library by location, labels, and people, offering functionalities like photo analysis and fuzzy matching for enhanced photo management.Last updated -14PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.Last updated -226PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.Last updated -PythonMIT License