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):
- Click on the Project that will serve as an MCP server
- Click on the "MCP Server" tab
- Enable API Key authentication:
- Click on "Edit Auth"
- Select "Auth Type" as "API Key"
- Click on Save
- Fetch MCP Server configuration:
- Click on the "JSON"
- Click on "Generate API key". FYI,
- This will create a new API key (This API key will only be visible once after you generate it)
- An entry for this API key will be added in "Langflow API Keys" under Settings
- 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
- Open MCP Server Settings
- Navigate to LangFlow Settings → MCP Servers
- Select Your MCP Server
- Locate the default project-specific MCP Server (e.g., "lf-project1")
- Edit Server Configuration
- Click the three dots (...) on the right side of the server entry
- Click on Edit
- Add API Key Arguments
- In the configuration dialog, only the STDIO option is available
- In the Arguments section, click the plus (+) button to add each argument separately
- Add the following arguments in this exact order.
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- Replace the following placeholders:
<Your_API_Key_Header_Name>: Your API key header name (typicallyx-api-key<Your_API_Key_Value>: Your actual API key value<Your_Project_ID>: Your LangFlow project ID
- Important:
- The URL must end with
/streamable(NOT/sse) - Leave the Environment Variables section empty
- Each line above should be added as a separate argument
- The URL must end with
- Replace the following placeholders:
- Save Configuration
- Click "Update Server" to apply the changes
- Verify the Fix
- Return to your flow
- The Tool dropdown should now display available tools instead of "Error on MCP Server"
- 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
- Instead of using the default project-specific MCP server, manually add a new MCP server
- Settings -> MCP Servers -> Add MCP Server
- Either choose from OPTION 1 or OPTION 2 as below:
- OPTION 1:
- Select "Streamable HTTP/SSE"
- Enter details based on MCP server's JSON configuration noted earlier
- Keep the MCP server name different than the default
- OPTION 2:
- Select JSON tab
- Paste the MCP server's JSON configuration here
- Modify the project name and keep it different from the default
- OPTION 1:
- Click on "Add Server"
- 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)
- Set the project's Auth Type to None
- Select your Project -> MCP Server -> Edit Auth -> Auth type -> None
- This removes the API key requirement
- Warning: Only suitable for development/testing environments
Related Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
06 April 2026
UID
ibm17268544