LangChain MCP: give LangChain and LangGraph agents TikTok and Instagram tools

Updated

Virlo is social listening for TikTok and Instagram Reels. A LangChain agent can plan, call tools and stream answers, but its standard toolkits carry no record of which TikTok or Instagram videos are outperforming right now. Load Virlo's MCP server as LangChain tools and the agent can query trends, hooks, sounds, transcripts and outlier videos from a database of 23.1M viral videos. LangChain is an open-source Python and TypeScript framework for building LLM agents, and LangGraph is its runtime for stateful, multi-step agent graphs.

  • Native `langchain.mcp` adapter: one URL, one token
  • Works with `create_agent` and any LangGraph graph
  • `MultiServerMCPClient` config for projects on langchain-mcp-adapters

Part of Virlo's AI assistant guides. Prefer a visual builder on similar parts? See Flowise. Building crews of agents? See CrewAI.

How do I connect the Virlo MCP server to a LangChain agent?

Five steps in Python. LangChain turns each Virlo research tool into a regular LangChain tool, so it slots into any agent you already run.

  1. Step 1: Create your Virlo account for free

    Create your free Virlo account in under a minute. Already signed up? Open API Keys.
  2. Step 2: Install LangChain with the MCP extra

    The mcp extra brings in the langchain.mcp namespace (LangChain 1.4 or newer) and FastMCP, which handles the Streamable HTTP connection and auth for you.

    Terminal
    pip install "langchain[mcp]"
  3. Step 3: Export your Virlo key

    Create a key in the Virlo developer dashboard and put it in your environment. Keys start with virlo_tkn_; reading it from the environment keeps it out of notebooks and commits.

    Terminal
    export VIRLO_API_KEY=virlo_tkn_YOUR_KEY
  4. Step 4: Load the Virlo tools and build the agent

    Pass a FastMCP Client with your key as auth into MCPAdapter, list the tools inside the async with block and hand them to create_agent. The tools keep their connection after the block closes. Swap the model string for whichever chat model you use.

    agent.py
    import asyncio, os
    from fastmcp.client import Client
    from langchain.mcp import MCPAdapter
    from langchain.agents import create_agent
    
    VIRLO = "https://dev.virlo.ai/api/mcp/mcp"
    
    async def main():
        client = Client(VIRLO, auth=os.environ["VIRLO_API_KEY"])
        async with MCPAdapter(client) as adapter:
            tools = await adapter.list_tools()
            agent = create_agent("claude-sonnet-5", tools)
            result = await agent.ainvoke(
                {"messages": "Use Virlo to list this week's top TikTok trends to copy in [your niche]."}
            )
            print(result["messages"][-1].content)
    
    asyncio.run(main())
  5. Step 5: Run it with a real research question

    Run the script. LangSmith traces, if you have them on, show every Virlo tool call the agent made and the JSON it got back.

    Your first prompt
    Use Virlo to find the 10 Instagram Reels about [topic] with the highest Virality Score this month and explain the pattern they share.

Working locally and want to skip the key? Pass auth="oauth" to the FastMCP Client instead: it runs Virlo's browser sign-in, registers the client and caches the token.

MCPAdapter vs MultiServerMCPClient vs LangGraph: which LangChain route fits?

RoutePackage and callAuthUse it when
langchain.mcp adapterMCPAdapter(Client(url, auth=...)) then list_tools()Bearer key or auth="oauth"New agents on LangChain 1.4+
langchain-mcp-adaptersMultiServerMCPClient({...}) then get_tools()headers dict with AuthorizationExisting projects already pinned to that package
LangGraph graphBind the same tools to a ToolNode, or pass them to create_agent, which returns a compiled graphInherits from the adapterMulti-step research with checkpoints and human review
LangChain.js@langchain/mcp-adapters with an Authorization header on the HTTP server entryBearer keyNode or edge apps written in TypeScript

Every route talks to the same hosted Virlo server over Streamable HTTP, so you can move between them without changing anything on the Virlo side.

LangChain agent on its own vs with Virlo tools

TaskAgent with default toolsAgent with Virlo tools
Find a rising Instagram formatWeb search snippets about Reels in generalReels ranked by Virality Score, with hooks and links
Explain a viral TikTokCannot open the videoTranscript, hook, on-screen text and baseline comparison for that video
Track a competitor weeklyNeeds a scraper you maintainCreator lookup with their outlier videos, called from a scheduled graph
Choose audio for a scriptLists famous songsBreakout sounds on TikTok and Instagram Reels from the last 7 days

