Skip to main content
Glama
README.md
# 🔗 LangGraph Patterns MCP Server

An MCP (Model Context Protocol) server that provides LangGraph agent patterns, code snippets, and best practices directly to your AI assistant.

## Features

- 🤖 **6 Production Patterns**: ReAct agents, human-in-the-loop, multi-agent, tool calling, streaming, error handling
- 📝 **Quick Snippets**: State, nodes, edges, conditionals, checkpoints, tools
- 📚 **Resources**: Quickstart guide, best practices, cheatsheet
- ⚡ **Zero Config**: Just install and use

## Installation

```bash
npm install -g langgraph-patterns-mcp
```

## Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "langgraph": {
      "command": "npx",
      "args": ["-y", "langgraph-patterns-mcp"]
    }
  }
}
```

## Usage with Cursor

Add to your `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "langgraph": {
      "command": "npx",
      "args": ["-y", "langgraph-patterns-mcp"]
    }
  }
}
```

## Available Tools

### `get_pattern`
Get a complete pattern with code and tips.

```
get_pattern("react-agent")
get_pattern("human-in-loop")
get_pattern("multi-agent")
get_pattern("tool-calling")
get_pattern("streaming")
get_pattern("error-handling")
```

### `list_patterns`
List all available patterns.

### `get_snippet`
Get a quick code snippet.

```
get_snippet("state")
get_snippet("node")
get_snippet("edge")
get_snippet("conditional")
get_snippet("checkpoint")
get_snippet("tools")
```

## Resources

Access these resources through your MCP client:

- `langgraph://quickstart` - Get started in 5 minutes
- `langgraph://best-practices` - Production best practices
- `langgraph://cheatsheet` - Quick reference

## Example

Ask your AI assistant:

> "Show me how to build a LangGraph agent with human-in-the-loop approval"

The assistant will use this MCP server to provide production-ready code.

## Want More?

This MCP server covers the essentials. For advanced patterns:

- 📘 **[AI Agent Builder's Playbook](https://rajathbharadwaj.github.io/ai-agent-playbook/)** - Complete guide with voice agents, trading bots, and deployment
- 📝 **[LangGraph Cheatsheet](https://rajathbharadwaj.github.io/langgraph-cheatsheet/)** - Printable quick reference
- 🔧 **[System Prompts Collection](https://rajathbharadwaj.github.io/system-prompts/)** - 25 production-tested prompts

## License

MIT

---

Built by [@Rajathbharadwaj](https://github.com/Rajathbharadwaj)

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation3/5

get_pattern and get_snippet overlap substantially: get_pattern already returns a code example, while get_snippet returns code for a 'specific LangGraph concept', making the boundary between the two fuzzy. list_patterns is clearly distinct, but an agent may struggle to pick between get_pattern and get_snippet for a code request.

Naming Consistency5/5

All three tools follow a clean verb_noun snake_case pattern: get_pattern, list_patterns, get_snippet. Verbs (get/list) accurately signal the operation type.

Tool Count4/5

Three tools is small but appropriate for a focused reference server covering patterns and snippets. It is slightly thin, but each tool serves a plausible purpose and none are redundant filler.

Completeness4/5

The surface covers the core lifecycle for a pattern library: list available patterns, retrieve a full pattern with example, and fetch a snippet. Minor gaps exist (no search or filtering by concept/tag), but the essential operations are present.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues