Perplexity Web Search MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Supports loading API keys from .env files, providing a secure way to configure the server without hardcoding sensitive information.

  • Includes specific configuration instructions for Claude Desktop on macOS, detailing the path to the configuration file.

  • Provides web search functionality through Perplexity's API, allowing for comprehensive search results with sources and citations, and filtering by time period (day, week, month, year).

Perplexity 웹 검색 MCP 서버

Perplexity API를 사용하여 웹 검색 기능을 제공하는 간단한 MCP(Model Context Protocol) 서버입니다. 이 서버를 통해 Claude 또는 다른 MCP 호환 AI 비서가 웹을 검색하고 최신 정보를 얻을 수 있습니다.

특징

  • Perplexity의 강력한 검색 기능으로 웹을 검색하세요
  • 출처와 인용을 포함한 포괄적인 검색 결과를 얻으세요
  • 기간(일, 주, 월, 년)별로 결과를 필터링합니다.
  • 웹 검색을 위한 즉시 사용 가능한 프롬프트 템플릿이 포함되어 있습니다.
  • 환경 변수 또는 .env 파일에서 API 키 로드를 지원합니다.

설치

  1. 이 저장소를 복제하세요
  2. 종속성 설치:지엑스피1또는
    uv pip install -e .

구성

Perplexity API 키로 PERPLEXITY_API_KEY 환경 변수를 설정할 수 있습니다.

export PERPLEXITY_API_KEY="your-api-key-here"

또는 프로젝트 루트에 다음 내용이 포함된 .env 파일을 만들 수 있습니다.

PERPLEXITY_API_KEY=your-api-key-here

참조용으로 샘플 .env.example 파일이 제공됩니다.

Perplexity API 키를 얻으려면:

  1. Perplexity API 설정 방문
  2. 계정이 없으면 계정을 만드세요
  3. API 키 생성

용법

서버 실행

python server.py

서버 테스트

포함된 테스트 스크립트를 사용하면 전체 MCP 서버를 실행하지 않고도 서버 기능을 테스트할 수 있습니다.

python test_server.py "your search query here" --recency month

--recency 에 대한 옵션은 다음과 같습니다: 일, 주, 월(기본값), 년

Claude Desktop과 함께 사용

  1. Claude Desktop 구성 파일을 편집하세요.
    • macOS의 경우: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json
  2. 다음 구성을 추가합니다.
    { "perplexity-mcp": { "env": { "PERPLEXITY_API_KEY": "your-api-key-here" }, "command": "python", "args": [ "/path/to/server.py" ] } }
  3. Claude Desktop을 다시 시작하세요

클로드에 대한 예시 프롬프트

  • "인공지능에 대한 최신 뉴스를 웹에서 검색하세요"
  • "Perplexity를 사용하여 지난주에 게시된 기후 변화에 대한 정보를 찾아보세요"
  • "지난 달 양자 컴퓨팅에 대한 최신 연구 논문을 검색하세요"

API 참조

도구: search_web(query: str, recency: str = "month") -> str

Perplexity API를 사용하여 웹을 검색하고 결과를 반환합니다.

매개변수:

  • query : 검색 쿼리 문자열
  • recency : 기간('일', '주', '월'(기본값), '년')별로 결과를 필터링합니다.

반환: 다음을 포함하는 포괄적인 텍스트 응답:

  1. 검색 결과의 자세한 요약
  2. 주요 사실 및 정보 발견
  3. 검증을 위한 URL이 있는 소스
  4. 상충되는 정보가 있는 경우

프롬프트: web_search_prompt(query: str, recency: str = "month") -> str

Perplexity를 사용하여 웹을 검색하기 위한 프롬프트 템플릿을 만듭니다.

매개변수:

  • query : 검색 쿼리
  • recency : 기간 필터 - '일', '주', '월'(기본값), 또는 '년'

반환: AI에 다음을 지시하는 형식화된 프롬프트 문자열:

  1. 지정된 쿼리를 검색합니다
  2. 지정된 기간의 결과에 집중하세요
  3. 주요 결과를 요약하세요
  4. 중요한 사실을 강조하세요
  5. 상충되는 정보를 언급하세요
  6. 링크로 출처 인용

특허

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Claude나 다른 MCP 호환 AI 도우미가 Perplexity API를 사용하여 웹을 검색하고 최신 정보를 얻을 수 있으며, 기간별로 결과를 필터링하는 기능이 있습니다.

  1. Features
    1. Installation
      1. Configuration
        1. Usage
          1. Running the server
          2. Testing the server
          3. Using with Claude Desktop
          4. Example Prompts for Claude
        2. API Reference
          1. Tool: search_web(query: str, recency: str = "month") -> str
          2. Prompt: web_search_prompt(query: str, recency: str = "month") -> str
        3. License
          ID: ewpzze4800