Content
# Langflow Document Question Answering System MCP Tool
This is a tool developed using the Model Context Protocol (MCP) for interacting with the Langflow document question answering system. It allows you to query the Langflow application directly in Claude and receive responses.
## Features
- Supports submitting queries to the Langflow document question answering system
- Checks the status of the Langflow service
- Provides query prompt templates
## System Requirements
### Prerequisites
- **Python**: >= 3.10 (due to MCP 1.3.0 requirements)
- [MCP](https://github.com/modelcontextprotocol/python-sdk) >= 1.3.0
- Claude Desktop application (for using Claude integration features)
- [uv](https://github.com/astral-sh/uv) package manager (recommended)
### Dependencies
- requests >= 2.31.0
- python-dotenv >= 1.0.0
- typer >= 0.9.0
- uvicorn >= 0.22.0
## Installation Steps
### 1. Check Python Version
```bash
python --version # Ensure version >= 3.10
```
### 2. Create a Virtual Environment using uv
```bash
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a virtual environment
uv venv .venv
# Activate the virtual environment
source .venv/bin/activate
```
### 3. Install Dependencies
```bash
# Install dependencies using uv
uv pip install -e .
```
### 4. Configure Environment Variables
Create a `.env` file and set the following parameters:
```ini
# Langflow API settings
LANGFLOW_API_URL=http://127.0.0.1:7864 # Adjust according to your Langflow service address
LANGFLOW_FLOW_ID=your-flow-id-here # Your Langflow flow ID
LANGFLOW_ENDPOINT= # Optional endpoint name
LANGFLOW_API_KEY= # API key if needed
# Server settings
PORT=8000 # Port for MCP server to run
```
## Usage
### Development Mode
Run and test in development mode:
```bash
langflow-mcp dev
```
This will start:
- MCP server at http://localhost:8000
- MCP Inspector at http://localhost:5173
### Install to Claude Desktop
Ensure all dependencies are correctly installed:
```bash
mcp install langflow_mcp_tool/server.py \
--name "Langflow Document Question Answering" \
--with requests \
--with python-dotenv \
--with uvicorn \
--with typer
```
### Run the Server Directly
```bash
langflow-mcp run
```
## Functionality Description
### 1. Query Function (Tool)
Use in Claude:
```
Use langflow_query tool to query "your question"
```
Parameters:
- `query`: The query or question to retrieve
- `tweaks`: (optional) Parameters for customizing the flow
### 2. Status Query (Resource)
Check service status:
```
Please check langflow://status resource
```
### 3. Query Template (Prompt)
Use predefined templates:
```
Using langflow_query_template prompt, I want to query "your question"
```
## Troubleshooting
### Common Issues
1. **Python Version Error**
- Ensure you are using Python >= 3.10
- Check the version with `python --version`
2. **Dependency Issues**
- Ensure all dependencies are correctly installed
- Use `--with` parameter to install necessary dependencies
3. **Connection Issues**
- Confirm that the Langflow service is running
- Check the URL settings in `.env`
4. **Claude Desktop Integration Issues**
- Ensure all dependencies are specified during installation
- Check the error logs of Claude Desktop
### Logs and Debugging
- Run CLI commands with the `--verbose` parameter for detailed logs
- Check the error logs of Claude Desktop
- Use MCP Inspector for debugging
## Project Structure
```
langflow-mcp-tool/
├── langflow_mcp_tool/ # Main code directory
│ ├── __init__.py # Package initialization file
│ ├── cli.py # CLI tool implementation
│ └── server.py # MCP server implementation
├── .env # Environment variable configuration
├── .gitignore # Git ignore file
├── pyproject.toml # Project configuration and dependency management
├── README.md # Project documentation
├── requirements.txt # List of dependency packages
└── uv.lock # uv package manager lock file
```
### Main File Descriptions
- `langflow_mcp_tool/server.py`: Implements the core functionality of the MCP server, including query handling and status checking
- `langflow_mcp_tool/cli.py`: Provides a command-line interface for starting the server and installing tools
- `pyproject.toml`: Defines project metadata, dependencies, and build settings
- `.env`: Contains environment variable configurations, such as API URL and keys
- `requirements.txt`: Lists the Python package dependencies for the project
## Development Guide
### Local Development
1. Clone the repository
2. Create a virtual environment
3. Install development dependencies:
```bash
uv pip install -e ".[dev]"
```
4. Run tests:
```bash
pytest
```
### Code Style
- Use Black for code formatting
- Follow PEP 8 guidelines
- Add appropriate type hints
## License
MIT
## Support Resources
- [MCP Documentation](https://github.com/modelcontextprotocol/python-sdk)
- [Langflow Documentation](https://docs.langflow.org)
- [Issue Tracker](https://github.com/your-repo/issues)
---
If you have any questions or suggestions, please feel free to raise an issue or contact the development team.
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers