Skip to content
reelspanDocs

Integrations

LangChain

Give a LangChain agent Reelspan's publishing tools through the hosted MCP server, with your API key, and let it post, schedule and check results.

LangChain loads tools from any MCP server, so a LangChain agent can use Reelspan's hosted MCP server directly: publish, schedule, write captions and read results. There is no separate Reelspan package to install.

Install

pip install "langchain[mcp]>=1.4.0" langchain-anthropic

LangChain marks its langchain.mcp module as beta, so its API may still change. Swap langchain-anthropic for the provider package of the model you use.

API key

Create a key under Developers → API keys and export it. Start with a test key (rs_test_…): every check runs, but nothing is posted.

export REELSPAN_API_KEY=rs_test_...

Example

This agent publishes a text post to the sandbox network, which needs no connected account, and then checks the result.

import asyncio
import os

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


async def main():
    # auth=<key> sends Authorization: Bearer <key>
    reelspan = Client("https://api.reelspan.com/mcp", auth=os.environ["REELSPAN_API_KEY"])
    async with MCPAdapter(reelspan) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5", tools)
        result = await agent.ainvoke({
            "messages": [{
                "role": "user",
                "content": "Publish 'Hello from my LangChain agent' as a text post to the sandbox network "
                "for the profile my-brand, then check its status and tell me the result.",
            }]
        })
        print(result["messages"][-1].content)


asyncio.run(main())

Replace my-brand with one of your profiles (the agent can find them with list_profiles).

Notes

  • Posting runs in the background. The publish tools return a request_id; the agent calls upload_status to read each network's result.
  • Media goes in as URLs. upload_video and upload_photos take public https URLs, not local files.
  • Scope the key. The agent can do whatever the key allows. A key with only Publish and Read can't create or delete profiles.
  • Going live: swap the test key for a live one (rs_live_…) and use real networks instead of sandbox.

The full tool list is on the MCP server page. LangChain's own guide: docs.langchain.com/oss/python/langchain/mcp.

Something unclear or missing? Write to [email protected] and we’ll fix the page.