Skip to content

Apache Flink MCP Server Wiki

Ashfaq edited this page Oct 2, 2025 · 1 revision

📖 Apache Flink MCP Server Wiki

1. Introduction

The Apache Flink MCP Server is a Model Context Protocol (MCP) implementation that lets AI assistants (e.g., Claude Desktop, Continue, etc.) communicate with Apache Flink clusters.

Instead of navigating the Flink Dashboard or REST API manually, users can simply type natural language commands, and the MCP server translates them into API requests, returning insights in a conversational format.

👉 In short:

  • Without MCP → REST API / Dashboard

  • With MCP → Natural Language → AI Assistant → MCP Server → Flink Cluster


2. Architecture

Key Components:

  1. AI Assistant – e.g., Claude or Continue Desktop (front-end for user queries).

  2. MCP Server – Middleware that exposes standardized tools (list_jobs, get_job_details, etc.).

  3. Apache Flink Cluster – Backend system running jobs, slots, and TaskManagers.

Flow:

Human → AI Assistant → MCP Server → Flink REST API → Flink Cluster → Response back to AI

Diagram (conceptual):

+-----------------+       +------------------+       +---------------------+
|   Human Query   |  -->  | AI Assistant     |  -->  | Flink MCP Server    |
+-----------------+       +------------------+       +---------------------+
                                               -->   Apache Flink Cluster

3. Installation Guide

Prerequisites

  • Apache Flink cluster (with REST API enabled)

  • Python 3.8+

  • MCP client: Claude Desktop / Continue

Setup

git clone https://github.com/Ashfaqbs/apache-flink-mcp-server.git
cd apache-flink-mcp-server
pip install -r requirements.txt

Configure Continue Desktop

Add to Flink-mcp-server.yaml:

name: Sample MCP
version: 0.0.1
schema: v1
mcpServers:
  - name: Flink MCP Server
    type: streamable-http
    url:   http://127.0.0.1:9090/mcp/

4. Available Tools

Tool Purpose Parameters
initialize_flink_connection Connect to Flink REST API flink_url (string)
get_connection_status Check if server is connected to Flink None
get_cluster_info Overview of jobs, slots, and TaskManagers None
list_jobs List running and recent jobs None
get_job_details Detailed info for a job job_id
get_job_exceptions Get job-level exceptions job_id
get_job_metrics Fetch job metrics job_id
list_taskmanagers List TaskManagers and resources None
list_jar_files List uploaded JAR files None
send_mail Send email alerts/reports to, subject, body

5. Usage Examples

✅ Cluster Monitoring

Human: What's the status of my Flink cluster?
AI: Checking cluster…
[Uses get_cluster_info]

✅ Job Debugging

Human: Why is job xyz failing?
AI: Retrieving job details and exceptions…
[Uses get_job_details + get_job_exceptions]

✅ Metrics Collection

Human: Show me metrics for job abc123
AI: Fetching metrics…
[Uses get_job_metrics]

✅ Email Alerts

Human: Send me an alert if TaskManagers run out of slots
AI: Preparing email alert…
[Uses send_mail]

6. Troubleshooting

🔴 Common Issues

  • Connection Failed: Verify FLINK_REST_URL or cluster availability.

  • Permission Errors: Check REST API authentication setup.

  • Email Errors: Ensure SMTP configuration is properly set for send_mail.

Debug Mode

export LOG_LEVEL=DEBUG
python mcp_server.py

7. Development & Contribution

  • Follow PEP 8

  • Add tests for new tools

  • Document new features in Wiki & README

Contribution Flow

git checkout -b feature-xyz
# make changes
git commit -m "Added feature xyz"
git push origin feature-xyz

Then open a Pull Request.


8. Roadmap

  • Flink SQL Gateway integration

  • Secure connections (HTTPS + auth)

  • Job submission & cancellation

  • Advanced alerting and reporting


9. FAQ

Q: Does this replace the Flink Web UI?
A: No, it enhances it with conversational AI.

Q: Can I use this in production?
A: Currently optimized for monitoring/debugging. Write operations require security hardening.

Q: Which AI assistants are supported?
A: Any MCP-compliant client (Claude Desktop, Continue, etc.).


10. Related Projects


👉 This Wiki draft is designed to be pasted directly into your GitHub project’s Wiki main page (Home).

Would you like me to split this into multiple Wiki pages (like Installation, Tools, Usage, Troubleshooting) for easier navigation, or keep it as one long main Wiki page?