nestjs-langgraph-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nestjs-langgraph-mcprun agent: explain recursion with an example"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NestJS + LangGraph MCP POC
A simple proof-of-concept MCP server built with NestJS, using LangGraph as the orchestration layer for tool execution and agent workflows.
Features
NestJS application context (no HTTP server required)
MCP server over stdio transport
LangGraph
StateGraphworkflow with nodes:route(model-based tool routing)executeTool(executes selected tool)respond(final answer generation)
Model provider switch:
OpenAI (
@langchain/openai)Ollama local model (
@langchain/ollama, defaultqwen2.5:1.5b)
Related MCP server: SampleMCP
Quick Start
Install dependencies:
npm installConfigure environment:
cp .env.example .envBuild and run:
npm run build
npm startThe MCP server starts on stdio.
Model Selection
Default provider is read from MODEL_PROVIDER.
Use OpenAI:
MODEL_PROVIDER=openaiset
OPENAI_API_KEYoptional
OPENAI_MODEL(defaultgpt-4o-mini)
Use Ollama qwen2.5:1.5b:
MODEL_PROVIDER=ollamarun Ollama locally and pull model:
ollama pull qwen2.5:1.5boptional
OLLAMA_BASE_URLandOLLAMA_MODEL
You can override provider/model per MCP tool call (run_agent).
MCP Tools
health: returns server status and default model configrun_agent: runs the LangGraph workflowinput:
prompt(string, required)provider(openaiorollama, optional)model(string, optional)
Example MCP Client Config (Claude Desktop style)
{
"mcpServers": {
"nestjs-langgraph": {
"command": "node",
"args": ["/absolute/path/to/langraph-mcp/dist/main.js"],
"env": {
"MODEL_PROVIDER": "ollama",
"OLLAMA_BASE_URL": "http://localhost:11434",
"OLLAMA_MODEL": "qwen2.5:1.5b"
}
}
}
}LangGraph Demo Suite
This repo includes agents and tools built using proper LangGraph.js patterns:
Tools: Defined using
tool()from@langchain/core/toolswith Zod schemasAgents: Built with
createReactAgentor customStateGraphwithMessagesAnnotationTool Execution: Uses
ToolNodeandtoolsConditionfrom@langchain/langgraph/prebuiltLLM Binding: Tools bound to LLM via
.bindTools(tools)
Demo Capabilities
Demo | Capability |
01-reasoning | Basic StateGraph workflow |
02-parallel | Parallel tool calls via ToolNode |
03-handoffs | Agent-to-agent handoffs via coordinator |
04-hitl | Human-in-the-loop approval workflow |
05-structured | Structured output with Zod validation |
06-tracing | Execution tracing through graph |
07-discovery | Tool discovery and registry |
08-planning | Multi-step planning loop |
09-failure | Error handling and retry |
10-local | Local Ollama model integration |
Project Layout
demos/
├── demo-runner.ts
├── 01-reasoning.demo.ts
├── 02-parallel.demo.ts
├── 03-handoffs.demo.ts
├── 04-hitl.demo.ts
├── 05-structured-output.demo.ts
├── 06-tracing.demo.ts
├── 07-tool-discovery.demo.ts
├── 08-multi-step-planning.demo.ts
├── 09-failure-handling.demo.ts
├── 10-local-model.demo.ts
└── utils/demo-utils.ts
agents/
├── agent.factory.ts
├── tools.ts
├── coordinator.agent.ts
├── employee.agent.ts
├── analytics.agent.ts
├── reporting.agent.ts
├── approval.agent.ts
└── model.config.tsPrerequisites
Ensure Ollama is running with a tool-capable model:
# qwen2.5:1.5b supports tool calling (recommended)
ollama pull qwen2.5:1.5b
ollama serveNote: Models like qwen2.5:1.5b do not support tool calling. Use qwen2.5:1.5b, llama3.1, mistral, or qwen2.5 for full demo functionality.
Run all demos:
npm run demoRun one demo:
npm run demo:one -- 03Optional HITL switch for demo 04:
DEMO_REVIEW_DECISION=approved npm run demo:one -- 04Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Alicense-qualityCmaintenanceA transport-agnostic MCP server that integrates multiple AI coding agents (Claude Code, Gemini, and Codex) with built-in tools for command execution, calculations, and streaming capabilities. Supports both STDIO and HTTP transports for flexible deployment.Last updated571MIT
- Flicense-qualityCmaintenanceA demonstration MCP server that provides math (add/multiply) and weather tools, connecting via stdio and streamable HTTP, and integrates with LangChain and LangGraph for agentic workflows.Last updated
- AlicenseDqualityDmaintenanceA TypeScript MCP server demo supporting local Stdio and remote Streamable HTTP, demonstrating tool invocation for AI agents.Last updated2MIT
- Flicense-qualityDmaintenanceAn MCP server with LangGraph agent integration that enables AI agents to use custom tools and external APIs for dice rolling, web search, social content creation, and GitHub access via STDIO transport.Last updated3
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Touseef-ahmad/experimental-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server