How ms82119/nifimcp works
Project type and purpose
• This is a full-stack, Python-based “chat interface” application that sits between a user and one or more Apache NiFi instances.
• It comprises a browser-based UI (built with Streamlit) and a backend HTTP API server (built with FastAPI/uvicorn).
• The system integrates with:
• A Large Language Model (LLM) service (e.g., OpenAI)
• The NiFi REST API
• Custom “MCP tools” that wrap NiFi operations
File structure
• Top-level entries:
• config/ (application settings, logging setup)
• nifi_chat_ui/ (frontend Streamlit app)
• nifi_mcp_server/ (backend FastAPI server + core logic + NiFi API wrappers)
• tests/ (automated tests of NiFi operations)
• Within nifi_chat_ui/:
• app.py (Streamlit entrypoint)
• chat_manager.py (session/history management)
• mcp_handler.py (invokes backend API)
• system_prompt.md (base prompt for LLM)
• Within nifi_mcp_server/:
• server.py (FastAPI entrypoint)
• core.py (business logic orchestrator)
• nifi_client.py (low-level HTTP calls to NiFi)
• api_tools/*.py (tool implementations for create/lookup/modify/review operations)
• flow_documenter.py, request_context.py (helper modules)
README for additional insights
• The README confirms the two-tier architecture (Streamlit client + uvicorn FastAPI server).
• It calls out the LLM integration (“some tools are exposed to the LLM at different phases”).
• It describes the primary use cases: “document NiFi flows,” “create/modify NiFi components,” and “audit/log.”
Detail and essential elements
• Logging/config layers and how request context flows through for traceability.