Post with LangChain

Post to social media
with LangChain.

Wrap PostLake as a single LangChain tool and your agent can publish to every social network on its own — no per-platform code, one normalised response it can reason over. Or skip the wrapper entirely and connect PostLake's MCP server.

Get started free →

No card for the free tier · one API for every network · full MCP access

The fastest way: ask your agent

Prefer no code at all? Connect PostLake's hosted MCP server to your AI assistant (Claude, ChatGPT, Cursor and others) and just ask it to post. It authorizes over OAuth — no key to paste. See the MCP guide.

Post with LangChain

This is the whole integration — connect your accounts once in the dashboard, then:

from langchain_core.tools import tool
import requests

@tool
def post_to_social(text: str, platforms: list[str]) -> dict:
    """Publish a post to the given social networks via PostLake."""
    r = requests.post(
        "https://api.postlake.dev/v1/posts",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={"text": text, "platforms": platforms, "profile": "my-brand"},
    )
    return r.json()

# Bind the tool to your model and the agent can now post when asked.

Step by step

  1. Create a PostLake API key (Settings → API Keys) and connect your accounts under a profile.
  2. Define one tool that POSTs to /v1/posts — the snippet above is the whole thing.
  3. Bind the tool to your LLM (model.bind_tools([post_to_social])) or add it to your agent's toolset.
  4. Ask the agent to post — it calls the tool and gets back one normalised result with each network's live URL.

Good to know

Why PostLake

One call, every network

List the platforms in one request and PostLake posts to all of them, returning a single normalised shape — your code never branches per platform.

No app setup

PostLake manages each network's developer app and OAuth for you — nothing to register or get reviewed yourself.

Agent-safe

Idempotency keys mean a retry never double-posts, and analytics come back normalised so an agent can decide what to post next.

Honest pricing

A free tier to start, then usage-based credits — one per post. You only pay for posts that actually publish.

Common questions

How do I let a LangChain agent post to social media?

Define a LangChain tool that calls PostLake's /v1/posts endpoint, then bind it to your model. The agent can then publish to every network through that one tool. You can also connect PostLake's MCP server instead of writing a tool.

Do I need a tool per social network in LangChain?

No — one tool calling PostLake covers every network, so your agent stays simple and you don't maintain a tool per platform.

Can LangChain use PostLake over MCP?

Yes. PostLake is an MCP server, so an MCP-capable LangChain setup can use its posting tools directly without a custom wrapper.

More guides

Python · Node.js · n8n · Make · Zapier · All guides · Full docs

One API and MCP server for every major network. Free to start.

Get started free →