Cover image
Try Now
2025-03-06

困惑MCP服务器

3 years

Works with Finder

1

Github Watches

0

Github Forks

8

Github Stars

Perplexity Web Search MCP Server

A simple MCP (Model Context Protocol) server that provides web search functionality using the Perplexity API. This server allows Claude or other MCP-compatible AI assistants to search the web and get up-to-date information.

Features

  • Search the web with Perplexity's powerful search capabilities
  • Get comprehensive search results with sources and citations
  • Filter results by time period (day, week, month, year)
  • Includes a ready-to-use prompt template for web searches
  • Supports loading API key from environment variables or .env file

Installation

  1. Clone this repository
  2. Install dependencies:
    pip install -e .
    
    or
    uv pip install -e .
    

Configuration

You can set the PERPLEXITY_API_KEY environment variable with your Perplexity API key:

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

Alternatively, you can create a .env file in the project root with the following content:

PERPLEXITY_API_KEY=your-api-key-here

A sample .env.example file is provided for reference.

To get a Perplexity API key:

  1. Visit Perplexity API Settings
  2. Create an account if you don't have one
  3. Generate an API key

Usage

Running the server

python server.py

Testing the server

You can test the server functionality without running the full MCP server using the included test script:

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

Options for --recency are: day, week, month (default), year

Using with Claude Desktop

  1. Edit your Claude Desktop configuration file:

    • On macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%/Claude/claude_desktop_config.json
  2. Add the following configuration:

    {
      "perplexity-mcp": {
        "env": {
          "PERPLEXITY_API_KEY": "your-api-key-here"
        },
        "command": "python",
        "args": [
          "/path/to/server.py"
        ]
      }
    }
    
  3. Restart Claude Desktop

Example Prompts for Claude

  • "Search the web for the latest news about artificial intelligence"
  • "Use Perplexity to find information about climate change published in the past week"
  • "Search for recent research papers on quantum computing from the past month"

API Reference

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

Search the web using Perplexity API and return results.

Parameters:

  • query: The search query string
  • recency: Filter results by time period - 'day', 'week', 'month' (default), or 'year'

Returns: A comprehensive text response containing:

  1. A detailed summary of the search results
  2. Key facts and information found
  3. Sources with URLs for verification
  4. Any conflicting information if present

Prompt: web_search_prompt(query: str, recency: str = "month") -> str

Creates a prompt template for searching the web with Perplexity.

Parameters:

  • query: The search query
  • recency: Time period filter - 'day', 'week', 'month' (default), or 'year'

Returns: A formatted prompt string that instructs the AI to:

  1. Search for the specified query
  2. Focus on results from the specified time period
  3. Summarize key findings
  4. Highlight important facts
  5. Mention conflicting information
  6. Cite sources with links

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    1 (1)
    Avatar
    user_Wp7Litkj
    2025-04-15

    As a devoted MCP application user, I find the SQLite-Anet-MCP Server by marekkucak to be incredibly reliable and efficient. It seamlessly integrates with my workflow and offers robust performance. The server's design and functionality cater perfectly to my needs, making data management a breeze. Highly recommend!