- Home
- MCP servers
- LangChain Documentation
LangChain Documentation
- python
0
GitHub Stars
python
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"liteobject-langchain-mcp-server": {
"command": "python",
"args": [
"path/to/langchain-mcp-server/run.py",
"mcp"
],
"env": {
"HOST": "0.0.0.0",
"PORT": "8000",
"DEBUG": "False",
"LOG_LEVEL": "INFO",
"PYTHONPATH": "path/to/langchain-mcp-server",
"GITHUB_TOKEN": "YOUR_TOKEN",
"REQUEST_TIMEOUT": "30 seconds"
}
}
}
}You can run this LangChain MCP Server in dual modes to access live LangChain docs, API references, tutorials, and code examples via a native MCP interface or a FastAPI web service. It fetches data from LangChain sources in real time, making it easy to integrate up-to-date information into your own MCP client workflows.
How to use
You interact with the LangChain Documentation MCP Server through your MCP client to perform searches, fetch API references, retrieve code examples from GitHub, access tutorials, and get the latest LangChain version. Use the MCP tools to perform targeted lookups and integrate results into your applications or development workflows. The server exposes a concise set of endpoints and tools that you can call from your MCP client, enabling you to discover and consume LangChain content without leaving your environment.
How to install
Prerequisites: you need Python installed and Docker if you plan to use Docker Compose. You also need network access to reach LangChain sources.
# Option 1: Docker Compose (Recommended)
# 1. Clone the repository
git clone https://github.com/LiteObject/langchain-mcp-server.git
cd langchain-mcp-server
# 2. Start the FastAPI server (Docker Compose builds and runs both modes)
docker-compose up --build
# 3. Access the API
# API Documentation: http://localhost:8080/docs
# Health Check: http://localhost:8080/health
Option 2: Local development (FastAPI mode or MCP server mode) requires dependencies installed in a Python environment.
# Install dependencies
pip install -r requirements.txt
# FastAPI mode examples
# Using the main entry point
python run.py
# Or using dedicated script
python scripts/run_fastapi.py
# Or directly with uvicorn
uvicorn src.api.fastapi_app:app --host 0.0.0.0 --port 8000
# MCP server mode examples
# Run the MCP server in the main entry point
python run.py mcp
# Or using the dedicated script
python scripts/run_mcp.py
Additional configuration and usage notes
Environment variables, Docker port mappings, and how to start in different modes are described below to help you configure and run the server in your environment.
Configuration and security
Configuration options include the host, port, debug mode, log level, and request timeouts. You can run the server behind Docker with a pre-defined port mapping. Security considerations include enabling rate limiting, configuring CORS if needed for web access, using a GitHub token for higher API limits, and validating all inputs via the built-in data models.
Troubleshooting and notes
If you encounter issues, check the health endpoint for service status, inspect Docker logs, review application logs, and verify external network access. For MCP mode difficulties, verify the MCP client configuration and command invocation.
Available tools
search_langchain_docs
Search LangChain documentation in real-time across official sources.
search_api_reference
Search API reference specifically within LangChain sources.
get_api_reference
Retrieve detailed API reference for a specific class.
get_github_examples
Fetch real code examples from the LangChain GitHub repository.
get_tutorials
List and access LangChain tutorials and guides.
get_latest_version
Obtain the latest LangChain version information from PyPI.