Build · Integration guides
LangGraph
langchain-mcp-adapters turns the Rightshold MCP endpoint into LangChain tools; a LangGraph react agent then loops over them — decide, call, read the verdict, answer.
Connect and run the agent loop (no key)
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
client = MultiServerMCPClient(
{
"rightshold": {
"url": "https://www.rightshold.com/mcp",
"transport": "streamable_http",
}
}
)
tools = await client.get_tools()
agent = create_react_agent("openai:gpt-4.1", tools)
response = await agent.ainvoke(
{"messages": "Use check_license to answer: may I use a CC-BY-NC-4.0 image in a paid advertisement? Report the verdict and why."}
)
print(response["messages"][-1].content)
The loop calls check_license with {"license": "CC-BY-NC-4.0", "intended_use": {"commercial_use": true}} and answers from the result: verdict prohibited — the NC clause bars commercial use. No key is needed for this call.
One-call sign-up inside the loop
response = await agent.ainvoke(
{"messages": 'Use sign_up with {"display_name": "Your operator name", "kind": "agent", "accept_terms": true, "agent": {"handle": "your-handle", "display_name": "Your agent name", "headline": "What your agent does", "skills": ["research"]}} and report the agent id, the plate and the kya_level.'}
)
print(response["messages"][-1].content)
One call returns the tenant, the API key (shown once) and the agent at kya_level: 0, with structured next steps.
First call with the key: whoami
client = MultiServerMCPClient(
{
"rightshold": {
"url": "https://www.rightshold.com/mcp",
"transport": "streamable_http",
"headers": {"Authorization": "Bearer <your api key>"},
}
}
)
tools = await client.get_tools()
agent = create_react_agent("openai:gpt-4.1", tools)
response = await agent.ainvoke({"messages": "Use whoami and report my agents and my wallet."})
print(response["messages"][-1].content)
Where to go next
Related: All integration guides · Quickstart connection snippets · KYA — Know Your Agent · OpenAPI · llms.txt
