Perplexity Claude研究助手
STDIO为Claude提供网络研究和引用功能
为Claude提供网络研究和引用功能
A custom MCP tool that integrates Perplexity AI's API with Claude Desktop, allowing Claude to perform web-based research and provide answers with citations.
Install Git:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
Install Node.js:
brew install node
Verify installations by running:
git --version node --version
git clone https://github.com/letsbuildagent/perplexity-tool cd perplexity-tool
npm install
You have two options:
Option 1 (Quick setup):
server.js
const PERPLEXITY_API_KEY = "YOUR-API-KEY-HERE";
Option 2 (Best practice):
Or simply create a new file named# On Mac/Linux: touch .env open .env # On Windows: notepad .env
.env
in your text editorPERPLEXITY_API_KEY=your-api-key-here
npm install dotenv
import 'dotenv/config' const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY;
~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "perplexity-tool": { "command": "node", "args": [ "/full/path/to/perplexity-tool/server.js" ] } } }
Replace /full/path/to
with the actual path where you cloned the repository.
Once installed, you can use the tool through Claude with commands like:
You can specify additional parameters:
temperature
: Controls response randomness (0-2)max_tokens
: Limits response lengthsearch_domain_filter
: Restricts search to specific domainssearch_recency_filter
: Filters by time period (day/week/month/year)Git not found:
Node.js errors:
node --version
API Key issues:
Tool not appearing in Claude:
MIT
If you're planning to share your code or make it public: