FlowiseAI/Flowise · error · Error

MCP Server is required

Error message

MCP Server is required

What it means

Thrown by CustomMcpServerTool.getTools when nodeData.inputs.mcpServerId is falsy. Unlike CustomMCP (inline config), this node references a managed server record by ID from the CustomMcpServer DB table. The serverId is set when a user picks a configured server in the node dropdown; an empty value means no server was selected.

Source

Thrown at packages/components/nodes/tools/MCP/CustomMcpServerTool/CustomMcpServerTool.ts:121

        const tools = await this.getTools(nodeData, options)

        const _mcpActions = nodeData.inputs?.mcpActions
        let mcpActions: string[] = []
        if (_mcpActions) {
            try {
                mcpActions = typeof _mcpActions === 'string' ? JSON.parse(_mcpActions) : _mcpActions
            } catch (error) {
                console.error('Error parsing mcp actions:', error)
            }
        }

        return tools.filter((tool: any) => mcpActions.includes(tool.name))
    }

    async getTools(nodeData: INodeData, options: ICommonObject): Promise<Tool[]> {
        const serverId = nodeData.inputs?.mcpServerId as string
        if (!serverId) {
            throw new Error('MCP Server is required')
        }

        const appDataSource = options.appDataSource as DataSource
        const databaseEntities = options.databaseEntities as IDatabaseEntity
        if (!appDataSource || !databaseEntities?.['CustomMcpServer']) {
            throw new Error('Database not available')
        }

        const workspaceId =
            (options.workspaceId as string | undefined) ??
            ((options.searchOptions as ICommonObject | undefined)?.workspaceId as string | undefined)
        if (!workspaceId) {
            throw new Error('Workspace context is required to load MCP server')
        }

        const serverRecord = await appDataSource.getRepository(databaseEntities['CustomMcpServer']).findOneBy({ id: serverId, workspaceId })
        if (!serverRecord) {
            throw new Error(`MCP server ${serverId} not found`)

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Open the node and select a server from the MCP Server dropdown.
  2. If the expected server is missing, create/authorize it first on the Tools page (see error 399).
  3. If wiring mcpServerId from a variable, ensure it resolves to a non-empty UUID.
  4. After deleting a server, update or remove any node that referenced it.

Example fix

// before
nodeData.inputs = { mcpServerId: '' }
// after
nodeData.inputs = { mcpServerId: '<server-uuid-from-tools-page>' }
Defensive patterns

Strategy: validation

Validate before calling

function assertServerId(id: unknown): asserts id is string {
  if (typeof id !== 'string' || !id.trim()) throw new Error('Select a managed MCP server on the node (mcpServerId is empty)')
}

Type guard

function isServerId(v: unknown): v is string {
  return typeof v === 'string' && v.trim().length > 0
}

Prevention

When it happens

Trigger: The MCP Server dropdown on the node has no selection; the serverId input is cleared; the flow references a serverId from a variable that resolves empty; the node was duplicated without re-selecting a server.

Common situations: First-time node configuration before selecting a server; a deleted server leaving the node pointing at nothing; programmatic flow building without setting mcpServerId.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/8efbe4dea7fe233c. Report an issue: GitHub.