Which Instagram sounds would a LangChain agent flag as breakouts?

Call the Virlo sounds tool from a LangChain agent with the breakout filter and these are the kind of rows it gets back: audio climbing fast on Instagram Reels from a small base.

In Virlo's data, "Dilruba Dilnasheen" is the fastest-rising sound on Instagram Reels: 46 Reels used it in the last 7 days, against about 14 a week before, as of November 19, 2026.

As of November 19, 2026 at 12:03 UTC

Which Instagram sounds would a LangChain agent flag as breakouts?
SoundArtistReels (7 days)Usual week before
Cover art for Dilruba DilnasheenDilruba DilnasheenRito Riba, Siddhant kaushal4614
What's Up - Deep houseHARDMAX245
Vintage NovemberPeaceful Reveries2512
James Bond ThemeJohn Barry Orchestra152
Blood In Your Eyes (from GTAVI: The Album)Tove Lo, Grand Theft Auto VI113

See all 27 breakout sounds on Instagram Reels

Usage history and the Reels behind every sound are in the Virlo app.

Open sounds in Virlo

How this sample is made

Source
Virlo's sound rankings for Instagram Reels, built from the Reels Virlo collects.
Window
Reels posted in the last 7 days that Virlo collected. Counts are Reels in Virlo's data, not every video on the platform.
Method
Ranked by breakout score: use in the last 7 days against the sound's usual weekly use before that, so a sound rising from a small base ranks above an old hit.
As of
November 19, 2026 at 12:03 UTC. Rebuilt every day.
Made by
Numbers are pulled automatically from Virlo's data; the text around them is written by the Virlo team.

Suggested citation: Source: Virlo, “LangChain MCP: give LangChain and LangGraph agents TikTok and Instagram tools”, virlo.ai/langchain

How do I use Virlo tools inside a LangGraph workflow?

LangGraph lets you split research into explicit nodes instead of one long agent loop. A graph that suits weekly content research:

  • A planner node turns the request (plan next week for [your brand]) into a list of lookups: trends, outliers, sounds.
  • A tool node bound to the Virlo tools runs those lookups, in parallel where the graph allows it.
  • A critic node drops any idea without a source video link, so every suggestion traces back to real data.
  • A writer node produces scripts on the surviving trends; an interrupt before it lets a human approve the shortlist.
  • A checkpointer saves state, so the same thread can pick up next Monday with last week's findings in memory.

Because LangChain's create_agent already returns a compiled LangGraph graph, you can start with the short agent from the setup and refactor into custom nodes only when you need the control.

What does the langchain-mcp-adapters config look like for Virlo?

Projects that still import MultiServerMCPClient from langchain_mcp_adapters can add Virlo as one more entry in the servers dict. The streamable_http transport (alias http) sends runtime headers, which is how the key reaches Virlo. New code is better served by the langchain.mcp adapter above, which LangChain now recommends for ongoing work.

Virlo entry for MultiServerMCPClient
KeyValue for Virlo
transport"streamable_http" (or "http")
urlhttps://dev.virlo.ai/api/mcp/mcp
headers{"Authorization": "Bearer virlo_tkn_..."} read from your environment

Full snippet: from langchain_mcp_adapters.client import MultiServerMCPClient client = MultiServerMCPClient({ "virlo": { "transport": "streamable_http", "url": "https://dev.virlo.ai/api/mcp/mcp", "headers": {"Authorization": f"Bearer {os.environ['VIRLO_API_KEY']}"}, } }) tools = await client.get_tools()

What can a LangChain agent research with Virlo?

Pass these as the user message to your agent or graph. Replace the brackets.

  • Ranked dataset

    Use Virlo to collect 50 TikTok videos about [topic] from the last 30 days, ranked by Virality Score, and return them as a list of dicts with url, hook and score.

  • RAG over hooks

    Pull 100 spoken hooks from outlier videos in [your niche] so I can embed them in a vector store, each with its hook type and source link.

  • Trend router

    Check this week's trends to copy in [your niche]; if any is still rising, write a brief for it, otherwise suggest the strongest evergreen format instead.

  • Transcript chain

    Get the transcript of [TikTok link], split it into hook, body and call to action, and rewrite each part for [your product].

  • Competitor graph

    For each handle in [@a, @b, @c], look up their TikTok and Instagram outliers this month and return a comparison table.

  • Sound pairing

    Match each of these three script ideas [ideas] to a breakout TikTok or Instagram Reels sound and justify the choice.

  • Structured output

    Return the five strongest hook types on Instagram as structured output with fields type, share_at_18_plus and an example video.

  • Weekly memory

    Compare this week's top trends in [your niche] with the ones saved in your memory from last week and list what is new.

