Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

gravitywell

Latest version: v0.2.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
PyPI package Publisher: slatecipher
1 Stars
0 Forks
3 Versions
198 Downloads
Python Repo language

Scan summary

gravitywell was last scanned on 29 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions, all published within 5 days (25–29 Nov 2026).
  • Findings: No rules fired in version 0.2.0.
  • Downloads: 198 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 29 Nov 2026 No rules fired
0.1.1 25 Nov 2026 No rules fired
0.1.0 25 Nov 2026 No rules fired

No rules fired in 0.2.0

Findings

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Overview

gravitywell is a typed Python client for Pi-hole's v6 REST API, in sync and async versions.

It handles the session for you, so you can get straight to work: pause blocking for five minutes, add an allow rule, or pull the last hour of blocked queries from one device. Answers come back as Pydantic models your editor can autocomplete.

It's built for AI agents too. Its methods double as tools with descriptions written for a model, and the insights tools answer questions like "why is this domain blocked?" in a single call. gravitywell-mcp serves them to Claude and other MCP clients, read-only unless you allow more.

Install

pip install gravitywell

For the MCP server, install the mcp extra: pip install "gravitywell[mcp]".

Using an AI coding assistant? Point it at llms.txt, a compact guide to gravitywell for models.

Quickstart

Create an application password in the Pi-hole's web interface, under Settings › Web interface / API, and put it in the PIHOLE_PASSWORD environment variable:

import os

from gravitywell import PiHole, PiHoleAuth

auth = PiHoleAuth(os.environ["PIHOLE_PASSWORD"])  # an application password

with PiHole("http://pi.hole", auth=auth) as api:
    summary = api.stats.summary()  # GET /api/stats/summary -> SummaryResponse
    print(f"{summary.queries.percent_blocked:.1f}% of queries blocked in the last 24 hours")

    status = api.dns.blocking()  # GET /api/dns/blocking -> BlockingResponse
    print(f"Blocking is {status.blocking}")  # enabled

    api.dns.set_blocking(False, timer=300)  # pause blocking for five minutes

    why = api.explain_domain("ads.example.com")  # rules, lists and recent queries in one call
    for rule in why.rules:
        print(f"{rule.type} rule ({rule.kind}): {rule.domain}")
  • To keep the URL and password out of your scripts, save them once with gravitywell setup and load them with gravitywell.config.load_config(), as Saved Pi-holes explains.
  • The client logs in on its first request, reuses that session, and logs out when the with block ends: a Pi-hole allows only a few sessions at a time.
  • Each method returns a Pydantic model of the Pi-hole's answer, which your editor and type checker know field by field.
  • A 4xx or 5xx answer raises httpx2.HTTPStatusError, with the Pi-hole's reason in its response.
  • For async code, use AsyncPiHole and await each method, as Async clients explains.

Use it from Claude

Save your Pi-hole once. gravitywell setup asks for its URL and an application password, logs in to check them, and saves them where only you can read them:

uvx gravitywell setup

Then add the server to Claude Code:

claude mcp add --scope user pihole -- \
  uvx --from "gravitywell[mcp]" gravitywell-mcp --pihole primary

Ask "is my Pi-hole healthy?", "why is this site blocked?" or "which device keeps asking for this domain?". It serves read-only tools until you add --allow-writes or --allow-destructive. MCP server covers Claude Desktop and other MCP clients, and choosing which tools to serve.

Features

  • The whole API. Blocking, domain rules, lists, groups and clients, search, statistics, activity history, the query log, settings, DHCP, the network, diagnosis, logs, actions, sessions, and Teleporter backups.
  • Typed throughout. Pydantic v2 models for every answer, Literal types for fixed sets of values, and times as datetime objects in UTC. The package type-checks in pyright's strict mode.
  • Sessions handled. One login per client, shared by concurrent requests, renewed once when it expires, sent in a header rather than the URL, and logged out on close.
  • Sync and async. PiHole and AsyncPiHole have the same methods, built on httpx2.
  • AI tools. Every endpoint is also a tool for a model, with descriptions written for one, JSON Schemas, safety hints, and errors it can act on. The insights tools answer common questions in one call: why a domain is blocked, who a device is, and what's wrong with the Pi-hole.
  • An MCP server. gravitywell-mcp serves the tools to Claude and other MCP clients, read-only by default, and only the areas you choose.
  • Saved Pi-holes. gravitywell setup saves a primary Pi-hole, and optionally a secondary, which load_config() loads and gravitywell-mcp --pihole serves.
  • Guard rails. It won't delete the Default group, change settings that could lock you out, hand a model the session or the password hashes, or let a misspelled setting slip past silently, as Pi-hole would.

Guide

Compatibility

gravitywell supports Pi-hole v6, whose REST API replaced v5's interface, on Python 3.12 and newer. It was modeled on, and tested against, Pi-hole core v6.6, web v6.6.1 and FTL v6.9, which gravitywell.PIHOLE_VERSIONS records. Pi-hole compatibility covers newer releases, and the few endpoints gravitywell leaves out.

Project status

gravitywell is pre-1.0, so its API may change between minor versions. Changes are listed in the changelog. It's maintained in spare time: issues and pull requests are welcome, and CONTRIBUTING.md explains how to set up and check a change.

Acknowledgments

gravitywell is built on ClientX, httpx2 and Pydantic, and its MCP server on FastMCP.

gravitywell is an independent, third-party project. It isn't made, endorsed or supported by the Pi-hole project, and uses the name "Pi-hole" only to say what it works with. Pi-hole® is a registered trademark of Pi-hole LLC.

License

gravitywell is released under the MIT License.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases gravitywell

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Frame 2085668439 (1)
Group 1261154229