Qwen Code
Qwen Code's built-in web_search runs only on DashScope or a Qwen subscription. On any other model provider, web search comes from an mcpServers entry. Add SpecStream with one qwen mcp add command and Qwen Code can search the live web, read whole pages, and get a written research report with the page behind each cited sentence.
What you need
- Qwen Code, installed with
npm install -g @qwen-code/qwen-code@latest(Node.js 22 or newer) orbrew install qwen-code. - A SpecStream account. New accounts get $10 of credit, no card.
- 1
1. Create a SpecStream key
In your SpecStream workspace, open Agents & API, choose API keys, then Create API key. Give the key execute access and a spending limit, so it can search and read pages up to that limit and no further.
Export it in the shell where you start Qwen Code:
Shell - 2
2. Add the server
Run this once.
qwen mcp addwrites the entry to~/.qwen/settings.json, which covers every project on your machine. Add--scope projectto write it to.qwen/settings.jsonin the current project instead.Your shell fills in the variable before Qwen Code sees it, so the file holds the key itself. To keep the key out of the file, write the entry by hand as the last step shows.
Shell - 3
3. Check the connection
Start
qwenand enter/mcp. The dialog listsspecstreamwith its tools. If Qwen Code was already running when you added the server, restart it in the same project first.From the shell,
qwen mcp listshows the same server. If it shows Disconnected, check thatSPECSTREAM_API_KEYis set in the shell Qwen Code starts from.In Qwen Code - 4
4. Ask for a report
Ask a question and name SpecStream. Qwen Code calls
research_priceto show the price of each depth, starts the report withstart_researchonce you approve that price, and reads it withget_researchuntil it is completed. A quick report takes about a minute.For a quick answer, ask it to search with SpecStream, and it calls
search_webandread_pagesinstead.In Qwen Code - 5
5. Or write the entry by hand
Add this to
~/.qwen/settings.json, or to.qwen/settings.jsonin a project. Remote servers over streamable HTTP use thehttpUrlfield in Qwen Code.urlis the field for SSE servers.Here the file keeps the variable's name. Qwen Code reads the key from the environment each time it starts.
~/.qwen/settings.json
What Qwen Code gets
SpecStream's server at https://api.specstream.ai/mcp adds these tools to Qwen Code.
search_webanswers a question from the live web, with up to 10 results for $5 per 1,000 searches.read_pagesreturns the main text of the pages you name, at $0.80 per 1,000 pages. A page that gives no text is not charged.research_price,start_researchandget_researchproduce a written report from the live web, with the page behind each cited sentence. A report costs $0.10 (quick), $0.30 (standard) or $1.00 (deep), and the price is taken once, when the report is delivered.- Deep Search builds a list from a request in plain words.
compilereads the request back,quote_capacity_workprices it, andauthorize_capacity_workstarts it only after you approve the maximum.get_findandlist_find_rowsread the results with their sources.
Qwen Code's own web search and SpecStream
Qwen Code's built-in web_search turns on by itself with a Qwen Plus or Pro subscription and with supported DashScope setups. With a model from another provider it stays off, and Qwen Code's own docs say to connect an MCP search service. SpecStream is one such service, and it works with any model you run in Qwen Code.
With both in place, the two run side by side. Name SpecStream in your request when you want its results or a report.
| You need | Tool | Price |
|---|---|---|
| A fact or a quick answer | search_web | $5 per 1,000 searches |
| The full text of pages you know | read_pages | $0.80 per 1,000 pages |
| A written answer with its sources | start_research | $0.10, $0.30 or $1.00 a report |
| A complete list with the same facts on each row | compile, then a quote | Quoted before it runs |
Sign in with OAuth in place of a key
On a machine with a browser you can leave the header out: qwen mcp add specstream -t http "https://api.specstream.ai/mcp". When an httpUrl server answers that sign-in is needed, Qwen Code starts OAuth discovery by itself and opens the browser. Sign in to SpecStream and approve the access Qwen Code asks for. The /mcp dialog shows the server's authentication state.
Qwen Code receives the sign-in on http://localhost:7777/oauth/callback, so this works where Qwen Code and the browser run on the same machine. On a remote server or a web terminal, use the key.
Qwen Code stores OAuth tokens in ~/.qwen/mcp-oauth-tokens.json as plain text by default. Set QWEN_CODE_FORCE_ENCRYPTED_FILE_STORAGE=true on a shared machine.
Approvals in Qwen Code
Leave trust off for this server, which is the default. Qwen Code then asks before each SpecStream tool call. Searches and page reads are charged per call. A report or a list adds SpecStream's own gate: nothing starts until you approve the exact price it shows.
To give Qwen Code only some of the tools, add includeTools to the entry, for example "includeTools": ["search_web", "read_pages"].
Cost
Connecting SpecStream to Qwen Code is free, and new accounts start with $10 of credit. A search of up to 10 results costs $5 per 1,000, and a page read costs $0.80 per 1,000. A research report costs $0.10, $0.30 or $1.00 by depth, and a cancelled report is not charged. The key's spending limit is the most Qwen Code can spend. See pricing and how billing works.
Remove
Run qwen mcp remove specstream, or delete the specstream entry from settings.json, and restart Qwen Code. To end its access, open Agents & API in your SpecStream workspace and revoke the key under API keys. Questions: [email protected]. More tools are covered in Connect your tools.
More
SpecStream for Qwen Code covers what it does in Qwen Code on one page. Every other tool has its guide in Connect your tools. You see the most a request can cost before it starts, and the matches are paid from your balance. Billing has the details. For help, email [email protected].