perplexity_ask
Ask a question and get a conversational answer backed by live web search, using the sonar-pro model.
messages必填
io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 3, 2026
Perplexity answers: ask, search, reason, and deep research through the Sonar API.
封裝 Perplexity 的 Sonar 模型,讓助理能提出有網路搜尋依據的問題、取得排序後的網頁結果、逐步推理或進行深度研究。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
參照 儲存庫 中的啟動說明。
answersearch puts Perplexity's models within reach of a terminal or an agent. You can put a question to a search-grounded model and get an answer with its sources, pull ranked web results on their own, hand a hard problem to the reasoning model, or commission a slower, deeper research pass that reads widely before it writes. It runs as a small CLI or as an MCP server, and it needs a Perplexity API key.
Get a key from the Perplexity API portal and export it:
Without the variable set, every command and tool call fails with an
error that names PERPLEXITY_API_KEY — nothing is sent anywhere.
Or run the container image:
The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.
Successful calls print the API's JSON response. Exit codes: 0 on
success, 1 when the API call fails (including a missing key), 2
for usage errors.
One bin serves both faces. The mcp subcommand starts a stdio MCP
server:
MCP client configuration:
Tool results are the upstream JSON, pretty-printed as text. Upstream failures (bad key, quota, HTTP errors) come back as tool errors carrying the status and the API's own message.
MIT — see LICENSE.
來源:README.md,提交 760dcf4
Ask a question and get a conversational answer backed by live web search, using the sonar-pro model.
messages必填Search the web directly through the Perplexity Search API and return ranked results with metadata.
query必填max_tokensmax_resultsmax_tokens_per_pageWork through a hard analytical problem step by step using the sonar-reasoning-pro model.
messages必填Run an in-depth, multi-source research pass on a topic using the sonar-deep-research model.
messages必填已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
export PERPLEXITY_API_KEY=<redacted>npx @reneturcios/answersearch ask "what changed in the latest Node LTS?"docker run -i -e PERPLEXITY_API_KEY ghcr.io/cloudcorprecords/answersearch# Conversational answer grounded in live web search (sonar-pro)answersearch ask "who won the marathon last weekend?"
# Ranked search results only, with optional budgetsanswersearch search "composting basics" --max-results 5 --max-tokens 4000 --max-tokens-per-page 512
# Step-by-step reasoning (sonar-reasoning-pro)answersearch reason "prove that the square root of two is irrational"
# Deep, multi-source research (sonar-deep-research) — this one takes a whileanswersearch research "compare the failure modes of lithium and sodium batteries"
answersearch --versionnpx -y @reneturcios/answersearch mcp{ "mcpServers": { "answersearch": { "command": "npx", "args": ["-y", "@reneturcios/answersearch", "mcp"], "env": { "PERPLEXITY_API_KEY": "your-key-here" } } }}npm installnpm run build # tsc -> dist/npm test # node test runner over test/*.test.ts, no network (fake fetch fixtures)npm run dev # run the CLI from source via tsx