[Integrations](/integrations/) / LangChain

# FastAF for LangChain: web search and scraping over MCP

Give LangChain live public web data: Google search, Maps, News, YouTube transcripts, page scraping to Markdown and more, as 23 tools from the hosted FastAF MCP server at `https://api.fastaf.co/mcp` (Streamable HTTP, stateless). The same API key works over [REST](/docs/), and failed calls cost no credits.

## How do you get a key?

Sign up at [fastaf.co/signup](/signup/): the first API key arrives by email with the confirmation link. Confirm the email to unlock 500 free credits every month, then export the key:

```
export FASTAF_API_KEY=...   # keep it out of prompts and repositories
```

## How do you connect LangChain?

```
pip install langchain langchain-openai langchain-mcp-adapters
```

Load the FastAF tools with `MultiServerMCPClient` and hand them to any LangChain or LangGraph agent:

```
import asyncio
import os

from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient


async def main() -> None:
    client = MultiServerMCPClient({
        "fastaf": {
            "transport": "streamable_http",
            "url": "https://api.fastaf.co/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['FASTAF_API_KEY']}"},
        }
    })
    tools = await client.get_tools()
    agent = create_agent("openai:gpt-4.1", tools)
    result = await agent.ainvoke({"messages": [{"role": "user", "content": "Top 5 Google results for 'standing desk under $300' in the US"}]})
    print(result["messages"][-1].content)


asyncio.run(main())
```

Current releases accept `"http"` as the same transport as `"streamable_http"`. Any chat model works in `create_agent`; the OpenAI one needs `OPENAI_API_KEY`. LangChain 1.4 also ships a beta [`MCPAdapter`](https://docs.langchain.com/oss/python/langchain/mcp) that connects to the same URL.

For a single search tool without MCP, the FastAF Python SDK has a LangChain extra (`pip install "fastaf-sdk[langchain]"`, version 0.2.1):

```
import os

from fastaf import FastAF
from fastaf.tools import langchain_tool

client = FastAF(os.environ["FASTAF_API_KEY"])
search = langchain_tool(client)  # one StructuredTool named fastaf_search
```

Checked on Oct 28, 2026 against [langchain-mcp-adapters README](https://github.com/langchain-ai/langchain-mcp-adapters), [LangChain MCP documentation](https://docs.langchain.com/oss/python/langchain/mcp) and [langchain-mcp-adapters 0.3.2, langchain 1.4.7, fastaf-sdk 0.2.1 on PyPI](https://pypi.org/project/fastaf-sdk/).

## How do you check it works?

`await client.get_tools()` returns one LangChain tool per FastAF MCP tool. Listing needs no credits; each tool result reports `credits_used` and `credits_remaining`.

## What does it cost?

500 free credits every month after email verification, shared by REST and MCP and by all your keys. After that, prepaid packs from $10 for 20,000 credits, without expiry. A Google search costs 5 credits and a plain page scrape 1; failed calls cost nothing. Every tool result reports `credits_used` and `credits_remaining`. See [FastAF pricing](/pricing/).

## FAQ

### How do I add FastAF to LangChain?

Use `MultiServerMCPClient` from `langchain-mcp-adapters` with the `streamable_http` transport, pointing at the hosted MCP server `https://api.fastaf.co/mcp` with `Authorization: Bearer` and your FastAF API key, read from the `FASTAF_API_KEY` environment variable, then pass `await client.get_tools()` to your agent.

### Is there a free tier?

Yes: 500 free credits every month per account after email verification, no card, shared by REST and MCP. After that, pay per call with prepaid credits or with x402 on the REST endpoints.

### Am I charged for failed tool calls?

No. A call that fails costs no credits.

### Which tools does the server expose?

23 tools, for example `google_search`, `google_maps_places`, `search_news`, `youtube_transcript`, `scrape_url`, `extract`. Listing them is public and needs no key; calling one needs a FastAF API key or an OAuth token.

### Can the MCP server be paid with x402?

No. MCP tool calls need an API key or OAuth. x402 pay-per-call, from $0.003 per call, works on the REST endpoints under `https://api.fastaf.co/x402/v1/`.

## Related

[MCP server docs](/docs/#mcp) · [Add FastAF to Claude Code, Codex and Cursor](/how-to/add-fastaf-claude-code-codex-cursor/) · [SDKs](/docs/#sdks) · [Tavily-compatible API](/integrations/tavily-compatible/) · [All integrations](/integrations/)

Other clients: [FastAF for Claude Code](/integrations/claude-code/) · [FastAF for Cursor](/integrations/cursor/) · [FastAF for Vercel AI SDK](/integrations/vercel-ai-sdk/) · [FastAF for OpenAI Agents SDK](/integrations/openai-agents-sdk/)
