Vincenzo Lombardo created NIFI-16524:
----------------------------------------
Summary: Add InvokeMcpServer Processor and MCP Client Service
Key: NIFI-16524
URL: https://issues.apache.org/jira/browse/NIFI-16524
Project: Apache NiFi
Issue Type: New Feature
Reporter: Vincenzo Lombardo
Add an extension that lets NiFi act as a client of Model Context Protocol (MCP)
servers, the open protocol many tools and data sources now use to expose
capabilities to LLM-based applications.
h3. Components
* {{McpClientService}} (API) + {{StandardMcpClientService}}: a Controller
Service that manages a session with a remote MCP server over Streamable HTTP or
SSE, with optional {{SSLContextProvider}} (TLS/mTLS) and sensitive custom
headers for authentication. The session is shared by all referencing
processors, connects lazily if the server is down at enable time, and
reconnects after transport failures. Supports configuration verification
(connect, initialize, list tools).
* {{InvokeMcpServer}}: a processor that performs Call Tool, Read Resource, Get
Prompt and List Tools/Resources/Prompts.
** Arguments come from a property (with Expression Language) or from the
FlowFile content.
** Output Content: full result (JSON), text only, or the tool's
{{structuredContent}} (JSON), ready for record processors.
** Relationships: {{success}}, {{tool error}} (the tool answered {{isError:
true}}), {{original}}, {{failure}} (no result: unreachable server, timeout,
JSON-RPC error, invalid arguments).
** Works as a source when there is no incominling a tool on a schedule.
h3. Motivation
A growing number of SaaS and internal systems conveniently) through MCP
servers. Today these are mostly consumed by LLM agents, which means paying
tokens, and accepting non-deterministic behavior, even for repetitive
work that is really just plain ETLdule, fetching the same resource every day,
ormoving its output into a database or index. With an MCP client in NiFi, those
calls become deterministic flow steps, with no tokens spent and with NiFi's
usual re and record tooling. An LLM is then needed only where real reasoning is
required, and it can be fed small, pre-processed data instead of raw tool
output.
h3. Dependencies
The official MCP Java SDK ({{io.modelcontextprotocol.sdk:mcp}}, MIT licensed),
which brings in Reactor Core, Jackson 3 and networknt json-schema-validator
(all Apacady managed by NiFi's BOM. Everything isbundled in its own NAR, kept
out of the default assembly behind an optional {{include-mcp}} profile.
h3. Scope
HTTP-based transports only. A STDIO transport (launching a local MCP server
process) is left to a follow-up because of
its security implications; it would be a {{@Rcomponent.
New bundle: {{nifi-extension-bundles/nifi-mcpice-api}},
{{nifi-mcp-service-api-nar}},{{nifi-mcp-processors}}, {{nifi-mcp-nar}}). Unit
tests run against an in-process MCP server, so no network is needed.
Discussion thread on dev@:
https://lists.apache.org/thread.html/thhn4cqypblknwv2g33lz1rx0cqbrdmw
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)