Connect the MultitaskAI MCP server to LangChain
LangChain for Python loads MCP tools through its MCP adapter. Load the MultitaskAI tools with MCPAdapter and pass them to create_agent.
Endpoint
Text
https://mcp.multitaskai.com
Steps
- Create an API key in your MultitaskAI account.
- Install the MCP extra with pip install "langchain[mcp]".
- Load the MultitaskAI tools with MCPAdapter as below, with your key in place of YOUR_API_KEY.
- Pass the tools to create_agent and check that the agent calls them.
Python
from fastmcp.client import Client
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter
async def main():
async with MCPAdapter(Client("https://mcp.multitaskai.com", auth="YOUR_API_KEY")) as adapter:
tools = await adapter.list_tools()
agent = create_agent("claude-sonnet-5", tools)
return await agent.ainvoke(
{"messages": [{"role": "user", "content": "List my MultitaskAI tools."}]}
)
Authentication
LangChain sends your MultitaskAI API key in the Authorization header. Create a key in your account and use it in place of YOUR_API_KEY. Keep the key out of files you share or commit.
Text
Authorization: Bearer YOUR_API_KEY
Good to know
- The langchain.mcp namespace needs langchain[mcp] 1.4.0 or newer and is in beta.
- It replaces the separate langchain-mcp-adapters package and its MultiServerMCPClient.
- The auth value takes the bare key and sends it as a Bearer token.
- For TypeScript, see the LangChain.js guide.
Official documentation
The LangChain MCP documentation covers LangChain's own settings in detail. See the overview for the endpoint and authentication, and pricing for the daily free requests.