IBM Support

"Error on MCP Server" for Tool when using default project-specific MCP Servers in LangFlow

Troubleshooting


Problem

When adding a default project-specific MCP server to a flow in LangFlow, the Tool section displays "Error on MCP Server" instead of showing the available tools. This prevents users from accessing and using MCP server tools within their flows.

Affected Versions

  • Langflow 1.8.x and earlier

Symptom

When the default project-specific MCP server (e.g., "lf-project1") is selected in the flow:

  • The Tool dropdown shows "Error on MCP Server" (marked with a red asterisk *)
  • No tools are visible or selectable
  • LangFlow logs show 401 Unauthorized errors with the message: "API key required for this project."

Error Log Example

[ERROR] Client error during session scope: 401: API key required for this project. Provide x-api-key header or query parameter.
[ERROR] httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://localhost:7860/api/v1/mcp/project/<Project_ID>/streamable'
[ERROR] Error updating tool list: unhandled errors in a TaskGroup (1 sub-exception)

 

Cause

The default project-specific MCP servers require API key authentication when the project has authentication enabled. Without the API key configured in the MCP server settings, the connection fails with a 401 Unauthorized error, causing the "Error on MCP Server" message to appear in the UI.

 

Resolving The Problem

Solution: Configure API Key for the Default MCP Server

Fetch the MCP server configuration (JSON):

  1. Click on the Project that will serve as an MCP server
  2. Click on the "MCP Server" tab
  3. Enable API Key authentication:
    1. Click on "Edit Auth"
    2. Select "Auth Type" as "API Key"
    3. Click on Save
  4. Fetch MCP Server configuration:
    1. Click on the "JSON"
    2. Click on "Generate API key". FYI,
      1. This will create a new API key (This API key will only be visible once after you generate it)
      2. An entry for this API key will be added in "Langflow API Keys" under Settings
    3. Note the JSON configuration, as it will be required later.

 

Follow the steps below to add API key authentication to your default project-specific MCP server:

Step-by-Step Instructions

  1. Open MCP Server Settings
    1. Navigate to LangFlow Settings → MCP Servers
  2. Select Your MCP Server
    1. Locate the default project-specific MCP Server (e.g., "lf-project1")
  3. Edit Server Configuration
    1. Click the three dots (...) on the right side of the server entry
    2. Click on Edit
  4. Add API Key Arguments
    1. In the configuration dialog, only the STDIO option is available
    2. In the Arguments section, click the plus (+) button to add each argument separately
    3. Add the following arguments in this exact order. 
    4. 	mcp-proxy
      	--transport
      	streamablehttp
      	--headers
      	<Your_API_Key_Header_Name>
      	<Your_API_Key_Value>
      	http://localhost:7860/api/v1/mcp/project/<Your_Project_ID>/streamable
      1. Replace the following placeholders:
        1. <Your_API_Key_Header_Name>: Your API key header name (typically x-api-key
        2. <Your_API_Key_Value>: Your actual API key value
        3. <Your_Project_ID>: Your LangFlow project ID
      2. Important:
        1. The URL must end with /streamable (NOT /sse)
        2. Leave the Environment Variables section empty
        3. Each line above should be added as a separate argument
  5. Save Configuration
  6. Click "Update Server" to apply the changes
  7. Verify the Fix
    1. Return to your flow
    2. The Tool dropdown should now display available tools instead of "Error on MCP Server"
    3. Select a tool to confirm it works correctly

Configuration Reference (JSON Format)

For reference, the equivalent JSON configuration for streamable (default) is:

{
"mcpServers": {
"lf-project1": {
"command": "uvx",
"args": [
"mcp-proxy",
"--transport",
"streamablehttp",
"--headers",
"x-api-key",
"your-api-key-value-here",
"http://localhost:7860/api/v1/mcp/project/282a0f76-cc2c-4403-bf66-4fc4b952fa73/streamable"
]
}
}
}

 

Workaround: If you cannot configure API keys or continue to experience issues:

Option 1: Use Manual MCP Server Configuration

  1. Instead of using the default project-specific MCP server, manually add a new MCP server
    1. Settings -> MCP Servers -> Add MCP Server
  2. Either choose from OPTION 1 or OPTION 2 as below:
    1. OPTION 1:
      1. Select "Streamable HTTP/SSE"
      2. Enter details based on MCP server's JSON configuration noted earlier
      3. Keep the MCP server name different than the default
    2. OPTION 2:
      1. Select JSON tab
      2. Paste the MCP server's JSON configuration here
      3. Modify the project name and keep it different from the default
  3. Click on "Add Server"
  4. Validate the number of tools visible for this MCP Server on the same screen

For reference, the equivalent JSON configuration for sse is:

{
  "mcpServers": {
    "mcp_server_for_project1": {
      "command": "uvx",
      "args": [
        "mcp-proxy",
        "--headers",
        "x-api-key",
        "your-api-key-value-here",
        "http://localhost:7860/api/v1/mcp/project/ce33d4af-7354-4ee4-9b86-1e9df467b8b2/sse"
      ]
    }
  }
}

Option 2: Disable Project Authentication (Development Only)

  1. Set the project's Auth Type to None
    1. Select your Project -> MCP Server -> Edit Auth -> Auth type -> None
  2. This removes the API key requirement
  3. Warning: Only suitable for development/testing environments

 

Related Information

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSP98FS","label":"IBM Langflow Cloud"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":""}]

Document Information

Modified date:
06 April 2026

UID

ibm17268544