Skip to main content

flux-topology

skills.sh

A CLI + agent skill that builds a dependency and topology graph of a Kubernetes/FluxCD GitOps repository by static analysis, so AI agents can reason about service relationships without cluster access.

Install

pip install flux-topology

Optional — install the agent skill from skills.sh:

npx skills add seppaleinen/flux-topology-mcp

No MCP server is required. Run the CLI from your GitOps repo root; it reads from flux/ in the working directory.

Subcommands

Command Description
build [dir] [--force] Build the topology cache (.fluxtop/)
map [dir] [--json] Top-level view: domains, hub apps by edge count, warnings
trace <app> [dir] [--direction out|in|both] [--depth N] [--json] BFS blast radius from any app with typed edges
find-refs <pattern> [dir] [--json] Regex search for references across all apps
app-card <app> [dir] [--json] Full card for one app: workloads, services, edges
check-freshness [dir] [--json] Check if the topology cache is up to date (never rebuilds)

[dir] defaults to .. A directory is resolved to its flux/ subdirectory when present; otherwise the directory itself is treated as the flux root.

Exit codes

Code Meaning
0 Found / fresh
1 Stale, corrupt, not-found, or invalid input
2 Usage error (argparse)
3 No cache (check-freshness only)

CLI examples

# Build the topology cache (.fluxtop/)
flux-topology build

# Rebuild even when the cache is fresh
flux-topology build --force

# Human-readable overview
flux-topology map

# Machine-readable output
flux-topology map --json

# Blast radius: what depends on this app? (depth 5)
flux-topology trace apps/backend --direction in

# Find every app referencing a shared resource
flux-topology find-refs "postgres-rw\.postgres\.svc\."

# Full card for one app
flux-topology app-card apps/radarr

# Freshness check (exit codes 0/1/3)
flux-topology check-freshness

How it works

  1. Discovers apps by walking flux/ and finding ownership signals (HelmReleases, Kustomizations, Deployments, Services)
  2. Extracts workloads, services, ingress hosts, and refs per app
  3. Resolves edges between apps from cross-references
  4. Caches everything in .fluxtop/ — rebuilt only when source files change

Hybrid freshness

The cache is checked against a fingerprint of all YAML files on every query:

  • No cachemap/trace/find-refs/app-card auto-build once and then answer normally. check-freshness instead reports NO CACHE (exit 3) and never rebuilds.
  • Fresh — the cache matches the working tree; queries answer from it.
  • Stale / corrupt — queries surface a notice and exit 1 without rebuilding, so results are never silently outdated. Rebuild explicitly with flux-topology build --force, or just build (which also rebuilds when the fingerprint no longer matches).

Deployment note (dotfiles env)

The always-on flux-topology MCP server was removed from the shared MCP list in the user's dotfiles environment (Stow-managed). The tool is now used on-demand via the CLI + skill. Re-push the rewritten skill via skills.sh.

Development

git clone https://github.com/seppaleinen/flux-topology-mcp.git
cd flux-topology-mcp
pip install -e ".[dev]"
pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flux_topology-0.3.1.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flux_topology-0.3.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file flux_topology-0.3.1.tar.gz.

File metadata

  • Download URL: flux_topology-0.3.1.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flux_topology-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b19aea033a9c3f57cbbd6d7800c0606d0a3ea8ae3140155db248995bf8900a5a
MD5 1496ab1fe41b636721979058177f1510
BLAKE2b-256 84b6052dc1d26066a033daae88c8e9e76c0232ff190fcf4fddb71e0458cfc7b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for flux_topology-0.3.1.tar.gz:

Publisher: release.yml on seppaleinen/flux-topology-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flux_topology-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: flux_topology-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flux_topology-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8454d0c911820fe08f43bf2e5d5e15a289db18bb809b19338935f47c054989b5
MD5 2e4f2e38110d8f2f1bc6233f89693deb
BLAKE2b-256 529800ec7acc5e33e89b1e142284b0d2d9ae6ad06f1d844a56de6cfd13d79969

See more details on using hashes here.

Provenance

The following attestation bundles were made for flux_topology-0.3.1-py3-none-any.whl:

Publisher: release.yml on seppaleinen/flux-topology-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.2

2 files

This release

0.3.1 This release

2 files

0.2.4

2 files

0.2.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page