mcpField
M
MCP Tool Langgraph Integration

MCP Tool Langgraph Integration

github.com/paulrobelloFrameworks & SDKs47Updated 84w ago

About MCP Tool Langgraph Integration

Example project demonstrating MCP tool integration into Langgraph. Implements a simple graph with agent and tool nodes.

Key features

  1. 01MCP tools integrated into Langgraph nodes
  2. 02Brave Search MCP server example
  3. 03Simplified two-node graph structure
  4. 04Multiple MCP server support

Use cases

  1. 01Learn MCP tool usage in Langgraph workflows
  2. 02Build agent workflows using MCP services
  3. 03Integrate multiple MCP services into agent applications

MCP support

Example demonstrates integrating MCP service tools like Brave Search into Langgraph tool nodes, enabling agents to invoke MCP services.

Details

From the project README

MCP Tool Langgraph Integration

Description

Example project of how to integrate MCP endpoint tools into a Langgraph tool node

The graph consists of only 2 nodes, agent and tool.

Prerequisites

To use this project, make sure you have Python 3.11.

uv is recommended
Linux and Mac
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
MCP Server requirements
  • This example uses the MCP Server sample @modelcontextprotocol/server-brave-search to add Brave Search tools. This requires that you have node and npx installed.
API Keys
  • The MCP Server sample used is for Brave Search, you can get a free API key from https://brave.com/search/api/
  • You will need and API key for the chosen AI provider which defaults to Anthropic but can be changed by editing the __main__.py file
  • Put all api keys in a .env file in the repository root.

From source Usage

uv run mcp_langgraph_tools

Multiple MCP servers at one time

Check the multi_server branch for a more advanced example of how to use multiple MCP servers at once.

Whats New

  • Version 0.1.0:
    • Initial release

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Paul Robello - [email protected]

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.