Skip to content

Reddit and X data in LangChain

langchain-mcp-adapters turns ChatterAPI's hosted MCP server into LangChain tools in a few lines of Python. Your agent can search Reddit and X and read threads and users, and the key goes in a header.

MCP server URLhttps://api.chatterapi.com/mcp

What you get

  • Every live Reddit and X tool as a LangChain tool, with names, descriptions and input schemas from the server.
  • No scraping code for you to maintain.
  • Every tool result includes credits, so the agent can track spend.

Set it up

  1. Create an API key

    Sign in at chatterapi.com/signup with Google and create a key on the Keys page. You get 100 free credits. A ca_test_ key returns recorded samples for 0 credits, which helps while you set things up.

  2. Install the adapter

    Install the adapter alongside LangChain.

    terminal
    pip install langchain-mcp-adapters
  3. Load the tools

    Point the client at the MCP URL with the http transport and the header. get_tools() returns LangChain tools you can pass to any agent.

    agent.py
    import asyncio, os
    from langchain_mcp_adapters.client import MultiServerMCPClient
    
    client = MultiServerMCPClient({
        "chatterapi": {
            "transport": "http",
            "url": "https://api.chatterapi.com/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['CHATTERAPI_KEY']}"},
        }
    })
    
    async def main():
        tools = await client.get_tools()
        print([t.name for t in tools])
    
    asyncio.run(main())

A tool call from the agent

When the agent calls reddit_search, it sends arguments like these. The response comes from a real recorded call.

Try this prompt

What do small businesses say about choosing a CRM on Reddit this year?

{
  "method": "tools/call",
  "params": {
    "name": "reddit_search",
    "arguments": {
      "q": "best crm for small business",
      "time": "year"
    }
  }
}
response, first 2 rows
{
  "data": [
    {
      "id": "1wdihhj",
      "fullname": "t3_1wdihhj",
      "title": "What CRM should a small business use?",
      "body": "We’re a small B2B business with 6 people and sales is still pretty founder led, but revenue has grown enough that keeping leads, follow ups and customer conversations spread across spreadsheets and inboxes is starting to…",
      "author": "NotedWhisky",
      "subreddit": "CRM",
      "permalink": "/r/CRM/comments/1wdihhj/what_crm_should_a_small_business_use/",
      "url": "https://www.reddit.com/r/CRM/comments/1wdihhj/what_crm_should_a_small_business_use/",
      "externalUrl": null,
      "score": 51,
      "numComments": 186,
      "upvoteRatio": null,
      "createdAt": "2026-09-11T14:52:16.000Z",
      "nsfw": false,
      "locked": null,
      "media": null
    },
    {
      "id": "1vmy4xb",
      "fullname": "t3_1vmy4xb",
      "title": "If You Had to Pick the Best CRM for Small Business Today, What Would It Be?",
      "body": "I've spent the last few days reading reviews and watching videos, and somehow I'm even more undecided than when I started.\n\nEvery CRM looks amazing on its website, but that doesn't tell you what it's like after you've be…",
      "author": "Living_Dependent242",
      "subreddit": "CRMSoftware",
      "permalink": "/r/CRMSoftware/comments/1vmy4xb/if_you_had_to_pick_the_best_crm_for_small/",
      "url": "https://www.reddit.com/r/CRMSoftware/comments/1vmy4xb/if_you_had_to_pick_the_best_crm_for_small/",
      "externalUrl": null,
      "score": 10,
      "numComments": 56,
      "upvoteRatio": null,
      "createdAt": "2026-08-13T02:25:31.000Z",
      "nsfw": false,
      "locked": null,
      "media": null
    }
  ],
  "page": {
    "nextCursor": "AX-v…",
    "hasMore": true
  }
}

Recorded from a live call on . Long text is shortened and the cursor is cut. A live key is charged 2 credits for this call. A test key returns this same sample for 0 credits.

Limits worth knowing

  • In langchain-mcp-adapters, http and streamable_http name the same transport. Only the sse and http transports support runtime headers. source

Last checked . Sources: langchain-mcp-adapters on GitHub.

Questions

Is there a LangChain document loader?
Not yet. The MCP tools cover the same data, and the REST API works with any HTTP client.
Does it cost more through LangChain than through REST?
No. MCP and REST call the same tools, cost the same credits and draw from one balance.
Can I try it without spending credits?
Yes. Use a ca_test_ key. Every tool returns a recorded sample for 0 credits, whatever you ask.

What people build with it

Agent frameworks

Give your agent Reddit and X data

Sign up and get 100 free credits. No card required.