Langflow Document QA MCP server

Connects Claude Desktop to a Langflow-powered document question-answering system through a query_docs tool that processes document-based questions using a Mistral model.
Back to servers
Setup instructions
Provider
gongrzhe
Release date
Feb 24, 2025
Language
TypeScript
Stats
13 stars

The Langflow Document Q&A Server is a Model Context Protocol server that enables document question-answering capabilities by connecting Claude AI to a Langflow backend. It provides a simple interface for querying documents through Langflow's document processing pipeline.

Prerequisites

Setting Up Langflow Document Q&A Flow

  1. Open Langflow and create a new flow from the "Document Q&A" template
  2. Configure your flow with necessary components (ChatInput, File Upload, LLM, etc.)
  3. Save your flow

Getting the Flow API Endpoint

  1. Click the "API" button in the top right corner of Langflow
  2. Copy the API endpoint URL from the cURL command Example: http://127.0.0.1:7860/api/v1/run/<flow-id>?stream=false
  3. Save this URL as it will be needed for the API_ENDPOINT configuration

Installation

Manual Installation for Claude Desktop

To use with Claude Desktop, add the server configuration:

On MacOS:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows:

notepad %APPDATA%/Claude/claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "langflow-doc-qa-server": {
      "command": "node",
      "args": [
        "/path/to/doc-qa-server/build/index.js"
      ],
      "env": {
        "API_ENDPOINT": "http://127.0.0.1:7860/api/v1/run/YOUR_FLOW_ID"
      }
    }
  }
}

Make sure to replace /path/to/doc-qa-server/build/index.js with your actual server path and YOUR_FLOW_ID with your specific flow ID.

Installation via Smithery

For automatic installation using Smithery:

npx -y @smithery/cli install @GongRzhe/Langflow-DOC-QA-SERVER --client claude

Configuration

Environment Variables

The server supports the following configuration options:

  • API_ENDPOINT: The endpoint URL for the Langflow API service
    • Default: http://127.0.0.1:7860/api/v1/run/480ec7b3-29d2-4caa-b03b-e74118f35fac

Usage

Once installed, you can access the Document Q&A capabilities within Claude Desktop. The server provides a tool called query_docs that allows you to:

  1. Upload documents to your Langflow system
  2. Ask questions about the uploaded documents
  3. Receive responses based on the document content

Basic Operation

  1. Start Claude Desktop with the MCP server configuration
  2. Upload your documents through the Langflow interface
  3. In Claude Desktop, ask questions about your documents
  4. The server will process your queries and return relevant information from the documents

Troubleshooting

If you encounter issues with the server connection:

  1. Check that your Langflow instance is running
  2. Verify the API endpoint URL is correct
  3. Ensure the server path in your configuration is accurate

For more detailed debugging, you can use the MCP Inspector:

npm run inspector

This will provide a URL to access debugging tools in your browser.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "langflow-doc-qa-server" '{"command":"node","args":["/path/to/doc-qa-server/build/index.js"],"env":{"API_ENDPOINT":"http://127.0.0.1:7860/api/v1/run/480ec7b3-29d2-4caa-b03b-e74118f35fac"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "langflow-doc-qa-server": {
            "command": "node",
            "args": [
                "/path/to/doc-qa-server/build/index.js"
            ],
            "env": {
                "API_ENDPOINT": "http://127.0.0.1:7860/api/v1/run/480ec7b3-29d2-4caa-b03b-e74118f35fac"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "langflow-doc-qa-server": {
            "command": "node",
            "args": [
                "/path/to/doc-qa-server/build/index.js"
            ],
            "env": {
                "API_ENDPOINT": "http://127.0.0.1:7860/api/v1/run/480ec7b3-29d2-4caa-b03b-e74118f35fac"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later