4,500+ servers built on MCP Fusion
Vinkius
Alai logo
Vinkius
LangChain logo

How to Use the Alai MCP in LangChain

Build agents in LangChain that automate headshot creation, from uploading a selfie to getting back a finished portrait.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

Alai MCP on Cursor AI Code Editor MCP Client Alai MCP on Claude Desktop App MCP Integration Alai MCP on OpenAI Agents SDK MCP Compatible Alai MCP on Visual Studio Code MCP Extension Client Alai MCP on GitHub Copilot AI Agent MCP Integration Alai MCP on Google Gemini AI MCP Integration Alai MCP on Lovable AI Development MCP Client Alai MCP on Mistral AI Agents MCP Compatible Alai MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
LangChain

Connect Alai MCP to LangChain

Create your Vinkius account to connect Alai to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Chain Headshot Generation Steps

The Alai MCP Server gives your LangChain agent tools to manage a full creative workflow. You can build chains that first check for existing headshots using `list_assets`, then create a new campaign with `create_campaign` if needed. It's a sequence that you define. Your agent can then use `create_asset` to upload a source photo, trigger the AI with `generate_content`, and periodically check the job status with `get_generation`. Each step's output feeds the next, so your agent handles the entire process without you having to watch it.

Manage Marketing Campaigns via API

This isn't just about single images. Use LangChain to build an agent that manages entire headshot campaigns for different teams or events. The agent can call `list_campaigns` to get an overview, then drill into specifics with `get_campaign`. You could even build a ReAct agent that decides which template to use by calling `list_templates` and comparing the options. It reasons about the best course of action based on the campaign goals you give it. This MCP server exposes the controls you need to get it done.

Full Observability with LangChain

Every call your agent makes to the Alai tools is a distinct link in your chain. With LangSmith, you can see exactly what inputs were sent to `create_asset` or what data was returned by `get_asset`. No more guessing what the agent did. This makes debugging complex chains way easier. You'll see the latency of each API call and the exact data flowing between Alai and your agent, helping you pinpoint errors or optimize your agent's logic.

Setup guide

Set up Alai MCP in LangChain

Prerequisites

  • Python 3.10+ installed
  • langchain-mcp-adapters + langgraph packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChain BaseTool objects.

  2. 2

    Connect via HTTP transport

    Use MultiServerMCPClient with "transport": "http" pointing to your Vinkius endpoint. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Create a ReAct agent

    Pass the discovered tools to create_react_agent() from LangGraph. The agent automatically routes Alai tool calls through the MCP protocol.

  4. 4

    Run with any LLM

    Swap ChatOpenAI for ChatAnthropic, ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.

agent.py
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

async with MultiServerMCPClient({
    "alai-mcp": {
        "transport": "http",
        "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
    }
}) as client:
    tools = client.get_tools()

    agent = create_react_agent(
        ChatOpenAI(model="gpt-4o"),
        tools,
    )
    result = await agent.ainvoke({
        "messages": "List recent Alai transactions"
    })
    print(result["messages"][-1].content)

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Alai. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about Alai MCP in LangChain

You get the tools from the MCP client and pass them to your agent factory, like `create_openai_tools_agent`. LangChain automatically handles converting the tool schemas so your agent knows how to call `create_campaign` or `generate_content`.
Yes. You can combine the Alai MCP Server tools with other LangChain integrations. Your chain could call Alai's `get_generation` to get the final image URL, then pass that URL to a separate email or messaging tool in the next step.
A solid use case is building an onboarding assistant. A new hire interacts with the agent, which uses Alai tools to generate their corporate headshot, and then uses other tools to add it to the company directory, all in one automated flow.
Absolutely. Your agent can fetch all active projects with `list_campaigns`, loop through them, and perform actions on each one. Because LangChain manages state, your agent can track its progress across all the campaigns it's managing with Alai.
The Alai server only processes the selfie images you explicitly upload via the `create_asset` tool. Vinkius runs each MCP Server in a sandboxed, ephemeral environment, and all communication is encrypted. The source photos are only used for the generation and aren't stored long-term.

Start using the Alai MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 12 tools

We've already built the connector for Alai. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 12 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.