Skip to main content
Glama
nifi-mcp

nifi-mcp

nifi-mcp

Design and debug Apache NiFi 2.x flows through MCP, with each HTTP caller's NiFi permissions. Use examples/stdio/ for personal credentials or QUICKSTART.md for Keycloak HTTP.

Requirements

Python 3.12+, the dependencies pinned in uv.lock, and Apache NiFi 2.x. VS Code's MCP-capable chat host handles OAuth independently of your chosen local model.

Related MCP server: Dataiku MCP Server

Config

The full configuration is in src/nifi_mcp/config.py; .env.example is the Keycloak configuration. Exported NIFI_* variables override .env.

Req

Name

Default

Purpose

Required

NIFI_API_URL

—

NiFi origin or /nifi-api URL

Required

NIFI_AUTH

bearer

Personal stdio credentials or passthrough for HTTP

When HTTP

NIFI_TRANSPORT

stdio

Set streamable-http for VS Code OAuth

When Keycloak

NIFI_OAUTH_IDENTITY_CLAIM

—

Match NiFi's OIDC identifying claim

When Keycloak

NIFI_OAUTH_GROUPS_CLAIM

groups

Match NiFi's OIDC groups claim

When multi-cluster

NIFI_CLUSTER_NAME

default

Name the primary NiFi cluster

When multi-cluster

NIFI_CLUSTERS

—

JSON map of additional NiFi clusters

Optional

NIFI_READONLY

false

Block writes in addition to NiFi's policies

Minimum configuration

For Keycloak HTTP, copy .env.example to .env and supply your internal endpoints, CA bundle, Keycloak introspection client secret, and dedicated NiFi proxy certificate/key. Keep .env and the key readable only by the service account. The confidential client secret belongs on the server; VS Code uses a public PKCE client and stores its own login state.

Usage

./start-server.sh

For a checked-out flow bucket, copy examples/keycloak-vscode/mcp.json into that checkout's .vscode/mcp.json and change the URL and public client ID. Start the NiFi server from VS Code's MCP commands and sign in to your internal Keycloak in the browser.

Preconditions

  • For HTTP, your internal Keycloak exposes OIDC discovery and introspection over trusted HTTPS.

  • For HTTP, its access tokens contain the MCP audience, the same identity, and the same groups as NiFi login.

  • For HTTP, NiFi trusts the dedicated proxy certificate and permits its identity to proxy user requests.

  • NiFi already has the applicable user/group policies; MCP grants no NiFi policies.

  • For HTTP, a TLS reverse proxy serves the MCP URL and passes the Authorization header to port 8000.

  • You install the locked Python dependencies and the VS Code chat/model extensions before isolation.

Behaviour

NIFI_READONLY defaults false. NiFi checks each user's policy for every REST operation. HTTP accepts only NIFI_AUTH=passthrough; it never uses configured password/admin credentials. Keycloak tokens are introspected on every HTTP request, with issuer, audience, expiration and safe identity/group claims checked. Verified identity and groups reach NiFi through mTLS proxy headers. Calls use separate client/cookie state and the HTTP transport is stateless.

For stdio, set NIFI_AUTH=bearer, NIFI_TRANSPORT=stdio, and your own NIFI_BEARER_TOKEN. For a single-user/admin or LDAP login, use NIFI_AUTH=jwt with NIFI_USERNAME and NIFI_PASSWORD. For certificate authentication, use NIFI_AUTH=mtls with NIFI_CLIENT_CERT and NIFI_CLIENT_KEY. NIFI_CA_BUNDLE establishes server trust for every mode; it does not supply a user identity. NIFI_CLIENT_KEY_PASSWORD supports encrypted PEM keys. NiFi authorizes the certificate identity. The legacy oidc password mode remains explicit and stdio-only. On the tested NiFi 2.11 backend, its API identity is the IdP token's sub; browser OIDC can use a different identifying claim. Give that API principal the intended policies, including /flow read where needed, or align the browser identifying claim. Token groups propagate, but username-only policies do not cover sub. No Keycloak or OAuth login is required for bearer, jwt or mtls stdio. An explicitly configured admin account retains admin permissions in that local instance. Remote HTTP requires per-user Keycloak. The launcher reads no Vault credentials and installs/downloads nothing at startup.

