100 free credits. No credit card required. Get a key

Connect Groundsocial to LangGraph and LangChain

Type
Framework
Sign-in
Bearer token
Config
Your code
Checked

Groundsocial’s hosted MCP server is https://api.groundsocial.dev/mcp (Streamable HTTP). It signs in with OAuth or takes your API key as a Bearer token. Get a key if you want one: it starts with gs_live_ and comes with free credits.

Set it up in LangGraph and LangChain

bash
pip install "langchain[mcp]>=1.4"
agent.py
import asyncio
import os

from fastmcp.client import Client
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter


async def main() -> None:
    client = Client("https://api.groundsocial.dev/mcp?platforms=reddit,youtube,hackernews", auth=os.environ["GROUNDSOCIAL_API_KEY"])
    async with MCPAdapter(client) as adapter:
        tools = [t for t in await adapter.list_tools() if t.name.startswith("reddit_")]
        agent = create_agent("claude-sonnet-5", tools)  # any chat model LangChain supports
        result = await agent.ainvoke(
            {"messages": [{"role": "user", "content": "Summarise this week on r/LocalLLaMA."}]}
        )
        print(result["messages"][-1].content)


asyncio.run(main())

create_agent returns a LangGraph graph, so you can stream it, add checkpoints or put it inside a larger graph. auth= takes the key and sends it as Authorization: Bearer. We ran the adapter against the live server with langchain 1.5.2 on 27 November 2026: it listed every tool, and an invalid key got the expected 401.

Add your API key

Client(url, auth=...) takes a bearer token string, the literal "oauth" for a browser sign-in, or any httpx.Auth.

Load fewer tools

The full server lists 593 tools, one per endpoint. Connect only the platforms you use and the agent sees fewer schemas: add ?platforms= with ids from the platform list, comma-separated.

text
https://api.groundsocial.dev/mcp?platforms=reddit,youtube,hackernews

That URL lists 67 tools: Reddit, YouTube and Hacker News plus the free helpers (list_endpoints, estimate_cost, account_balance, agent_signup). OAuth sign-in and keys work the same with or without the filter.

The adapter has no filter argument; filter the list by name as above, or narrow the URL with ?platforms=.

First prompt to try

  • “Before you start, use estimate_cost and tell me what this will cost.”
  • “Search Reddit, Hacker News and YouTube for what developers say about Bun in 2026, and give me the three strongest arguments for and against.”
  • “Get the 25 newest posts on r/startups and table them: title, score, comments, one-line summary.”

Troubleshooting

ImportError: cannot import name RequestContext from langchain_mcp_adapters

The standalone langchain-mcp-adapters package (0.3.2) does not import alongside the mcp 2.x SDK that langchain[mcp] installs. Use langchain.mcp.MCPAdapter, which replaces MultiServerMCPClient.

A LangChainBetaWarning on import

langchain.mcp is marked beta. The warning is harmless.

Check what the server lists without a key: curl -s https://api.groundsocial.dev/mcp -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'. Every error says what to do next; codes are in Errors.

Sources

Checked 27 Nov 2026. Follow the links for the latest.

Reddit, X and every other platform named here are trademarks of their owners. We are not affiliated with or endorsed by any of them.