[ clawifi for langchain ]
Web search and page reading for LangChain
Load Clawifi’s MCP tools into a LangChain agent in a few lines, and it can search the web, read pages and PDFs, and get the passages that answer each question, with sources.
What Clawifi gives LangChain#
A LangChain agent is as good as the tools you hand it. Clawifi gives it web search, page reading and passage selection as MCP tools, so you do not write and maintain your own fetchers.
- Search:
search_freesearches many engines as one and returns ranked results with their sources. - Read:
fetch_urlandscrape_urlread pages and PDFs as Markdown; with aquery,scrape_urlreturns only the passages that answer it. - Parse and discover:
extract_urlpulls structured fields from a page;map_sitelists a site’s URLs;start_crawlandget_crawlread several pages. - Jobs, history and monitors:
create_job,get_job,list_historyandlist_monitorsfor longer runs and scheduled checks. - Cost first:
estimateprices a call before it runs, and the account tools show your credits.
Set it up#
1. Get an API key
Create an account at clawifi.dev/signup. The Free plan includes 1,000 credits a month. Copy the key the console shows you (it is shown once) and keep it in an environment variable,
CLAWIFI_API_KEY.2. Install LangChain with MCP support
LangChain’s MCP support lives in the
langchain.mcpnamespace, which its docs mark as beta (LangChain MCP docs).pip install "langchain[mcp]"3. Load the tools and build the agent
Pass the key as the client’s
auth; it is sent asAuthorization: Bearer <key>(LangChain MCP authentication). Replace the model name with the one you use.import asyncio import os from fastmcp.client import Client from langchain.agents import create_agent from langchain.mcp import MCPAdapter async def main(): client = Client("https://api.clawifi.dev/mcp", auth=os.environ["CLAWIFI_API_KEY"]) async with MCPAdapter(client) as adapter: tools = await adapter.list_tools() agent = create_agent("your-model", tools) result = await agent.ainvoke({"messages": [{"role": "user", "content": "Search the web for the MCP spec and summarise it."}]}) print(result["messages"][-1].content) asyncio.run(main())4. Run it
Set
CLAWIFI_API_KEYand run the script. Your model provider’s key is needed too.
Sources for this setup: Remote MCP · LangChain MCP docs · LangChain MCP authentication. Clawifi works with LangChain; it is not affiliated with its makers.
Example prompts#
Search the web for the three most cited papers on retrieval-augmented generation, read their abstracts, and return the titles with links.
Read https://docs.langchain.com/oss/python/langchain/mcp and return only the passages about authentication.
Map https://docs.python.org/3/library/ and list the first 20 URLs, then read the asyncio page and summarise it.
Questions#
How do I use Clawifi tools in LangChain?
Install langchain[mcp], open MCPAdapter(Client("https://api.clawifi.dev/mcp", auth=<your key>)), call list_tools(), and pass the tools to create_agent.
What about langchain-mcp-adapters?
Its repository says MCP support has moved into LangChain under langchain.mcp. Existing code with MultiServerMCPClient can keep working: use the http transport, the URL above and an Authorization: Bearer header.
Can I use the Python SDK instead of MCP?
Yes. pip install clawifi includes a Python client you can wrap in your own tools; see SDK and CLI. MCP saves you writing the wrappers.
What does it cost?
Each tool call is billed like the API route it runs: most cost 1 credit and a browser render 3. Cache hits and failures on Clawifi’s side cost 0; a page whose site answers with an error (such as a 404) is charged as usual. The Free plan includes 1,000 credits a month. See Pricing.
Other agents and frameworks#
Next: Integrations · Docs · Pricing