Swift Poe Search MCP

Swift Poe Search MCP

An MCP server that integrates with Poe's API to provide AI-powered search and research tools from Perplexity, Reka, Exa, and Linkup.

Category
访问服务器

README

Swift Poe Search MCP

A Swift MCP (Model Context Protocol) server providing AI-powered search and research tools via the Poe API proxy. Supports 4 providers with 16 specialized tools.

<p align="center"> If you found this helpful, you can support more open source work! <br><br> <a href="https://buymeacoffee.com/mehmetbaykar" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60"></a> </p>


Overview

This server acts as a bridge between MCP clients and multiple AI/search providers through Poe's unified API:

Provider Tools Description
Perplexity 3 Web search with citations, reasoning, deep research
Reka 3 Agentic research, fact-checking, similarity finding
Exa 9 Neural search, code context, company research, crawling
Linkup 1 #1 ranked factual accuracy on OpenAI's SimpleQA

Quick Start

Requirements

  • Poe subscription with API access
  • API key from poe.com/api_key
  • Linux: Ubuntu 20.04+ or Debian 11+, requires apt-get install libcurl4
  • macOS: macOS 14+ (Sonoma), Intel Macs supported via Rosetta
  • Swift: 6.2+ (for building from source)

Installation

Via NPM (no build required):

npx @mehmetbaykar/swift-poe-search-mcp@latest

Via Swift (build from source):

git clone https://github.com/mehmetbaykar/swift-poe-search-mcp.git
cd swift-poe-search-mcp
swift build -c release

Configuration

# Required
export POE_API_KEY=your_api_key

# Optional
export POE_BASE_URL=https://api.poe.com/v1  # default
export POE_TIMEOUT_MS=600000                 # default: 10 minutes
export ENABLED_PROVIDERS=perplexity,reka,exa,linkup  # default: all

MCP Client Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "swift-poe-search": {
      "command": "npx",
      "args": ["@mehmetbaykar/swift-poe-search-mcp@latest"],
      "env": {
        "POE_API_KEY": "your_api_key"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

{
  "mcpServers": {
    "swift-poe-search": {
      "command": "npx",
      "args": ["@mehmetbaykar/swift-poe-search-mcp@latest"],
      "env": {
        "POE_API_KEY": "your_api_key"
      }
    }
  }
}

Claude Code CLI

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "swift-poe-search": {
      "command": "npx",
      "args": ["@mehmetbaykar/swift-poe-search-mcp@latest"],
      "env": {
        "POE_API_KEY": "your_api_key"
      }
    }
  }
}

Testing with MCP Inspector

POE_API_KEY=your_key npx @modelcontextprotocol/inspector@latest swift run

Available Tools

Perplexity Tools

perplexity_ask

Conversational web search using Sonar API with 200k context.

Parameter Type Default Description
messages [Message] required Conversation messages
searchContextSize enum low low, medium, high
searchMode enum default default, academic, sec
searchDomainFilter string "" Comma-separated domains (prefix with - to exclude)
searchLanguageFilter string "" ISO 639-1 codes (max 10)
searchRecencyFilter enum none none, day, week, month, year
searchAfterDate string "" Publication date filter
searchBeforeDate string "" Publication date filter
country string "" ISO 3166-1 alpha-2 code
region string "" State/Province name
city string "" City name
latitude string "" Requires longitude + country
longitude string "" Requires latitude + country
returnImages bool false Include images
returnVideos bool false Include videos
imageDomainFilter string "" Domains for images (max 10)
imageFormatFilter string "" gif, jpg, png, webp

perplexity_reason

R1-1776 reasoning with web search via Sonar Reasoning Pro (128k context).

All parameters from perplexity_ask plus:

Parameter Type Default Description
showThinking bool false Show <think>...</think> reasoning tags

perplexity_research

Deep multi-step research via Perplexity Deep Research (128k context).

Parameter Type Default Description
messages [Message] required Conversation messages
showThinking bool false Show reasoning tags
reasoningEffort enum low low, medium, high
searchMode enum default Only "default" supported
searchDomainFilter string "" Comma-separated domains
searchAfterDateFilter string "" Date filter
searchBeforeDateFilter string "" Date filter
lastUpdatedAfterFilter string "" Update date filter
lastUpdatedBeforeFilter string "" Update date filter

Reka Tools

