-
Notifications
You must be signed in to change notification settings - Fork 1
Apache Flink MCP Server Wiki
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
Key Components:
-
AI Assistant – e.g., Claude or Continue Desktop (front-end for user queries).
-
MCP Server – Middleware that exposes standardized tools (
list_jobs,get_job_details, etc.). -
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
-
Apache Flink cluster (with REST API enabled)
-
Python 3.8+
-
MCP client: Claude Desktop / Continue
git clone https://github.com/Ashfaqbs/apache-flink-mcp-server.git
cd apache-flink-mcp-server
pip install -r requirements.txt
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/
| 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 |
Human: What's the status of my Flink cluster?
AI: Checking cluster…
[Uses get_cluster_info]
Human: Why is job xyz failing?
AI: Retrieving job details and exceptions…
[Uses get_job_details + get_job_exceptions]
Human: Show me metrics for job abc123
AI: Fetching metrics…
[Uses get_job_metrics]
Human: Send me an alert if TaskManagers run out of slots
AI: Preparing email alert…
[Uses send_mail]
-
Connection Failed: Verify
FLINK_REST_URLor cluster availability. -
Permission Errors: Check REST API authentication setup.
-
Email Errors: Ensure SMTP configuration is properly set for
send_mail.
export LOG_LEVEL=DEBUG
python mcp_server.py
-
Follow PEP 8
-
Add tests for new tools
-
Document new features in Wiki & README
git checkout -b feature-xyz
# make changes
git commit -m "Added feature xyz"
git push origin feature-xyz
Then open a Pull Request.
-
Flink SQL Gateway integration
-
Secure connections (HTTPS + auth)
-
Job submission & cancellation
-
Advanced alerting and reporting
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.).
👉 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?