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