flink-mcp-server 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ *.sh text eol=lf
@@ -0,0 +1,67 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ unit:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest, windows-latest]
15
+ python-version: ["3.10", "3.13"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: astral-sh/setup-uv@v5
19
+ - run: uv python install ${{ matrix.python-version }}
20
+ - run: uv sync --extra dev --python ${{ matrix.python-version }}
21
+ - run: uv run pytest -m "not integration"
22
+ - name: Run via uvx
23
+ run: uvx --from . flink-mcp-server --version
24
+
25
+ integration:
26
+ runs-on: ubuntu-latest
27
+ needs: unit
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: astral-sh/setup-uv@v5
31
+ - run: uv sync --extra dev
32
+ - run: docker compose -f tests/docker-compose.yml up -d
33
+ - name: Wait for Flink REST
34
+ run: |
35
+ for i in $(seq 1 30); do
36
+ curl -sf http://localhost:8081/overview | grep -q '"taskmanagers":1' && exit 0
37
+ sleep 2
38
+ done
39
+ docker compose -f tests/docker-compose.yml logs
40
+ exit 1
41
+ - run: uv run pytest -m integration
42
+ - if: always()
43
+ run: docker compose -f tests/docker-compose.yml down
44
+
45
+ installers:
46
+ runs-on: ${{ matrix.os }}
47
+ strategy:
48
+ fail-fast: false
49
+ matrix:
50
+ os: [ubuntu-latest, macos-latest, windows-latest]
51
+ env:
52
+ FLINK_MCP_SOURCE: ${{ github.workspace }}
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - name: install.sh (installs uv first if missing)
56
+ if: runner.os != 'Windows'
57
+ run: |
58
+ sh install.sh
59
+ "$HOME/.local/bin/flink-mcp-server" --version
60
+ sh install.sh --uninstall
61
+ - name: install.ps1 (installs uv first if missing)
62
+ if: runner.os == 'Windows'
63
+ shell: powershell
64
+ run: |
65
+ .\install.ps1
66
+ & "$env:USERPROFILE\.local\bin\flink-mcp-server.exe" --version
67
+ .\install.ps1 -Uninstall
@@ -0,0 +1,40 @@
1
+ name: Publish to PyPI
2
+
3
+ # Runs when a GitHub release is published (tag like v0.1.0). Uses PyPI Trusted Publishing,
4
+ # so no API token is stored in this repository.
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: astral-sh/setup-uv@v5
15
+ - name: Tag must match the package version
16
+ run: |
17
+ version=$(uv run python -c "import flink_mcp; print(flink_mcp.__version__)")
18
+ if [ "v$version" != "${{ github.event.release.tag_name }}" ]; then
19
+ echo "Release tag ${{ github.event.release.tag_name }} does not match package version v$version" >&2
20
+ exit 1
21
+ fi
22
+ - run: uv build
23
+ - run: uvx twine check dist/*
24
+ - uses: actions/upload-artifact@v4
25
+ with:
26
+ name: dist
27
+ path: dist/
28
+
29
+ publish:
30
+ needs: build
31
+ runs-on: ubuntu-latest
32
+ environment: pypi
33
+ permissions:
34
+ id-token: write
35
+ steps:
36
+ - uses: actions/download-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,7 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ dist/
5
+ .pytest_cache/
6
+ .swarm/
7
+ .claude-flow/
@@ -0,0 +1,2 @@
1
+ /cache
2
+ /project.local.yml
@@ -0,0 +1,133 @@
1
+ # the name by which the project can be referenced within Serena
2
+ project_name: "flinkmcp"
3
+
4
+
5
+ # list of languages for which language servers are started; choose from:
6
+ # al angular ansible bash clojure
7
+ # cpp cpp_ccls crystal csharp csharp_omnisharp
8
+ # dart elixir elm erlang fortran
9
+ # fsharp go groovy haskell haxe
10
+ # hlsl html java json julia
11
+ # kotlin lean4 lua luau markdown
12
+ # matlab msl nix ocaml pascal
13
+ # perl php php_phpactor powershell python
14
+ # python_jedi python_ty r rego ruby
15
+ # ruby_solargraph rust scala scss solidity
16
+ # svelte swift systemverilog terraform toml
17
+ # typescript typescript_vts vue yaml zig
18
+ # (This list may be outdated. For the current list, see values of Language enum here:
19
+ # https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
20
+ # For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
21
+ # Note:
22
+ # - For C, use cpp
23
+ # - For JavaScript, use typescript
24
+ # - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root)
25
+ # - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm)
26
+ # - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three)
27
+ # - For Free Pascal/Lazarus, use pascal
28
+ # Special requirements:
29
+ # Some languages require additional setup/installations.
30
+ # See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
31
+ # When using multiple languages, the first language server that supports a given file will be used for that file.
32
+ # The first language is the default language and the respective language server will be used as a fallback.
33
+ # Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
34
+ languages:
35
+ - python
36
+
37
+ # the encoding used by text files in the project
38
+ # For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
39
+ encoding: "utf-8"
40
+
41
+ # line ending convention to use when writing source files.
42
+ # Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
43
+ # This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
44
+ line_ending:
45
+
46
+ # The language backend to use for this project.
47
+ # If not set, the global setting from serena_config.yml is used.
48
+ # Valid values: LSP, JetBrains
49
+ # Note: the backend is fixed at startup. If a project with a different backend
50
+ # is activated post-init, an error will be returned.
51
+ language_backend:
52
+
53
+ # whether to use project's .gitignore files to ignore files
54
+ ignore_all_files_in_gitignore: true
55
+
56
+ # advanced configuration option allowing to configure language server-specific options.
57
+ # Maps the language key to the options.
58
+ # Have a look at the docstring of the constructors of the LS implementations within solidlsp (e.g., for C# or PHP) to see which options are available.
59
+ # No documentation on options means no options are available.
60
+ ls_specific_settings: {}
61
+
62
+ # list of additional workspace folder paths for cross-package reference support (e.g. in monorepos).
63
+ # Paths can be absolute or relative to the project root.
64
+ # Each folder is registered as an LSP workspace folder, enabling language servers to discover
65
+ # symbols and references across package boundaries.
66
+ # Currently supported for: TypeScript.
67
+ # Example:
68
+ # additional_workspace_folders:
69
+ # - ../sibling-package
70
+ # - ../shared-lib
71
+ additional_workspace_folders: []
72
+
73
+ # list of additional paths to ignore in this project.
74
+ # Same syntax as gitignore, so you can use * and **.
75
+ # Note: global ignored_paths from serena_config.yml are also applied additively.
76
+ ignored_paths: []
77
+
78
+ # whether the project is in read-only mode
79
+ # If set to true, all editing tools will be disabled and attempts to use them will result in an error
80
+ # Added on 2025-04-18
81
+ read_only: false
82
+
83
+ # list of tool names to exclude.
84
+ # This extends the existing exclusions (e.g. from the global configuration)
85
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
86
+ excluded_tools: []
87
+
88
+ # list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
89
+ # This extends the existing inclusions (e.g. from the global configuration).
90
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
91
+ included_optional_tools: []
92
+
93
+ # fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
94
+ # This cannot be combined with non-empty excluded_tools or included_optional_tools.
95
+ # Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
96
+ fixed_tools: []
97
+
98
+ # list of mode names that are to be activated by default, overriding the setting in the global configuration.
99
+ # The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
100
+ # If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply.
101
+ # Otherwise, this overrides the setting from the global configuration (serena_config.yml).
102
+ # Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply
103
+ # for this project.
104
+ # This setting can, in turn, be overridden by CLI parameters (--mode).
105
+ # See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
106
+ default_modes:
107
+
108
+ # list of mode names to be activated additionally for this project, e.g. ["query-projects"]
109
+ # The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
110
+ # See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
111
+ added_modes:
112
+
113
+ # initial prompt for the project. It will always be given to the LLM upon activating the project
114
+ # (contrary to the memories, which are loaded on demand).
115
+ initial_prompt: ""
116
+
117
+ # time budget (seconds) per tool call for the retrieval of additional symbol information
118
+ # such as docstrings or parameter information.
119
+ # This overrides the corresponding setting in the global configuration; see the documentation there.
120
+ # If null or missing, use the setting from the global configuration.
121
+ symbol_info_budget:
122
+
123
+ # list of regex patterns which, when matched, mark a memory entry as read‑only.
124
+ # Extends the list from the global configuration, merging the two lists.
125
+ read_only_memory_patterns: []
126
+
127
+ # list of regex patterns for memories to completely ignore.
128
+ # Matching memories will not appear in list_memories or activate_project output
129
+ # and cannot be accessed via read_memory or write_memory.
130
+ # To access ignored memory files, use the read_file tool on the raw file path.
131
+ # Extends the list from the global configuration, merging the two lists.
132
+ # Example: ["_archive/.*", "_episodes/.*"]
133
+ ignored_memory_patterns: []
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.5
2
+ Name: flink-mcp-server
3
+ Version: 0.1.0
4
+ Summary: Platform-independent, read-only MCP server for monitoring Apache Flink clusters via the REST API
5
+ Project-URL: Homepage, https://github.com/hakkiburakalks/flink-mcp-server
6
+ Project-URL: Source, https://github.com/hakkiburakalks/flink-mcp-server
7
+ Project-URL: Issues, https://github.com/hakkiburakalks/flink-mcp-server/issues
8
+ Author: hakkiburakalks
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: apache-flink,flink,llm,mcp,model-context-protocol,monitoring,observability
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: System :: Monitoring
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: httpx>=0.27
25
+ Requires-Dist: mcp<2,>=1.2.0
26
+ Requires-Dist: pyyaml>=6
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
29
+ Requires-Dist: pytest>=8; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # flink-mcp-server
33
+
34
+ Read-only MCP server for monitoring Apache Flink clusters. It only needs a reachable
35
+ JobManager REST endpoint, so it works the same on bare metal, Docker, Kubernetes or YARN.
36
+ Tool output is summarized for LLMs rather than returning raw REST JSON.
37
+
38
+ ## Tools (V1)
39
+
40
+ | Tool | What it returns |
41
+ | --- | --- |
42
+ | `cluster_overview` | Flink version, slots, job counts |
43
+ | `list_jobs` | Jobs with state and duration |
44
+ | `job_details` | Per-vertex status and parallelism |
45
+ | `job_exceptions` | Root exception and recent history (stacktraces trimmed) |
46
+ | `checkpoint_stats` | Counts, failure rate, last completed/failed |
47
+ | `backpressure` | Per-vertex backpressured/busy/idle ms per second |
48
+ | `taskmanagers` | Slots and resources per TaskManager |
49
+ | `job_config` | Job execution config |
50
+ | `job_metrics` | Job metric values, or the catalogue of available metric ids (filterable) |
51
+ | `list_jars` | Uploaded JARs and their entry classes |
52
+ | `cluster_config` | JobManager configuration, filterable by key |
53
+ | `list_clusters` | Configured clusters (names and URLs only) |
54
+ | `fleet_overview` | Overview of all clusters in one call; unreachable ones report an error |
55
+ | `diagnose_job` | One-call verdict (`healthy`/`degraded`/`critical`) with ranked findings from state, tasks, exceptions, checkpoints and backpressure |
56
+
57
+ All per-cluster tools take an optional `cluster` argument; omit it for the default cluster.
58
+
59
+ ## Configuration
60
+
61
+ | Variable | Default | |
62
+ | --- | --- | --- |
63
+ | `FLINK_REST_URL` | `http://localhost:8081` | JobManager REST endpoint |
64
+ | `FLINK_REST_TOKEN` | unset | Sent as `Authorization: Bearer ...` |
65
+ | `FLINK_MCP_TRANSPORT` | `stdio` | `stdio` or `streamable-http` |
66
+ | `FLINK_MCP_HOST` / `FLINK_MCP_PORT` | `127.0.0.1` / `8000` | HTTP bind address |
67
+ | `FLINK_MCP_AUTH_TOKEN` | unset | Bearer token required on every HTTP request |
68
+ | `FLINK_MCP_REQUIRE_AUTH` | `true` | `false` is the same as `--no-auth` |
69
+ | `FLINK_CLUSTERS_FILE` | unset | YAML with several clusters (overrides the two above) |
70
+
71
+ Multiple clusters: copy `clusters.example.yaml`, then set `FLINK_CLUSTERS_FILE`.
72
+ Per cluster: `url`, `token` or `token_env` (preferred, keeps secrets out of the file),
73
+ `ca_cert`, `insecure`, `timeout`.
74
+
75
+ ## Install and run
76
+
77
+ One-line installers. They install [uv](https://docs.astral.sh/uv/) first if it is missing,
78
+ then the server. They download and run a script, so read it first if you prefer
79
+ ([install.sh](https://github.com/hakkiburakalks/flink-mcp-server/blob/main/install.sh), [install.ps1](https://github.com/hakkiburakalks/flink-mcp-server/blob/main/install.ps1)).
80
+
81
+ macOS / Linux:
82
+
83
+ ```
84
+ curl -LsSf https://raw.githubusercontent.com/hakkiburakalks/flink-mcp-server/main/install.sh | sh
85
+ ```
86
+
87
+ Windows (PowerShell):
88
+
89
+ ```
90
+ irm https://raw.githubusercontent.com/hakkiburakalks/flink-mcp-server/main/install.ps1 | iex
91
+ ```
92
+
93
+ Options: register in Claude Code and point at your cluster, or remove everything.
94
+
95
+ ```
96
+ curl -LsSf .../install.sh | sh -s -- --claude-code --url http://localhost:8081
97
+ & ([scriptblock]::Create((irm .../install.ps1))) -ClaudeCode -Url http://localhost:8081
98
+ ```
99
+
100
+ Uninstall with `--uninstall` / `-Uninstall`. Set `FLINK_MCP_SOURCE` to install a specific tag or
101
+ a local checkout (e.g. `git+https://github.com/hakkiburakalks/flink-mcp-server@v0.1.0`).
102
+
103
+ Or skip installing and let uv run it on demand (Windows, macOS, Linux):
104
+
105
+ ```
106
+ uvx --from git+https://github.com/hakkiburakalks/flink-mcp-server flink-mcp-server
107
+ ```
108
+
109
+ Add it to an MCP client. Claude Code:
110
+
111
+ ```
112
+ claude mcp add flink -e FLINK_REST_URL=http://localhost:8081 -- uvx --from git+https://github.com/hakkiburakalks/flink-mcp-server flink-mcp-server
113
+ ```
114
+
115
+ Claude Desktop, Cursor and others (`mcpServers` in their JSON config):
116
+
117
+ ```json
118
+ {
119
+ "mcpServers": {
120
+ "flink": {
121
+ "command": "uvx",
122
+ "args": ["--from", "git+https://github.com/hakkiburakalks/flink-mcp-server", "flink-mcp-server"],
123
+ "env": { "FLINK_REST_URL": "http://localhost:8081" }
124
+ }
125
+ }
126
+ }
127
+ ```
128
+
129
+ From a checkout: `uv sync --extra dev && uv run flink-mcp-server`.
130
+
131
+ ## Remote access (Streamable HTTP)
132
+
133
+ ```
134
+ FLINK_MCP_AUTH_TOKEN=change-me flink-mcp-server --transport streamable-http --host 0.0.0.0 --port 8000
135
+ ```
136
+
137
+ The endpoint is `http://<host>:8000/mcp`. Clients send `Authorization: Bearer <token>`.
138
+
139
+ Authentication is on by default:
140
+
141
+ | Situation | Behaviour |
142
+ | --- | --- |
143
+ | `FLINK_MCP_AUTH_TOKEN` set | Token enforced (always, even with `--no-auth`) |
144
+ | Loopback bind, no token | Open; fine for local use |
145
+ | Non-loopback bind, no token | A random token is generated and printed to stderr at startup |
146
+ | Non-loopback bind, no token, `--no-auth` | Open, with a warning. Only do this on a trusted network |
147
+
148
+ The server speaks plain HTTP: put it behind a TLS-terminating proxy before exposing it.
149
+
150
+
151
+ ## Test
152
+
153
+ ```
154
+ uv run pytest # unit tests
155
+ docker compose -f tests/docker-compose.yml up -d
156
+ uv run pytest -m integration # needs the local cluster (Docker)
157
+ ```
158
+
159
+ ## Roadmap
160
+
161
+ Done: V2 multi-cluster, token/TLS options, Streamable HTTP with bearer auth.
162
+ Next: Kubernetes discovery, V3 diagnostics (Prometheus, logs), V4 approval-gated operations and SQL Gateway.