reka_research

Autonomous research agent with multi-hop web synthesis.

Parameter Type Default Description
messages [Message] required Conversation messages
showThinking bool false Show reasoning tags

reka_verify_claim

Fact-check claims with structured verdict, confidence, and reasoning.

Parameter Type Default Description
claim string required Statement to verify
showThinking bool false Show reasoning tags

reka_find_similar

Find items similar to a target based on specific attributes.

Parameter Type Default Description
target string required Item to find similarities for
attribute string required Characteristic to compare (e.g., "functionality", "style")
showThinking bool false Show reasoning tags

Exa Tools

exa_web_search

Real-time web search with extensive filtering options.

Parameter Type Default Description
query string required Search query
numResults int 10 Results count (1-100)
searchType enum auto auto, neural, deep, fast
category enum "" company, research paper, news, pdf, github, tweet, etc.
showContent bool false Display full page content
includeDomains string "" Domains to include
excludeDomains string "" Domains to exclude
includeText string "" Required text (max 5 words)
excludeText string "" Excluded text (max 5 words)
startCrawlDate string "" ISO 8601 date
endCrawlDate string "" ISO 8601 date
startPublishedDate string "" ISO 8601 date
endPublishedDate string "" ISO 8601 date
returnText bool true Fetch page text
textMaxChars string "" Limit text length
includeHtmlTags bool false Preserve HTML structure
returnHighlights bool false AI-selected key snippets
highlightsSentences int 3 Sentences per highlight (1-10)
highlightsPerUrl int 3 Highlights per result (1-10)
highlightsQuery string "" Guide highlight selection
returnSummary bool false AI-generated summaries
summaryQuery string "" Guide summary generation
livecrawl enum fallback fallback, never, always, preferred
subpages int 0 Linked subpages (0-10)
subpageTarget string "" Keyword for subpages
showThinking bool false Show reasoning tags

exa_deep_search

Comprehensive search with automatic query expansion using deep mode.

Parameter Type Default Description
objective string required Natural language search description
searchQueries string "" Optional keyword queries (comma-separated, max 5)

Plus all filtering parameters from exa_web_search.

exa_code_context

Code examples and API documentation search.

Parameter Type Default Description
query string required Code/API search query
codeTokens enum dynamic dynamic, 5000, 10000, 20000
showThinking bool false Show reasoning tags

exa_crawl_url

Extract content from specific URLs.

Parameter Type Default Description
url string required URL to crawl
maxCharacters int 3000 Max characters to extract
returnText bool true Fetch page text
includeHtmlTags bool false Preserve HTML
returnHighlights bool false Key snippets
highlightsSentences int 3 Sentences per highlight
highlightsPerUrl int 3 Highlights per result
highlightsQuery string "" Guide highlights
returnSummary bool false AI summaries
summaryQuery string "" Guide summaries
livecrawl enum preferred fallback, never, always, preferred
subpages int 0 Linked subpages
subpageTarget string "" Subpage keyword
showThinking bool false Show reasoning tags

exa_find_similar

Find pages similar to a given URL.

Parameter Type Default Description
url string required Source URL
numResults int 10 Results count (1-100)
category enum "" Content category filter
includeDomains string "" Domains to include
excludeDomains string "" Domains to exclude

Plus content extraction parameters (returnText, highlights, summaries, livecrawl, subpages).

exa_company_research

Company research with curated business sources.

Pre-configured domains: bloomberg.com, reuters.com, crunchbase.com, sec.gov, linkedin.com, forbes.com, businesswire.com, prnewswire.com

Parameter Type Default Description
companyName string required Company to research
numResults int 5 Results count
startPublishedDate string "" ISO 8601 date
endPublishedDate string "" ISO 8601 date
returnText bool true Fetch page text
returnHighlights bool false Key snippets
returnSummary bool false AI summaries
livecrawl enum fallback Content freshness
showThinking bool false Show reasoning tags

exa_linkedin_search

LinkedIn-specific search for profiles and companies.

Parameter Type Default Description
query string required LinkedIn search query
searchType enum all profiles, companies, all
numResults int 5 Results count
returnText bool true Fetch page text
returnHighlights bool false Key snippets
returnSummary bool false AI summaries
livecrawl enum fallback Content freshness
showThinking bool false Show reasoning tags

exa_quick_answer

