Perplexity搜索
STDIO让大语言模型访问Perplexity搜索API的服务
让大语言模型访问Perplexity搜索API的服务
A Go implementation of a Perplexity Search MCP server that allows large language models (LLMs) to access the Perplexity search API through the Model Context Protocol (MCP).
query (string, required): The search querysearch_recency_filter (string, optional): Filter results by time (month, week, day, hour)max_tokens (integer, optional): Maximum number of tokens to returntemperature (number, optional, default: 0.2): Controls randomness in responsetop_p (number, optional, default: 0.9): Nucleus sampling thresholdsearch_domain_filter (array, optional): List of domains to limit search resultsreturn_images (boolean, optional): Include image links in resultsreturn_related_questions (boolean, optional): Include related questionstop_k (number, optional, default: 0): Number of tokens for top-k filteringstream (boolean, optional): Stream response incrementallypresence_penalty (number, optional, default: 0): Adjust likelihood of new topicsfrequency_penalty (number, optional, default: 1): Reduce repetitionweb_search_options (object, optional): Configuration options for web searchTo install Perplexity Search Golang for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @chenxilol/perplexity-mcp-go --client claude
git clone https://github.com/chenxilol/perplexity-mcp-go.git cd perplexity-mcp-go
go build -o perplexity-search-mcp
export PERPLEXITY_API_KEY="your-api-key-here"
./perplexity-search-mcp
Copy the provided claude_desktop_config.json to your Claude configuration directory:
%USERPROFILE%\AppData\Roaming\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonEdit the configuration file to include your API key:
{ "mcpServers": { "perplexity-search": { "command": "/path/to/perplexity-search-mcp", "env": { "PERPLEXITY_API_KEY": "your-api-key-here" } } } }
docker build -t perplexity-search-mcp:latest .
docker run -i --rm -e PERPLEXITY_API_KEY=your-api-key-here perplexity-search-mcp:latest
Once configured, Claude can use the perplexity_search tool via MCP to perform real-time web searches.
Example search with parameters:
{ "query": "latest AI research developments", "search_recency_filter": "week", "temperature": 0.5, "return_related_questions": true, "web_search_options": { "search_context_size": "high" } }
If you encounter issues:
This project is licensed under the MIT License - see the LICENSE file for details.