diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json new file mode 100644 index 0000000..a0224f0 --- /dev/null +++ b/.claude-plugin/marketplace.json @@ -0,0 +1,30 @@ +{ + "name": "perplexity", + "owner": { + "name": "Perplexity AI", + "email": "support@perplexity.ai", + "url": "https://www.perplexity.ai" + }, + "metadata": { + "description": "Official Perplexity AI plugins for Claude Code, providing real-time web search, reasoning, and research capabilities through Sonar models and the Search API", + "version": "1.0.0" + }, + "plugins": [ + { + "name": "perplexity-mcp-server", + "source": "./plugins/perplexity-mcp-server", + "description": "Official MCP server for Perplexity API Platform providing AI assistants with real-time web search, reasoning, and research capabilities through Sonar models and the Search API.", + "version": "0.2.2", + "author": { + "name": "Perplexity AI", + "url": "https://www.perplexity.ai" + }, + "keywords": ["ai", "perplexity", "mcp", "modelcontextprotocol", "search", "reasoning", "research", "sonar"], + "category": "ai-tools", + "license": "MIT", + "homepage": "https://docs.perplexity.ai/guides/mcp-server", + "repository": "https://github.com/perplexityai/modelcontextprotocol", + "strict": false + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index f7d4707..ade8d8d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,25 @@ Advanced reasoning and problem-solving using the `sonar-reasoning-pro` model. Pe 2. Set it as an environment variable: `PERPLEXITY_API_KEY=your_key_here` 3. (Optional) Set a timeout for requests: `PERPLEXITY_TIMEOUT_MS=600000`. The default is 5 minutes. -### Claude Code +### Claude Code Plugin (Recommended) + +**Easy Installation via Plugin Marketplace:** + +1. Add the Perplexity marketplace: + ```bash + /plugin marketplace add perplexityai/modelcontextprotocol + ``` + +2. Install the plugin: + ```bash + /plugin install perplexity-mcp-server@perplexity + ``` + +3. Configure your API key when prompted. + +This method provides automatic updates and easier management through Claude Code's plugin system. + +**Manual MCP Configuration:** Run in your terminal: @@ -115,5 +133,4 @@ npx @perplexity-ai/mcp-server For support, visit [community.perplexity.ai](https://community.perplexity.ai) or [file an issue](https://github.com/perplexityai/modelcontextprotocol/issues). ---- - +--- \ No newline at end of file diff --git a/plugins/perplexity-mcp-server/.claude-plugin/plugin.json b/plugins/perplexity-mcp-server/.claude-plugin/plugin.json new file mode 100644 index 0000000..e6bca66 --- /dev/null +++ b/plugins/perplexity-mcp-server/.claude-plugin/plugin.json @@ -0,0 +1,23 @@ +{ + "name": "perplexity-mcp-server", + "version": "0.2.2", + "description": "Official MCP server for Perplexity API Platform providing AI assistants with real-time web search, reasoning, and research capabilities through Sonar models and the Search API.", + "author": { + "name": "Perplexity AI", + "url": "https://www.perplexity.ai" + }, + "homepage": "https://docs.perplexity.ai/guides/mcp-server", + "repository": "https://github.com/perplexityai/modelcontextprotocol", + "license": "MIT", + "keywords": ["ai", "perplexity", "mcp", "modelcontextprotocol", "search", "reasoning", "research", "sonar"], + "category": "ai-tools", + "mcpServers": "./.mcp.json", + "engines": { + "node": ">=18" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.1", + "axios": "^1.6.2", + "dotenv": "^16.3.1" + } +} \ No newline at end of file diff --git a/plugins/perplexity-mcp-server/.mcp.json b/plugins/perplexity-mcp-server/.mcp.json new file mode 100644 index 0000000..59be17f --- /dev/null +++ b/plugins/perplexity-mcp-server/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "perplexity": { + "command": "npx", + "args": ["-y", "@perplexity-ai/mcp-server"], + "env": { + "PERPLEXITY_API_KEY": "", + "PERPLEXITY_TIMEOUT_MS": "300000" + } + } + } +} \ No newline at end of file diff --git a/plugins/perplexity-mcp-server/README.md b/plugins/perplexity-mcp-server/README.md new file mode 100644 index 0000000..891d81a --- /dev/null +++ b/plugins/perplexity-mcp-server/README.md @@ -0,0 +1,65 @@ +# Perplexity MCP Server Plugin + +Official Claude Code plugin for the Perplexity MCP Server, providing AI assistants with real-time web search, reasoning, and research capabilities through Sonar models and the Search API. + +## Features + +- **perplexity_search**: Direct web search using the Perplexity Search API with ranked results and metadata +- **perplexity_ask**: General-purpose conversational AI with real-time web search using the `sonar-pro` model +- **perplexity_research**: Deep, comprehensive research using the `sonar-deep-research` model +- **perplexity_reason**: Advanced reasoning and problem-solving using the `sonar-reasoning-pro` model + +## Installation + +### Prerequisites + +1. Get your Perplexity API Key from the [API Portal](https://www.perplexity.ai/account/api/group) +2. Have Claude Code installed and running + +### Quick Install + +1. Add the Perplexity marketplace to Claude Code: + ``` + /plugin marketplace add perplexityai/modelcontextprotocol + ``` + +2. Install the plugin: + ``` + /plugin install perplexity-mcp-server@perplexity + ``` + +3. Configure your API key when prompted, or set it manually in your Claude Code settings. + +### Manual Configuration + +If you need to set your API key manually: + +1. Open Claude Code settings +2. Navigate to MCP Servers +3. Find the "perplexity" server configuration +4. Set the `PERPLEXITY_API_KEY` environment variable to your API key +5. Optionally adjust `PERPLEXITY_TIMEOUT_MS` (default: 300000ms = 5 minutes) + +## Usage + +Once installed, you can use the Perplexity tools in your conversations with Claude: + +- Ask questions that require current information +- Request research on specific topics +- Ask for reasoning through complex problems +- Search for specific information on the web + +Claude will automatically use the appropriate Perplexity tool based on your request. + +## Troubleshooting + +- **API Key Issues**: Ensure `PERPLEXITY_API_KEY` is set correctly in your MCP server configuration +- **Connection Errors**: Check your internet connection and API key validity +- **Timeout Errors**: For very long research queries, increase `PERPLEXITY_TIMEOUT_MS` value + +## Support + +For support: +- Visit [community.perplexity.ai](https://community.perplexity.ai) +- [File an issue](https://github.com/perplexityai/modelcontextprotocol/issues) on GitHub +- Check the [official documentation](https://docs.perplexity.ai/guides/mcp-server)