Skip to main content

haltsql-mcp

The safe drop-in replacement for @modelcontextprotocol/server-postgres. Same query(sql) tool, same positional connection string, plus column, tenant and function guardrails, a row cap and a statement timeout.

haltsql-mcp --local-policy policy.yaml postgresql://agent_ro@localhost/mydb

Or with Docker (includes the haltsql CLI; no central server needed):

docker run -i --rm --read-only -v "$PWD:/config:ro" ghcr.io/haltsql/haltsql-mcp \
  postgresql://agent_ro@host.docker.internal/mydb      # /config/policy.yaml is picked up

Build it with docker build -f clients/mcp/Dockerfile . from the repository root, and see scripts/mcp-docker-smoke.sh for the end-to-end test.

An MCP server that lets an agent query PostgreSQL only through HaltSQL: every SQL string is verified against your policy, then exactly that string runs with server-bound parameters in a read-only transaction (row cap, statement_timeout).

Tools: query(sql), explain_denial(sql), list_tables(), describe_policy(). The tenant comes from server configuration (stdio) or the authenticated bearer token (streamable HTTP), never from tool arguments.

pip install ../python .   # Python 3.10+
HALTSQL_URL=http://127.0.0.1:8080 HALTSQL_TOKEN=... \
HALTSQL_MCP_DATABASE_URL=postgresql://agent_ro@db/app \
HALTSQL_MCP_CONTEXT='{"tenant_id":"acme"}' haltsql-mcp

See docs/mcp.md for configuration, the tokens file, and examples. haltsql-mcp --help lists every flag.

Tests

python3 -m venv .venv && .venv/bin/pip install -e ../python -e '.[test,yaml]'
.venv/bin/pytest -q

Metadata

Release files for haltsql-mcp 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haltsql-mcp 0.0.2
File Size Uploaded Provenance Actions
haltsql_mcp-0.0.2.tar.gz 22.0 kB With provenance Details for haltsql_mcp-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for haltsql-mcp 0.0.2
File Interpreter ABI Platform Actions
haltsql_mcp-0.0.2-py3-none-any.whl Python 3 none any Details for haltsql_mcp-0.0.2-py3-none-any.whl

Total release size: 39.4 kB

Release files / haltsql_mcp-0.0.2.tar.gz

Download URL haltsql_mcp-0.0.2.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4f0d2704cda87f53224667d6a6fcb2315e14d7066bec34af5b7749016a27e2a6
BLAKE2b-256 checksum
How to use checksums
91a8c19c75687d918d40d4208f8edf6d48cdd7123440da1c925161cf053d6b44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / haltsql_mcp-0.0.2-py3-none-any.whl

Download URL haltsql_mcp-0.0.2-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5939b8424c51bed31e94905515f108b80dcb3c045b74bbc57f2a196c040a3f0f
BLAKE2b-256 checksum
How to use checksums
a2569450ed7ea4fa09a951c3951f132f0e4809e41cbc0e163b865a747aa44205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for haltsql-mcp 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for haltsql_mcp-0.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files Full provenance

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