Langchain Data Agent
NL2SQL - Ask questions in plain English, get SQL queries and results. Powered by LangGraph.
What is Langchain Data Agent?
Langchain Data Agent is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to nl2sql - ask questions in plain english, get sql queries and results. powered by langgraph.
NL2SQL - Ask questions in plain English, get SQL queries and results. Powered by LangGraph.
This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- NL2SQL - Ask questions in plain English, get SQL queries and
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx langchain-data-agentConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Langchain Data Agent
Langchain Data Agent is a natural-language-to-SQL (NL2SQL) platform built on LangGraph and Azure OpenAI that lets you query databases in plain English and receive formatted results without writing any SQL. It supports multiple database backends including PostgreSQL, Azure SQL, Azure Synapse, Azure Cosmos DB, Databricks SQL, and Google BigQuery, and automatically routes your question to the correct data agent based on context. Teams that need business analysts or non-technical users to access structured data directly through conversational AI will benefit the most from this server.
Prerequisites
- Python 3.12 or higher
- uv package manager (https://docs.astral.sh/uv/)
- An Azure OpenAI deployment with a model endpoint and API key
- A running database instance (PostgreSQL, Azure SQL, Cosmos DB, Databricks, BigQuery, or Synapse)
- An MCP-compatible client such as Claude Desktop or Cursor
Clone the repository and install dependencies
Clone the project and use uv to sync all dependencies including optional extras for your target database backends.
git clone https://github.com/eosho/langchain_data_agent
cd langchain_data_agent
uv sync --all-extrasConfigure environment variables
Copy the example environment file and fill in your Azure OpenAI credentials and database connection strings. The .env file must be edited before the server can connect to any data source.
cp .env.example .env
# Edit .env and set:
# AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
# AZURE_OPENAI_API_KEY=your_api_key
# AZURE_OPENAI_DEPLOYMENT=your_deployment_name
# DATABASE_URL=postgresql://user:pass@host:5432/dbnameValidate configuration files
Use the data-agent CLI to validate your YAML configuration files for each data source before running queries.
data-agent validateTest the CLI with a single query
Run a natural language query against your configured data source to confirm the setup is working end-to-end.
data-agent query "How many orders were placed last month?"
# Or target a specific config:
data-agent query "What is the total revenue by region?" -c contosoStart the interactive chat mode
Launch the multi-turn interactive chat mode, which maintains conversation context so follow-up questions like 'Show me a bar chart of that' work correctly.
data-agent chatOptionally launch the Chainlit web UI
For a browser-based interface with data visualization support, start the Chainlit web UI instead of the CLI.
chainlit run src/data_agent/ui/app.pyLangchain Data Agent Examples
Client configuration
Claude Desktop configuration to run the data agent as an MCP server process. Adjust the directory path to where you cloned the repo.
{
"mcpServers": {
"langchain-data-agent": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/langchain_data_agent",
"data-agent"
],
"env": {
"AZURE_OPENAI_ENDPOINT": "https://your-resource.openai.azure.com/",
"AZURE_OPENAI_API_KEY": "your_api_key",
"AZURE_OPENAI_DEPLOYMENT": "your_deployment_name"
}
}
}
}Prompts to try
Natural language queries that the data agent translates to SQL and executes against your configured databases.
- "How many orders were placed last month?"
- "What is the total revenue by region for Q4?"
- "Show me all high-severity fraud alerts from the past week."
- "Who are the top 5 customers by transaction volume? Show me a bar chart."
- "What is the average daily rate by room type?"
- "Which products need to be reordered based on current inventory levels?"Troubleshooting Langchain Data Agent
The agent returns 'No config found' or fails to route the query to a data agent
Run 'data-agent configs' to list available configuration files and 'data-agent validate' to check for YAML errors. Make sure your .env file has the correct DATABASE_URL and Azure OpenAI credentials set.
SQL validation errors when querying Azure SQL or Synapse
The system uses sqlglot for dialect-specific validation. Ensure your YAML config file specifies the correct dialect (e.g., 'tsql' for Azure SQL, 'sparksql' for Databricks). Check the docs/DATABASE_SETUP.md file in the repository for dialect-specific setup.
Azure AD authentication fails when connecting to Azure SQL or Cosmos DB
The server supports Azure AD token-based auth. Set the AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID environment variables in your .env file and ensure your service principal has the required database role assignments.
Frequently Asked Questions about Langchain Data Agent
What is Langchain Data Agent?
Langchain Data Agent is a Model Context Protocol (MCP) server that nl2sql - ask questions in plain english, get sql queries and results. powered by langgraph. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Langchain Data Agent?
Follow the installation instructions on the Langchain Data Agent GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Langchain Data Agent?
Langchain Data Agent works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Langchain Data Agent free to use?
Yes, Langchain Data Agent is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Langchain Data Agent Alternatives — Similar Data Science & ML Servers
Looking for alternatives to Langchain Data Agent? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
Browse More Data Science & ML MCP Servers
Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Langchain Data Agent in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Langchain Data Agent?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.