Wire Keiro's remote MCP server into a LangGraph ReAct agent. Keiro gives your agent 4 web tools (cost credits per call) plus 8 free docs/utility tools — all read-only.
Full documentation — architecture, every tool & endpoint, params, credits, rate limits, auth, troubleshooting: see
docs/keiro-langgraph.md.
| Tool | Credits | Purpose |
|---|---|---|
web_search |
~1–2 | structured web results |
web_research |
~3–5 | deep multi-source research + synthesis |
extract_url |
~1–3 | structured extraction from a URL (JSON schema) |
answer |
~5 | direct Q&A, web search + AI synthesis |
list_endpoints, get_endpoint, get_rate_limits, get_auth, generate_code, get_mcp_tools, suggest_schema, check_credits |
free | Keiro API discovery |
- URL:
https://kierolabs.space/mcp/api - Transport: Streamable HTTP
- Header:
Authorization: Bearer keiro_<key>—KEIRO_API_KEYenv var
initialize runs without auth; every tools/list and tools/call needs the
header.
- Python 3.10+
- A Keiro API key (starts with
keiro_) from the Keiro dashboard → API Keys - An OpenAI API key (the ReAct agent's LLM) — or set
OPENAI_API_KEY
git clone https://github.com/Keirolabs-API/LangGraph-Keiro && cd LangGraph-Keiro && ./setup.shThis clones the repo, then setup.sh creates a .venv, installs
langgraph langchain-mcp-adapters langchain-openai, writes a .env from
.env.example (prompting for your Keiro and OpenAI keys), and runs a wiring
self-check. No network calls in the check — it only asserts the config/auth
header logic. Re-running ./setup.sh is idempotent and won't clobber existing
keys.
./run.sh "What changed in the EU AI Act this month?"run.sh loads .env and invokes keiro-integration/keiro_langgraph.py.
Costs Keiro credits (the four API tools deduct per call) + your LLM spend.
import asyncio
from langchain_openai import ChatOpenAI
from keiro_langgraph import build_keiro_agent # add keiro-integration/ to sys.path
async def main():
agent = await build_keiro_agent(ChatOpenAI(model="gpt-4o-mini"))
r = await agent.ainvoke({"messages": [{"role": "user", "content": "latest news on X"}]})
print(r["messages"][-1].content)
asyncio.run(main())build_keiro_agent loads Keiro's MCP tools via langchain_mcp_adapters
MultiServerMCPClient and hands them to LangGraph's create_react_agent.
python keiro-integration/keiro_langgraph.py checkKEIRO_API_KEY not set— run./setup.sh, orexport KEIRO_API_KEY=keiro_...and ensurerun.shcan read.env.401 / Unauthorizedfrom Keiro — the key is wrong, expired, or missing thekeiro_prefix.tools/listempty — theAuthorization: Bearer …header isn't reaching Keiro; confirm.envhas a non-emptyKEIRO_API_KEY.- LLM errors —
OPENAI_API_KEYmissing/invalid, or the model name inkeiro_langgraph.py(gpt-4o-miniby default) isn't available to your key. - Credit deductions you didn't expect — only
web_search,web_research,extract_url, andanswercost credits; the 8 discovery tools are free.
keiro-integration/keiro_langgraph.py— server config, client + agent builders, demo, self-check.keiro-integration/README.md— short integration-only README.setup.sh/run.sh/.env.example— install/run helpers.libs/,docs/,examples/— the upstream LangGraph monorepo (vendored so the integration is self-contained).
See LICENSE.