MCP server for Apache Flink SQL Gateway
Project description
flink-mcp — Flink MCP Server
This project provides an MCP server that connects to Apache Flink SQL Gateway.
Prerequisites
-
A running Apache Flink cluster and SQL Gateway
- Start cluster:
./bin/start-cluster.sh - Start gateway:
./bin/sql-gateway.sh start -Dsql-gateway.endpoint.rest.address=localhost - Verify:
curl http://localhost:8083/v3/info
- Start cluster:
-
Configure environment:
- Set
SQL_GATEWAY_API_BASE_URL(defaulthttp://localhost:8083). You can use a.envfile at repo root.
- Set
Run
Install and run via the console script:
pip install -e .
flink-mcp
MCP clients should launch the server over stdio with command: flink-mcp.
Ensure SQL_GATEWAY_API_BASE_URL is set in your environment or .env.
Tools (v0.2.1)
flink_info(resource): returns cluster info from/v3/info.open_new_session(properties?: dict)->{ sessionHandle, ... }.get_config(sessionHandle: str): returns session configuration.configure_session(sessionHandle: str, statement: str): apply session-scoped DDL/config (CREATE/USE/SET/RESET/LOAD/UNLOAD/ADD JAR).run_query_collect_and_stop(sessionHandle: str, query: str, max_rows: int=5, max_seconds: float=15.0): execute, fetch up to N rows within T seconds, then STOP the job if ajobIDis present; closes the operation.run_query_stream_start(sessionHandle: str, query: str): execute a streaming query and return{ jobID, operationHandle }; the job is left running.fetch_result_page(sessionHandle: str, operationHandle: str, token: int): fetch a single page; returns{ page, nextToken, isEnd }.cancel_job(sessionHandle: str, jobId: str): issueSTOP JOB '<jobId>', wait until DESCRIBE JOB status is not RUNNING; returns{ jobID, status, jobGone, jobStatus }.
Notes
-
Tools are stateless; clients manage and pass session/operation handles explicitly.
-
run_query_stream_startreturns bothjobIDandoperationHandle; usefetch_result_pageto stream results. -
cancel_jobissues STOP and waits using DESCRIBE JOB;close_operationis invoked internally where appropriate. -
Endpoints target SQL Gateway v3-style paths.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flink_mcp-0.2.1.tar.gz.
File metadata
- Download URL: flink_mcp-0.2.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646460b29e1959ee46081d6672d943b37cb3f2194f5011cdea7e12c12c344287
|
|
| MD5 |
4b5f5802f94716f18bfd4f81942b29fc
|
|
| BLAKE2b-256 |
02c5b551a6430bf703ebc3ebc82438e0ab7e219ff51b35ecfab1a72dd1a9f02e
|
File details
Details for the file flink_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: flink_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a11cb1259ec46010665721ad4358d80fb404ec56f750495c3ad24e5d0aa61219
|
|
| MD5 |
bbd02ed777059604032dd9c5d1b6e196
|
|
| BLAKE2b-256 |
9570b4ca8251c5c70752e42d8ca0e55c024421938fb9d3734468b16536c616eb
|