Call nifi_current_user to check identity, then nifi_about, nifi_get_flow, and the build/debug tools. Flow specs resolve @ServiceName to services created in the same spec. Tool arguments are strict. Mutation results carry outcome: applied, not_applied, or unknown; read back before retrying an unknown create. NiFi 403 remains a permission denial. Caller credentials never refresh into a server account. Multi-step tools can apply permitted changes before a later operation is denied.

Name params.cluster on every call when several clusters are configured. Changes on a protected cluster also require matching params.confirm_cluster. Cluster credentials and caller policies remain isolated.

Related stages lay out top-down; parent navigation canvases can pack unrelated child-group clusters. Lifecycle preflight reports blockers before writes. Inspect returned validation issues after changes. nifi_list_queue samples queued FlowFiles, optionally with attributes; it never consumes them. New parameters use root.service.key names in the context named root. Compose several root contexts with inherited_context_ids; existing names are not migrated automatically.

Out of scope

  • Provisioning your Keycloak realm, NiFi policies, TLS proxy, or certificate authority.

  • Configuring the local model/chat extension or assuming every VS Code extension shares MCP auth.

  • Modifying a versioned flow without its registry workflow; prototype in an unversioned group.

Expected result

VS Code shows NiFi tools and nifi_current_user returns your own NiFi identity. Compare permitted reads and denied writes using an actual directory-backed non-admin account. Check server metadata through your trusted TLS endpoint:

curl --fail https://nifi-mcp.example.internal/.well-known/oauth-protected-resource/mcp

Real-service integration command and its coverage: tests/integration/README.md.

Available Tools

35 tools
nifi_aboutA
Read-onlyIdempotent

NiFi version, build, and whether this is 2.x. Call first on a new session.

Inputs: no named parameters. Returns: result

nifi_apply_flow_specA

Create a complete flow from a declarative spec: process group, services, processors, ports, connections.

Property values starting with @ (processor or controller_service properties) are resolved to a controller service created earlier in the same spec. Services are enabled in spec order. JSON booleans and numbers become NiFi text (true -> "true", 10 -> "10"); null unsets a property. auto_terminated and relationships take a list or a single name. Connections refer to components by name. Prefer this over many create_* calls.

