mcp-langchain-agent
Click on "Deploy 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., "@mcp-langchain-agentFind what our handbook says about vacation policy and give me a 3-bullet summary"
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.
mcp-langchain-agent
A Model Context Protocol (MCP) server exposing a small set of tools, paired with a LangChain agent that uses those tools to complete multi-step tasks.
π What this proves to a recruiter: I can build agentic systems β tool use, MCP, multi-step planning β extending the kind of MCP server work happening on Adobe AEM today.
What's in here
mcp-langchain-agent/
βββ mcp_server/ # MCP server that exposes tools via stdio
β βββ server.py # entrypoint, registers tools
β βββ tools.py # the actual tool implementations
β βββ schemas.py # JSON schemas for tool inputs/outputs
βββ agent/
β βββ client.py # LangChain agent that connects to the MCP server
β βββ chains.py # reusable prompt/chain definitions
βββ tests/
β βββ test_server.py
β βββ test_agent.py
βββ examples/
βββ run_demo.py # end-to-end demo of the agent solving a taskRelated MCP server: mcp-rag-server
The tools
The MCP server exposes three tools an LLM can call:
Tool | What it does |
| BM25-ish keyword search over a local corpus of markdown notes |
| Fetch the full text of a doc by id |
| Returns a short summary of a doc (LLM-backed) |
The agent
The LangChain agent:
Receives a user task in natural language (e.g. "Find what our handbook says about vacation policy and give me a 3-bullet summary")
Decides which tools to call, in what order
Calls the tools via the MCP client
Synthesises the answer from the tool outputs
Powered by langchain-mcp-adapters so the MCP tools become LangChain Tool objects β no glue code.
Quickstart
Prerequisites
Python 3.11+
An OpenAI or Anthropic API key
Install
git clone https://github.com/adityapal26may/mcp-langchain-agent
cd mcp-langchain-agent
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtConfigure
export OPENAI_API_KEY=sk-...
# or
export ANTHROPIC_API_KEY=sk-ant-...Run the demo
python examples/run_demo.pyArchitecture
ββββββββββββββββββββ ββββββββββββββββββββββ
β LangChain Agent β βββββββΆ β MCP Server (stdio)β
β (client.py) β tools β (server.py) β
ββββββββββββββββββββ JSON βββββββββββ¬βββββββββββ
β² β
β βΌ
β ββββββββββββββββββββββ
β β Tool Implementationsβ
β β (tools.py) β
β βββββββββββ¬βββββββββββ
β β
ββββββββ synthesized answer βββββWhy MCP
MCP is becoming the standard protocol for connecting LLMs to tools and data sources β Anthropic, OpenAI, and major IDE vendors all support it. Building a server + client pair here is a direct demonstration of:
Multi-step agentic reasoning
Tool schema design (JSON Schema for inputs)
Process-level service boundaries (the MCP server runs as a separate process)
Tech Stack
Python 3.11, FastAPI (for the HTTP wrapper demo)
LangChain (
langchain,langchain-openai,langchain-anthropic)MCP (
mcpPython SDK,langchain-mcp-adapters)rank-bm25for keyword searchpytestfor tests
Roadmap
Streaming token output from the agent
Persistent conversation memory
Observability: log every tool call + token usage
HTTP transport (in addition to stdio)
Eval suite: 20+ tasks with expected tool-call sequences
Author
Aditya Pal β @adityapal26may
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for langchain documentation, generated by doc2mcp.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
MCP server for agentverse documentation, generated by doc2mcp.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context6 npm265MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).25 npm37MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for indexing, semantic search, and generation of multi-format documents. Exposes 13 tools over JSON-RPC 2.0 so an LLM can search your local PDF, Excel, and Word files, and create or edit Excel and Word documents.AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server integrating LangChain, RAG, and Agent to provide knowledge retrieval and tool invocation through natural language.-