Perplexity MCP Server

Perplexity MCP Server

Okay, I understand. You want to perform a web search using Perplexity to get information for an MCP (presumably a topic you'll provide later), and you want to do this *without* using any API keys. Here's the breakdown of why that's tricky and what options you *might* have, along with their limitations: **Why It's Difficult (and why API keys exist):** * **Perplexity's Design:** Perplexity is designed to be accessed primarily through its official website or its API. The API is the intended way for developers to programmatically access its search and summarization capabilities. APIs are protected by API keys to: * **Control Usage:** Prevent abuse and ensure fair access to resources. * **Track Usage:** Monitor how the service is being used for billing and performance analysis. * **Enforce Terms of Service:** Ensure users adhere to the rules of the platform. * **Web Scraping Challenges:** The alternative to using an API is web scraping (programmatically extracting data from a website). This is generally discouraged and can be problematic: * **Terms of Service Violation:** Most websites (including Perplexity) explicitly prohibit scraping in their terms of service. Violating these terms can lead to your IP address being blocked. * **Website Structure Changes:** Websites change their HTML structure frequently. A scraper that works today might break tomorrow. * **Rate Limiting:** Websites often implement rate limiting to prevent scrapers from overloading their servers. You'll likely be blocked if you make too many requests too quickly. * **Ethical Considerations:** Scraping can put a strain on the website's resources and potentially disrupt service for other users. **Possible (But Limited and Potentially Unreliable) Approaches:** 1. **Manual Search and Copy-Pasting:** * **How it works:** The simplest approach is to manually go to the Perplexity website (perplexity.ai), enter your MCP search query, and then copy and paste the results into your own document or application. * **Pros:** No code required, avoids violating terms of service. * **Cons:** Extremely tedious and time-consuming for anything beyond a few searches. Not automated. 2. **Very Basic Web Scraping (Use with Extreme Caution):** * **Disclaimer:** I strongly advise against this unless you understand the risks and are prepared to deal with potential blocking or legal issues. *Only use this for very small, infrequent, and non-commercial purposes.* * **How it *might* work (but likely won't for long):** * **Inspect the Perplexity Website:** Use your browser's developer tools (usually by pressing F12) to examine the HTML structure of the Perplexity search results page. Identify the HTML elements that contain the search results you want (e.g., `<div>` tags, `<p>` tags, etc.). * **Use a Web Scraping Library:** Use a Python library like `requests` to fetch the HTML content of the Perplexity search results page for your query. Then, use a library like `Beautiful Soup` to parse the HTML and extract the data you identified in the previous step. * **Example (Conceptual - Likely to Break):** ```python import requests from bs4 import BeautifulSoup query = "Your MCP Search Query Here" # Replace with your actual query url = f"https://www.perplexity.ai/search?q={query}" #This is a guess at the URL structure try: response = requests.get(url) response.raise_for_status() # Raise an exception for bad status codes (404, 500, etc.) soup = BeautifulSoup(response.content, "html.parser") # **THIS IS THE TRICKY PART - YOU NEED TO FIND THE RIGHT HTML ELEMENTS** # Example: Let's say the search results are in <div> tags with class "result-item" results = soup.find_all("div", class_="result-item") for result in results: # Extract the text from each result (adjust based on the actual HTML) text = result.text.strip() print(text) except requests.exceptions.RequestException as e: print(f"Error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") ``` * **Pros:** Potentially automates the search process (but very fragile). * **Cons:** * **High risk of being blocked.** * **Very likely to break due to website changes.** * **Potentially violates Perplexity's terms of service.** * **Requires programming knowledge.** * **No guarantee of accurate or complete results.** **Important Considerations:** * **Ethical Scraping:** If you absolutely must scrape, be respectful: * **Identify Yourself:** Set a `User-Agent` header in your `requests` call to identify your script and provide contact information. * **Rate Limiting:** Introduce delays between requests (e.g., using `time.sleep()`) to avoid overloading the server. * **Check `robots.txt`:** Examine the website's `robots.txt` file (e.g., `perplexity.ai/robots.txt`) to see if there are any specific rules about which pages you are allowed to crawl. * **Consider Alternatives:** Before resorting to scraping, explore other search engines that might offer more accessible APIs or data feeds (even if they aren't exactly Perplexity). **In summary, performing a Perplexity web search without an API key is highly discouraged and comes with significant risks and limitations. The manual approach is the safest, but the least efficient. Web scraping is technically possible, but ethically questionable and practically unreliable.** To give you a more specific answer, please tell me: 1. **What is the MCP you want to search for?** 2. **What is the *purpose* of this search?** (e.g., personal research, academic project, commercial application). This will help me understand the context and suggest more appropriate solutions. 3. **What is your level of programming experience?** Once I have this information, I can provide more tailored advice. However, I must reiterate that I cannot endorse or assist with any activity that violates a website's terms of service.

wysh3

远程shell执行
编程文档访问
数据库交互
AI集成系统
访问服务器

README

Perplexity MCP Zerver <a href="https://raw.githubusercontent.com/wysh3/perplexity-mcp-zerver/main/README.md" title="复制完整README内容(打开原始文件视图)">📋</a>

