explaingit

zhengyanglsun/iflow-search-js

11TypeScriptAudience · developerComplexity · 3/5ActiveLicenseSetup · easy

TLDR

Official JavaScript and TypeScript SDK monorepo for iFlow Search, a Chinese web, image, and page-fetch API shaped for AI agents. Ships a core client, LangChain tools, and an MCP server.

Mindmap

mindmap
  root((iflow-search-js))
    Inputs
      Search queries
      Image queries
      Web page URLs
      iFlow API key
    Outputs
      Structured search results
      Fetched web pages
      Image hits
      MCP tool calls
    Use Cases
      Add web search to a LangChain agent
      Wire iFlow into Claude Desktop
      Build a backend search service
      Fetch and summarize pages
    Tech Stack
      TypeScript
      pnpm
      LangChain
      MCP

Things people build with this

USE CASE 1

Give a LangChain agent web search by adding the three iflow tools to bindTools

USE CASE 2

Run the stdio MCP server so Claude Desktop or Claude Code can search the Chinese web

USE CASE 3

Call createIFlowSearchClient directly from a Node backend to power an internal lookup endpoint

USE CASE 4

Build a fetch-and-summarize pipeline using iflow_web_fetch then a local LLM

Tech stack

TypeScriptpnpmLangChainLangGraphMCP

Getting it running

Difficulty · easy Time to first run · 30min

Requires an iFlow API key from the operator and pnpm to work with the monorepo.

MIT license, use freely in commercial and personal projects with attribution.

In plain English

iflow-search-js is the official JavaScript and TypeScript SDK family for iFlow Search, a Chinese search API operated by Hangzhou Xingchen Qianxun Technology that offers web search, image search, and web page fetching. The output is shaped for AI consumption, meaning results come back as structured data that a language model can read directly. The repository is a pnpm monorepo with four parts. The first is @iflow-ai/search-core, a small framework-agnostic client with no runtime dependencies, intended for backend code or for people writing their own integrations. The second is @iflow-ai/search-langchain, which wraps the core into three LangChain tools called iflow_web_search, iflow_image_search, and iflow_web_fetch. The third is an example LangGraph agent that uses createReactAgent and shows how to wire those tools into an agent loop. The fourth is @iflow-ai/search-mcp, a stdio MCP server that exposes the same three tools to clients like Hermes, Claude Code, and Claude Desktop. The authors decided not to publish a separate LangGraph package because LangGraph already consumes LangChain tools directly, so the LangChain package is reused for both. The example agent directory is workspace-only and not meant to be installed as a dependency. Basic use is short. You import createIFlowSearchClient from the core package, pass an apiKey from the IFLOW_API_KEY environment variable along with attribution fields, then call methods like webSearch with a query and a count. Errors come back as a result object with ok false and a code and message rather than as thrown exceptions. The LangChain entry point is createIFlowSearchTools, which returns tools ready to hand to any agent that calls bindTools. Every outbound request adds IFlow-Source, IFlow-Integration, and IFlow-Integration-Version headers so the operator can see which adapter is calling. The MCP build also forwards IFlow-MCP-Client headers if the host sets IFLOW_MCP_CLIENT and IFLOW_MCP_CLIENT_VERSION. The README is explicit about not committing real API keys, and notes that the unit tests use mocked fetch with fake keys. The whole project is MIT licensed.

Copy-paste prompts

Prompt 1
Set up @iflow-ai/search-langchain in my Node project, read IFLOW_API_KEY from .env, and add iflow_web_search to a LangGraph createReactAgent
Prompt 2
Configure the @iflow-ai/search-mcp stdio server in Claude Desktop and make a test query for latest Hangzhou news
Prompt 3
Write a TypeScript script that calls createIFlowSearchClient.webSearch with count 10 and prints titles plus URLs
Prompt 4
Show me how to handle the ok false result shape from @iflow-ai/search-core instead of try-catch
Prompt 5
Set the IFlow-Integration and IFlow-Integration-Version headers correctly for a custom adapter built on @iflow-ai/search-core
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.