Skip to main content
Glama
adityapal26may

mcp-langchain-agent

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 task

Related MCP server: mcp-rag-server

The tools

The MCP server exposes three tools an LLM can call:

Tool

What it does

search_docs(query, top_k)

BM25-ish keyword search over a local corpus of markdown notes

get_doc(doc_id)

Fetch the full text of a doc by id

summarize(doc_id, max_words)

Returns a short summary of a doc (LLM-backed)

The agent

The LangChain agent:

  1. Receives a user task in natural language (e.g. "Find what our handbook says about vacation policy and give me a 3-bullet summary")

  2. Decides which tools to call, in what order

  3. Calls the tools via the MCP client

  4. 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.txt

Configure

export OPENAI_API_KEY=sk-...
# or
export ANTHROPIC_API_KEY=sk-ant-...

Run the demo

python examples/run_demo.py

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  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 (mcp Python SDK, langchain-mcp-adapters)

  • rank-bm25 for keyword search

  • pytest for 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

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Local-first RAG engine with MCP server for AI agent integration.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

  • An MCP server that gives your AI access to the source code and docs of all public github repos

View all MCP Connectors

Latest Blog Posts

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/adityapal26may/mcp-langchain-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server