
Store and retrieve entities, relations and observations in a persistent local knowledge graph.

A standalone MCP server that exposes a LangChain ReAct agent as a high-level MCP tool, built with FastAPI and deployed on Google Cloud Run.
LangChain Agent MCP Server is cataloged as an MCP server attributed to mcpmessenger. A standalone MCP server that exposes a LangChain ReAct agent as a high-level MCP tool, built with FastAPI and deployed on Google Cloud Run. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for LangChain Agent MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, the agent_executor tool accepts an optional system_instruction parameter that customizes the agent's behavior per invocation; each such invocation creates a new agent instance.
Responses are returned as content containing a text block with the agent's answer and an isError flag.
Yes, a test-prompt endpoint accepts a snapshot and a prompt and returns matching elements from the snapshot.
README.md · 29afc19a0a0b · Fetched 2026-11-13 13:59:39 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A production-ready MCP server exposing LangChain agent capabilities through the Model Context Protocol, deployed on Google Cloud Run.
This is a standalone backend service that wraps a LangChain agent as a single, high-level MCP Tool. The server is built with FastAPI and deployed on Google Cloud Run, providing a scalable, production-ready solution for exposing AI agent capabilities to any MCP-compliant client.
Live Service: https://langchain-agent-mcp-server-554655392699.us-central1.run.app
| Component | Technology | Purpose |
|---|---|---|
| Backend Framework | FastAPI | High-performance, asynchronous web server |
| Agent Framework | LangChain | Multi-step reasoning and tool execution |
| Deployment | Google Cloud Run | Serverless, auto-scaling hosting |
| Containerization | Docker | Consistent deployment environment |
| Protocol | Model Context Protocol (MCP) | Standardized tool and context sharing |
Clone the repository:
git clone https://github.com/mcpmessenger/LangchainMCP.git
cd LangchainMCP
Install dependencies:
# Windows
py -m pip install -r requirements.txt
# Linux/Mac
pip install -r requirements.txt
Set up environment variables:
Create a .env file:
OPENAI_API_KEY=your-openai-api-key-here
OPENAI_MODEL=gpt-4o-mini
PORT=8000
Run the server:
# Windows
py run_server.py
# Linux/Mac
python run_server.py
Test the endpoints:
Start the frontend (optional):
# Install frontend dependencies (first time only)
npm install
# Start frontend dev server
npm run dev
Then visit http://localhost:8080/sandbox to use the Playwright Sandbox preview feature.
The server is designed for deployment on Google Cloud Run. See our comprehensive deployment guides:
# Windows PowerShell
.\deploy-cloud-run.ps1 -ProjectId "your-project-id" -Region "us-central1"
# Linux/Mac
./deploy-cloud-run.sh your-project-id us-central1
GET /mcp/manifest
Returns the MCP manifest declaring available tools.
Response:
{
"name": "langchain-agent-mcp-server",
"version": "1.0.0",
"tools": [
{
"name": "agent_executor",
"description": "Execute a complex, multi-step reasoning task...",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The user's query or task"
},
"system_instruction": {
"type": "string",
"description": "Optional system-level instructions to customize agent behavior"
}
},
"required": ["query"]
}
}
]
}
POST /mcp/invoke
Content-Type: application/json
{
"tool": "agent_executor",
"arguments": {
"query": "What is the capital of France?",
"task_id": "optional-workflow-id"
}
}
With System Instruction (Optional):
POST /mcp/invoke
Content-Type: application/json
{
"tool": "agent_executor",
"arguments": {
"query": "Analyze Tesla stock",
"system_instruction": "You are a financial analyst. Provide detailed analysis with specific numbers."
}
}
Response:
{
"content": [
{
"type": "text",
"text": "The capital of France is Paris."
}
],
"isError": false
}
The agent_executor tool supports an optional system_instruction parameter that allows you to customize the agent's behavior on a per-invocation basis.
Usage:
Basic Query (uses default prompt):
{
"tool": "agent_executor",
"arguments": {
"query": "What is the weather today?"
}
}
Query with Custom Instruction:
{
"tool": "agent_executor",
"arguments": {
"query": "Explain quantum computing",
"system_instruction": "You are a physics professor. Explain concepts clearly and use examples."
}
}
Personality Customization:
{
"tool": "agent_executor",
"arguments": {
"query": "Tell me about space",
"system_instruction": "You are a pirate explaining complex topics. Use pirate terminology!"
}
}
Notes:
system_instruction is omitted, the agent uses its default promptPOST /api/playwright/snapshot
Content-Type: application/json
{
"url": "wikipedia.org",
"use_cache": true
}
Response:
{
"snapshot": "[body]\n Name: Wikipedia\n [main]\n Name: Main content...",
"url": "https://wikipedia.org",
"cached": false,
"token_count": 3307
}
Features:
POST /api/playwright/test-prompt
Content-Type: application/json
{
"snapshot": "[body]\n [button]\n Name: Login",
"prompt": "Find the login button"
}
Response:
{
"matches": [
{
"line": 2,
"content": "[button] Name: Login",
"context": "..."
}
],
"prompt": "Find the login button",
"total_matches": 1
}
Playwright Sandbox UI:
Visit http://localhost:8080/sandbox to use the interactive preview feature:
GET / - Server informationGET /health - Health checkGET /api/tasks - Safe task summaries (optional monitoring)GET /api/tasks/{task_id} - Safe task summary (optional monitoring)GET /docs - Interactive API documentation (Swagger UI)| Variable | Description | Default | Required |
|---|---|---|---|
OPENAI_API_KEY | OpenAI API key | - | ✅ Yes |
OPENAI_MODEL | OpenAI model to use | gpt-4o-mini | No |
PORT | Server port | 8000 | No |
API_KEY | Optional API key for authentication | - | No |
MAX_ITERATIONS | Maximum agent iterations | 10 | No |
DEFAULT_SYSTEM_INSTRUCTION | Default system prompt (Glazyr) | - | No |
VERBOSE | Enable verbose logging | false | No |
POLICY_ENFORCEMENT | Enforce /mcp/invoke policy gates | false | No |
MAX_QUERY_CHARS | Max allowed query size | 5000000 | No |
ALLOWLISTED_DOMAINS | Comma-separated domain allowlist (query URLs) | - | No |
REDIS_URL | Enable Redis state store + task monitoring | - | No |
TASK_TTL_SECONDS | Task summary TTL | 86400 | No |
RECENT_TASKS_MAX | Recent task index size | 200 | No |
📖 Full Documentation Site - Complete documentation with examples (GitHub Pages)
Quick Links:
Build Docs Locally:
# Windows
.\build-docs.ps1 serve
# Linux/Mac
./build-docs.sh serve
Additional Guides:
# Test health endpoint
Invoke-WebRequest -Uri "https://langchain-agent-mcp-server-554655392699.us-central1.run.app/health"
# Test agent invocation
$body = @{
tool = "agent_executor"
arguments = @{
query = "What is 2+2?"
}
} | ConvertTo-Json
Invoke-WebRequest -Uri "https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/invoke" `
-Method POST `
-ContentType "application/json" `
-Body $body
# Test with system instruction
$bodyWithInstruction = @{
tool = "agent_executor"
arguments = @{
query = "What is 2+2?"
system_instruction = "You are a math teacher. Explain your reasoning step by step."
}
} | ConvertTo-Json
Invoke-WebRequest -Uri "https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/invoke" `
-Method POST `
-ContentType "application/json" `
-Body $bodyWithInstruction
The Playwright Sandbox is an interactive preview feature that demonstrates how AI agents "view" websites through structured accessibility data. This feature is particularly useful for understanding the value of structured snapshots compared to full HTML or screenshots.
NotImplementedError on Windows using ProactorEventLoopInstall Playwright:
py -m pip install playwright
py -m playwright install chromium
Start Backend:
py run_server.py
Start Frontend:
npm install # First time only
npm run dev
Visit Sandbox: Open http://localhost:8080/sandbox and try URLs like:
wikipedia.orggithub.comgoogle.comSee PLAYWRIGHT_SANDBOX_SETUP.md for detailed setup instructions.
.
├── src/
│ ├── main.py # FastAPI application with MCP endpoints
│ ├── agent.py # LangChain agent definition and tools
│ ├── pages/
│ │ └── Sandbox.tsx # Playwright Sandbox UI component
│ ├── mcp_manifest.json # MCP manifest configuration
│ └── start.sh # Cloud Run startup script
├── tests/
│ └── test_mcp_endpoints.py # Test suite
├── Dockerfile # Container configuration
├── requirements.txt # Python dependencies (includes playwright)
├── deploy-cloud-run.ps1 # Windows deployment script
├── deploy-cloud-run.sh # Linux/Mac deployment script
└── cloudbuild.yaml # Cloud Build configuration
See DEPLOY_CLOUD_RUN_WINDOWS.md for detailed instructions.
docker build -t langchain-agent-mcp-server .
docker run -p 8000:8000 -e OPENAI_API_KEY=your-key langchain-agent-mcp-server
We welcome contributions! Please see our contributing guidelines.
This project is licensed under the MIT License.
Status: ✅ Production-ready and deployed on Google Cloud Run
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for LangChain Agent MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/langchainmcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

Organize problem solving into revisable, branching thought steps through an MCP tool.

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.