一个研究级别的模型上下文协议 (MCP) 服务器实现,通过与 Perplexity 网站交互,提供 AI 驱动的研究能力,而无需 API 密钥。

特性

  • 🔍 通过 Perplexity 的 Web 界面集成 Web 搜索。
  • 💬 持久的聊天历史记录,用于对话上下文。
  • 📄 用于文档检索、API 查找和代码分析的工具。
  • 🚫 无需 API 密钥(依赖于 Web 交互)。
  • 🛠️ TypeScript 优先的实现。
  • 🌐 使用 Puppeteer 进行浏览器自动化。

工具

1. 搜索 (search)

在 Perplexity.ai 上执行搜索查询。 支持 briefnormaldetailed 响应。 返回原始文本输出。

2. 获取文档 (get_documentation)

要求 Perplexity 提供关于技术/库的文档和示例,可以选择专注于特定上下文。 返回原始文本输出。

3. 查找 API (find_apis)

要求 Perplexity 根据需求和上下文查找和评估 API。 返回原始文本输出。

4. 检查已弃用的代码 (check_deprecated_code)

要求 Perplexity 分析代码片段,以查找特定技术上下文中已弃用的功能。 返回原始文本输出。

5. 提取 URL 内容 (extract_url_content)

使用浏览器自动化和 Mozilla 的 Readability 从 URL 中提取主要文章文本内容。 通过 gitingest.com 处理 GitHub 存储库。 支持递归链接探索,最多可达深度。 返回包含内容和元数据的结构化 JSON。

6. 聊天 (chat_perplexity)

与 Perplexity AI 保持持续的对话。 将聊天历史记录本地存储在项目目录中的 chat_history.db 中。 返回一个字符串化的 JSON 对象,其中包含 chat_idresponse

安装

只需复制 <a href="https://raw.githubusercontent.com/wysh3/perplexity-mcp-zerver/main/README.md" title="复制完整README内容(打开原始文件视图)">📋</a> 并粘贴 readme,让 AI 处理剩下的事情

  1. 克隆或下载此存储库:
git clone https://github.com/wysh3/perplexity-mcp-zerver.git
cd perplexity-mcp-zerver
  1. 安装依赖项:
npm install
  1. 构建服务器:
npm run build

重要提示:确保已安装 Node.js。 如果需要在安装过程中,Puppeteer 将下载兼容的浏览器版本。 构建和配置项目后,重新启动 IDE/应用程序以使更改生效。

配置

将服务器添加到您的 MCP 配置文件(例如,VS Code 扩展的 cline_mcp_settings.json 或桌面应用程序的 claude_desktop_config.json)。

重要提示:/path/to/perplexity-mcp-zerver/build/index.js 替换为您系统上构建的 index.js 文件的绝对路径

Cline/RooCode 扩展的示例:

{
  "mcpServers": {
    "perplexity-server": {
      "command": "node",
      "args": [
        "/full/path/to/your/perplexity-mcp-zerver/build/index.js" // <-- 替换此路径! (如果是 Windows,例如:"C:\\Users\\$USER\\Documents\\Cline\\MCP\\perplexity-mcp-zerver\\build\\index.js"
      ],
      "env": {},
      "disabled": false,
      "alwaysAllow": [],
      "autoApprove": [],
      "timeout": 300
    }
  }
}

Claude Desktop 的示例:

{
  "mcpServers": {
    "perplexity-server": {
      "command": "node",
      "args": [
        "/full/path/to/your/perplexity-mcp-zerver/build/index.js" // <-- 替换此路径!
      ],
      "env": {},
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

用法

  1. 确保服务器已在您的 MCP 设置文件中正确配置。
  2. 重新启动您的 IDE(例如带有 Cline/RooCode 扩展的 VS Code)或 Claude Desktop 应用程序。
  3. MCP 客户端应自动连接到服务器。
  4. 现在您可以要求连接的 AI 助手(如 Claude)使用这些工具,例如:
    • “使用 perplexity-server search 查找有关 AI 的最新消息。”
    • “询问 perplexity-server get_documentation 关于 React hooks。”
    • “与 perplexity-server 启动关于量子计算的聊天。”

鸣谢

感谢 DaInfernalCoder:

许可证

本项目根据 GNU General Public License v3.0 获得许可 - 有关详细信息,请参阅 LICENSE.md 文件。 部分内容源自 MIT 许可的作品,如许可证文件中所述。

免责声明

本项目通过 Web 自动化 (Puppeteer) 与 Perplexity 网站交互。 仅用于教育和研究目的。 Web 抓取和自动化可能违反目标网站的服务条款。 作者不认可或鼓励任何未经授权的自动化或违反服务条款的行为。 请负责任地且合乎道德地使用。 此服务器的稳定性取决于 Perplexity 网站的结构保持一致。

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
AIO-MCP Server

AIO-MCP Server

🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。

精选
本地
Knowledge Graph Memory Server

Knowledge Graph Memory Server

为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。

精选
本地
Hyperbrowser

Hyperbrowser

欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:

精选
本地
https://github.com/Streen9/react-mcp

https://github.com/Streen9/react-mcp

react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

精选
本地
MCP Atlassian

MCP Atlassian

适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。

精选