Python, LangGraph, and LangChain MCP setup
Custom Python agents can connect through the MCP Python SDK Streamable HTTP client. LangGraph and LangChain jobs should use their MCP adapter when available, or wrap the SDK directly.
Python SDK shape
python
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async with streamablehttp_client(
"https://mcp.orkestia.dev/mcp",
headers={"Authorization": f"Bearer {token}"},
) as (read, write, _get_session_id):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()For in-cluster agents, use:
text
http://ltinteg-workflow-mcp.ltinteg-product:8000/mcpToken handling
Use a scoped per-job or per-agent token. Rotate it through the job secret manager instead of embedding it in source code.
Smoke test
- Initialize the MCP session.
- List tools.
- Call
whoami. - Call
list_workflow_types. - Start and watch a harmless workflow.