Quick LLM answer with search-backed citations.

Parameter Type Default Description
query string required Question to answer
showText bool false Show text under citations
showThinking bool false Show reasoning tags

exa_deep_research

Comprehensive AI-powered research agent.

Parameter Type Default Description
instructions string required Research question/instructions
model enum exa-research exa-research (15-45s), exa-research-pro (45s-2min), exa-research-fast
showThinking bool false Show reasoning tags

Linkup Tools

linkup_search

Factually accurate web search (ranked #1 on OpenAI's SimpleQA benchmark).

Parameter Type Default Description
messages [Message] required Conversation messages
depth enum standard standard (fast), deep (comprehensive)

Development

Project Structure

Sources/
├── Core/
│   ├── API/
│   │   ├── Config.swift           # Environment configuration
│   │   ├── PoeAPIClient.swift     # HTTP client
│   │   └── PoeTypes.swift         # Request/response models
│   ├── Helpers/
│   │   ├── ContentStripper.swift  # Strips <think> tags
│   │   └── With.swift             # Functional builder
│   ├── Providers/
│   │   ├── ToolProvider.swift     # Tool factory
│   │   ├── ServerProvider.swift   # MCP server setup
│   │   └── ...                    # Other providers
│   ├── Tools/Search/
│   │   ├── Perplexity/            # 3 tools
│   │   ├── Reka/                  # 3 tools
│   │   ├── Exa/                   # 9 tools
│   │   └── Linkup/                # 1 tool
│   └── Environment.swift          # @TaskLocal DI
└── swift-poe-search-mcp/
    └── swift_search_mcp.swift     # Entry point

Tests/
├── Perplexity/
├── Reka/
├── Exa/
├── Linkup/
└── Environment/                   # Test utilities

Testing

# Run all tests
POE_API_KEY=your_key swift test

# Run specific provider tests
POE_API_KEY=your_key swift test --filter "PerplexityToolTests"
POE_API_KEY=your_key swift test --filter "ExaToolsTests"

# Run specific tool test
POE_API_KEY=your_key swift test --filter "webSearchTool"

Test Architecture:

  • Framework: Swift Testing (@Test, @Suite)
  • Pattern: @TaskLocal environment injection for test isolation
  • Type: Integration tests with real API calls

Adding New Tools

  1. Create tool file in appropriate provider directory:
import Foundation
import MCPToolkit

struct MyNewTool: MCPTool {
  let name = "my_new_tool"
  let description: String? = "Tool description"

  @Schemable
  @ObjectOptions(.additionalProperties { false })
  struct Parameters: Sendable {
    let query: String
    let showThinking: Bool?
  }

  func call(with arguments: Parameters) async throws(ToolError) -> Content {
    let model = "model-name"
    let messages = [PoeMessage(role: "user", content: arguments.query)]

    do {
      let response = try await Environment.current.poeAPIClient().performChatCompletion(
        messages,
        model,
        nil,  // extra_body parameters
        !(arguments.showThinking ?? false)
      )
      return [ToolContentItem(text: response.content)]
    } catch let error as PoeError {
      throw ToolError(error.localizedDescription)
    }
  }
}
  1. Register in ToolProvider.swift:
if config.isProviderEnabled(.myProvider) {
  tools += [MyNewTool()]
}
  1. Add test in Tests/MyProvider/MyProviderToolTests.swift:
import Testing
@testable import Core

@Suite(.testEnvironment)
struct MyProviderToolTests {
  @Test func myNewTool() async throws {
    let tool = MyNewTool()
    let result = try await tool.call(with: .init(query: "test"))
    #expect(!result.isEmpty)
  }
}

API Reference

Base Configuration

  • URL: https://api.poe.com/v1
  • Format: OpenAI-compatible /v1/chat/completions
  • Auth: Bearer token via Authorization header
  • Custom params: Via extra_body field

Message Format

struct PoeMessage {
  let role: String    // "user", "assistant", "system"
  let content: String
}

Response Format

struct PoeResponse {
  let content: String
  let citations: [String]?
  let usage: TokenUsage?
}

Troubleshooting

  • libcurl error on Linux: Run apt-get install libcurl4
  • Platform not supported: Only linux-x64 and darwin-arm64 (macOS 14+) are supported
  • Issues: GitHub Issues

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
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) 服务器的示例。

官方
精选