You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from langchain_core.messages import HumanMessage, SystemMessage
421
421
422
422
@tool
@@ -434,10 +434,10 @@ model = ChatAnthropic(
434
434
model="claude-sonnet-4-5-20250929",
435
435
temperature=0,
436
436
)
437
-
agent = create_react_agent(
437
+
agent = create_agent(
438
438
model,
439
439
tools=[multiply, add],
440
-
prompt=SystemMessage(
440
+
system_prompt=SystemMessage(
441
441
content="You are a helpful assistant that performs arithmetic."
442
442
),
443
443
)
@@ -575,6 +575,81 @@ print(result)`}</CodeBlock>
575
575
</div>
576
576
</div>
577
577
578
+
### Using MCP Tools
579
+
580
+
Both frameworks support the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), letting agents connect to external tools and services exposed by MCP servers. Haystack provides `MCPTool` and `MCPToolset` through the `mcp-haystack` integration package, which plug directly into the `Agent` component. LangChain's MCP support relies on the separate `langchain-mcp-adapters` package and requires an async workflow throughout.
0 commit comments