LangChain vs LangGraph vs langchain-mcp-adapters: which one is this about?

The names overlap, and all of them can load Virlo. Here is how they relate.

LangChain (this page)

The framework for models, tools and agents. create_agent plus the langchain.mcp adapter is the shortest path to Virlo.

LangGraph

The graph runtime underneath LangChain agents, for durable, branching workflows. It uses the same Virlo tools that LangChain loads.

langchain-mcp-adapters

The earlier standalone package with MultiServerMCPClient. It connects to Virlo with a headers dict; LangChain points new work at langchain[mcp].

CrewAI

A separate Python framework for role-based crews of agents, with its own MCP DSL.

What are the limits?

  • Virlo is read-only: a LangChain agent can query public TikTok and Instagram data through it, never post or sign in to an account.
  • Keep the key in an environment variable or secret manager; never commit it inside the tool config of a shared notebook.
  • Runs that start a new marketing agent complete in the background, so have your graph poll for the result or react to a Virlo webhook rather than block a node.
  • TikTok videos return full transcripts; Instagram Reels return hooks, on-screen text, formats and numbers.
  • For what each Virlo plan includes, see pricing.

Frequently asked questions

How do I use an MCP server with LangChain?

Install langchain with the mcp extra, wrap the server in a FastMCP Client, pass it to MCPAdapter and call list_tools() inside an async with block. Hand those tools to create_agent. For Virlo, the client gets the dev.virlo.ai MCP URL and your key as auth.

What is langchain-mcp-adapters?

It is the original package that converts MCP tools into LangChain tools through MultiServerMCPClient. It connects to Virlo using a streamable_http entry with url and headers. LangChain has since moved this capability into the langchain[mcp] extra, which it recommends for new projects.

How do I connect LangGraph to an MCP server?

Load the server's tools with the LangChain adapter, then bind them to a ToolNode or pass them to create_agent, which builds a LangGraph graph for you. Virlo's tools behave like any other LangChain tools inside the graph, including with checkpointers and interrupts.

Does MultiServerMCPClient support streamable HTTP?

Yes. Set transport to streamable_http (or its alias http) and give the server a url. That transport also sends a headers dict on every request, which is how a bearer key such as a Virlo key reaches the server. The stdio transport has no headers, so remote servers that need auth should always use streamable_http or sse in that config.

Can a LangChain agent get TikTok data?

With Virlo loaded, yes. The agent gains tools for TikTok trends to copy, outlier videos ranked by Virality Score, trending and breakout sounds, hashtags, creator lookups and transcripts, and can chain them inside one run. A typical chain looks up this week's trends, fetches the top video for each, then reads its transcript before the agent writes anything.

Can I sign in to Virlo from LangChain without an API key?

Yes, for local work. Pass auth set to the string oauth on the FastMCP Client. It discovers Virlo's OAuth settings, registers a client, opens the browser for approval and caches the token. Servers and CI should use the key instead.

Is there a LangChain.js version of this setup?

Yes. The @langchain/mcp-adapters package for TypeScript connects to HTTP MCP servers and accepts an Authorization header, so a Node agent can load the Virlo research tools the same way. The Virlo URL and key format stay unchanged, and the loaded tools plug into LangChain.js agents and LangGraph.js graphs just like the Python versions do.

Can LangChain post to TikTok through Virlo?

No. Virlo only reads public TikTok and Instagram data. Your agent can rank, analyse and write with it, and a separate tool of your choice handles publishing. Many teams end the graph with a human review node, so nothing goes live until someone approves the script the agent wrote from Virlo's data.

Should I use LangChain or CrewAI for social media research?

Both work with Virlo. LangChain suits single agents and custom LangGraph flows; CrewAI suits teams of role-based agents handing work to each other. The server URL and key are identical in both, so trying one after the other costs only a few lines of code. The CrewAI guide shows its MCP DSL.

Give your LangChain agent a social media brain

Install the MCP extra, load Virlo's tools and ask what is working in your niche.