Every result, ok or error, has outcome (applied, not_applied or unknown: the failing request's) and lists created[] (kind, id, ref, outcome; services carry their state). ref is the item's place in the spec (process_group, objects[2], connections[0]). An ok result adds each item's name and name_map; an error names items by ref only, and never repeats a value from the spec. An error, or a build whose flow view could not be read, adds a hint saying how to roll back or inspect exactly what this call created. cause "spec" means the spec was refused before NiFi was asked (a missing name or type, an unknown connection end or @service, or an unknown key at the top level or in process_group): nothing was created. Top-level keys: process_group, objects, connections, parent_process_group_id, layout. process_group keys: name, comments, parameter_context_id, inherit_parameter_context, x, y, position. A request with no definite answer (a timeout, a 5xx, a lost connection) is in created[] with outcome "unknown": NiFi may have applied it, and the hint says what the server's read-back found. Check again before retrying. Only created[] items with an id are ever named for deletion.

Inputs: params (required). Returns: result

nifi_bind_parameter_contextA
Idempotent

Bind a parameter context to a process group so #{name} references resolve. null unbinds.

NiFi does not inherit contexts, so by default this is the UI's "Apply recursively": one request with processGroupUpdateStrategy=ALL_DESCENDANTS binds the group and every descendant, replacing any context a descendant had. NiFi checks every group before changing any, so an error means no group was rebound. apply_recursively=false binds only this group.

Inputs: params (required). Returns: result

nifi_create_connectionA

Connect a source to a destination. Processor sources need relationships; port sources take none.

Wiring child groups: connect an OUTPUT_PORT (source_group_id = its group) to an INPUT_PORT (destination_group_id = its group) with parent_id = the group that contains both children.

Inputs: params (required). Returns: result

nifi_create_controller_serviceC

Create a controller service in a process group and optionally enable it.

Inputs: params (required). Returns: result

nifi_create_parameter_contextB

Create a parameter context with parameters. Bind it to a group with nifi_bind_parameter_context.

Inputs: params (required). Returns: result

nifi_create_process_groupA

Create an empty process group. Build every new flow inside one of these, not on root.

Omit x/y to take the next free 424x288 cell below the other groups. An x/y that would overlap another card is shifted down clear of it, and the result says so in warnings.

Inputs: params (required). Returns: result

nifi_create_processorA

Add a processor to a process group. Prefer nifi_apply_flow_spec for a whole graph.

Omit x/y to take the first free 512x240 cell that clears every card already in the group. An x/y that would overlap another card is shifted down clear of it, and the result says so.

Inputs: params (required). Returns: result

nifi_current_userA
Read-onlyIdempotent

Who the configured credentials authenticate as, plus anonymous/permissions flags.

Inputs: no named parameters. Returns: result

nifi_delete_componentA
DestructiveIdempotent

Delete a stopped processor, empty connection, disabled service, stopped input or output port with no connections, empty process group, or parameter context.

A parameter context can only be deleted once no process group is bound to it. The result confirms the id, kind and the revision NiFi deleted; it does not repeat the deleted entity.

Inputs: params (required). Returns: result

nifi_empty_queueA
DestructiveIdempotent

Drop every FlowFile on a connection. Data loss. Required before deleting a non-empty connection.

Inputs: params (required). Returns: result

nifi_export_flowB
Read-onlyIdempotent

Download a process group as a versioned flow snapshot (same JSON the UI exports).

A property, run schedule or network interface NiFi reports invalid in the live group is masked in the component it is invalid on, as on every other read.

Inputs: params (required). Returns: result

nifi_get_bulletinsA
Read-onlyIdempotent

Recent NiFi bulletins (errors/warnings). Use after a flow misbehaves.

after_id is a bulletin id cursor, not a time: pass the largest id from the last call for newer ones.

Inputs: params (required). Returns: result

nifi_get_controller_serviceA
Read-onlyIdempotent

One controller service: state, validation errors and properties (secrets redacted).

Inputs: params (required). Returns: result

nifi_get_flowC
Read-onlyIdempotent

Compact outline of a process group: child groups, processors, connections, ports.

Inputs: params (required). Returns: result

nifi_get_healthC
Read-onlyIdempotent

Running/stopped/invalid counts, queued connections, and processors with validation errors.

Inputs: params (required). Returns: result

nifi_get_parameter_contextA
Read-onlyIdempotent

One parameter context: parameters (sensitive values redacted) and bound process groups.

Inputs: params (required). Returns: result

nifi_get_processorC
Read-onlyIdempotent

One processor: state, validation errors, properties (secrets redacted).

Inputs: params (required). Returns: result

nifi_get_processor_definitionC
Read-onlyIdempotent

Property descriptors, relationships, and supported scheduling for one processor type.

Inputs: params (required). Returns: result

nifi_import_flowC

Import a versioned flow snapshot as a new child process group.

Omit x/y to take the next free process group cell; an x/y on another card is shifted clear of it.

Inputs: params (required). Returns: result

nifi_layout_process_groupC
Idempotent

Lay processors out top-down, forks sideways, and stack child process groups top-down.

Processors: 240px rows (tallest card + label + 32px). At a fork the main branch continues down and the others sit on the fork's row, 672px out; a fork of leaves spreads one row down, 512px apart. Joins return to the fork's axis; every card is centred on its axis by its own width. A self-loop sits outside its card's side with its label on the outer stretch. The second of two connections between one pair, a retry line back up, and any line or label that would cross a card or another label are routed: out of the source's side (else its top or bottom), along a free lane between card columns, into the target's side (else its top or bottom), never along another line. Child process groups: 288px rows, 424px columns, one per row in flow order, upstream above downstream.

Inputs: params (required). Returns: result

nifi_list_controller_servicesB
Read-onlyIdempotent

Controller services visible to a process group (includes inherited).

Inputs: params (required). Returns: result

nifi_list_controller_service_typesB
Read-onlyIdempotent

List installed controller-service types. Filter by class-name substring.

Inputs: params (required). Returns: result

nifi_list_parameter_contextsA
Read-onlyIdempotent

List parameter contexts. Sensitive parameter values are redacted.

Inputs: no named parameters. Returns: result

nifi_list_processor_typesA
Read-onlyIdempotent

List installed processor types. Filter by class-name substring, then call nifi_get_processor_definition.

Inputs: params (required). Returns: result

nifi_list_queueB
Read-onlyIdempotent

Sample FlowFiles sitting on a connection. Connection must not be empty-delete-blocked.

Inputs: params (required). Returns: result

nifi_replace_flowA
Destructive

Overwrite an existing process group with a flow snapshot. Destructive. Prefer a sandbox PG.

Inputs: params (required). Returns: result

nifi_schedule_process_groupB
Idempotent

Bulk RUNNING or STOPPED for every authorized processor in a process group.

Inputs: params (required). Returns: result

nifi_set_controller_service_stateA
Idempotent

Enable or disable a controller service. Referencing processors must be stopped to disable.

Inputs: params (required). Returns: result

nifi_set_run_statusB
Idempotent

Set one processor to RUNNING, STOPPED, DISABLED, or RUN_ONCE.

Inputs: params (required). Returns: result

nifi_update_connectionA
Idempotent

Change a connection's name, queue backpressure or FlowFile expiration. Sends only the fields you set.

Works on a running flow: NiFi only checks component state when a connection's destination changes.

Inputs: params (required). Returns: result

nifi_update_controller_serviceA
Idempotent

Change a controller service's properties or name in place. Sends only the fields you set.

NiFi only updates a DISABLED service: disable it with nifi_set_controller_service_state (stop referencing processors first), update, then enable it again. Processor references stay valid.

Inputs: params (required). Returns: result

nifi_update_parameter_contextA
Idempotent

Add, change, or remove parameters. NiFi restarts referencing components itself.

A name cannot be in both parameters and remove. To change whether an existing parameter is sensitive, remove it in one call and add it back with the new flag and value in the next.

Inputs: params (required). Returns: result

nifi_update_processorA
Idempotent

Change processor properties, name, schedule or position. Sends only the fields you set.

Property, name and schedule changes need the processor STOPPED; a position-only move does not. A move that would overlap another card is shifted down clear of it, and the result says so.

Inputs: params (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 35 tools

    Disambiguation4/5

    Most tools have distinct resource/action pairs, and descriptions clarify overlaps such as apply_flow_spec versus granular create_* calls. However, create/import/replace/apply_flow_spec and schedule_process_group versus set_run_status could still create confusion in edge cases.

    Naming Consistency4/5

    All tools share the nifi_ prefix and snake_case, and the vast majority follow a verb_noun pattern. Minor deviations like nifi_about and nifi_current_user keep it from being perfectly uniform, but the convention is highly predictable.

    Tool Count2/5

    35 tools is heavy for this surface, with many granular list/get/create/update tools that could be consolidated through apply_flow_spec or grouped by resource. While NiFi is genuinely complex, the count exceeds a comfortable selection range for an agent.

    Completeness4/5

    The surface covers most core flow lifecycle operations: process groups, processors, connections, controller services, parameter contexts, health, queues, and import/export/apply. Notable gaps remain around dedicated create/update port tools (though apply_flow_spec can create ports) and user/group policy management.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Dataiku DSS REST APIs, enabling flow analysis and day-to-day operations on projects, datasets, recipes, jobs, scenarios, folders, variables, connections, and code environments.
      9
      45 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients such as Claude Desktop, Claude Code, and Cursor to discover node types, author and validate typed multi-agent workflow files, launch runs against a workspace, and retrieve run status, node outputs, and workspace change details.
      MIT