FlowiseAI/Flowise · error · Error

MCP Server Config is required

Error message

MCP Server Config is required

What it means

Thrown by CustomMCP.getTools when nodeData.inputs.mcpServerConfig is falsy. The Custom MCP node takes an inline JSON server config (command/args/env for stdio, or url/headers for SSE) typed as a string in the node input. Without it there is nothing to substitute variables into or pass to MCPToolkit, so getTools aborts immediately.

Source

Thrown at packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts:135

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

        const _mcpActions = nodeData.inputs?.mcpActions
        let mcpActions = []
        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 mcpServerConfig = nodeData.inputs?.mcpServerConfig as string
        if (!mcpServerConfig) {
            throw new Error('MCP Server Config is required')
        }

        let sandbox: ICommonObject = {}
        const workspaceId = options?.searchOptions?.workspaceId?._value || options?.workspaceId

        if (mcpServerConfig.includes('$vars')) {
            const appDataSource = options.appDataSource as DataSource
            const databaseEntities = options.databaseEntities as IDatabaseEntity
            // If options.workspaceId is not set, create a new options object with the workspaceId for getVars.
            const optionsWithWorkspaceId = options.workspaceId ? options : { ...options, workspaceId }
            const variables = await getVars(appDataSource, databaseEntities, nodeData, optionsWithWorkspaceId)
            sandbox['$vars'] = prepareSandboxVars(variables)
        }

        let canonicalConfig
        try {
            canonicalConfig = JSON.parse(mcpServerConfig)
        } catch (e) {

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Paste a valid MCP server config JSON into the MCP Server Config input (e.g. {"url":"https://...","headers":{...}} or {"command":"npx","args":[...]}).
  2. If using variables, ensure the referenced $vars entry exists in the workspace.
  3. Validate the config JSON.parse-es before running the flow.
  4. Confirm the input isn't bound to an empty upstream node output.

Example fix

// before
nodeData.inputs = { mcpServerConfig: '' }
// after
nodeData.inputs = { mcpServerConfig: JSON.stringify({ command:'npx', args:['-y','@modelcontextprotocol/server-filesystem','./'] }) }
Defensive patterns

Strategy: validation

Validate before calling

function parseMcpConfig(raw: string): object {
  if (!raw || !raw.trim()) throw new Error('mcpServerConfig input is empty')
  try { return JSON.parse(raw) } catch (e) { throw new Error(`mcpServerConfig is not valid JSON: ${(e as Error).message}`) }
}

Type guard

function isMcpServerConfigShape(v: unknown): v is { url?: string; headers?: Record<string,string>; command?: string; args?: string[]; env?: Record<string,string> } {
  return !!v && typeof v === 'object' && (('url' in v) || ('command' in v))
}

Prevention

When it happens

Trigger: The MCP Server Config input textarea is empty; the config is wired from a $var that doesn't resolve; the node was imported from a template that left the field blank. The check runs before variable substitution, so even a config consisting only of {{$vars.x}} is non-empty and passes.

Common situations: Saving a flow before pasting the server config; a flow template that expects the user to fill the config; variable reference typo ($var instead of $vars) that leaves the literal text but no real config behind it.

Related errors


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