Skip to main content

spm-mcp: MCP server for Secure Proxy Manager

A Model Context Protocol server that exposes part of the Secure Proxy Manager management API as tools, so an assistant or agent can query traffic and analytics, read the WAF categories and the domain blacklist, and, when you allow it, change them. It speaks MCP over the stdio transport and authenticates to the backend API with an SPM API token.

Tools

The tools come from the server. At the first request the MCP client makes, spm-mcp reads the OpenAPI document of the backend (GET /api/openapi.json) and offers one tool for each operation the backend marks for MCP (x-spm-mcp-name): the tool's description is the operation's summary, and its arguments are the operation's path parameters, query parameters and request body fields, with the API's own schemas. A tool the server does not have is never offered. spm-mcp 0.5.0 needs Secure Proxy Manager 3.41.0 or later; an older server names no tool, and spm-mcp says so instead of offering none.

With Secure Proxy Manager 3.41.0 the tools are:

Tool API call Offered
spm_status GET /api/status always
spm_dashboard GET /api/dashboard/summary always
spm_top_domains GET /api/analytics/top-destinations (20 hosts) always
spm_shadow_it GET /api/analytics/shadow-it always
spm_user_agents GET /api/analytics/user-agents always
spm_recent_logs GET /api/logs (limit, outcome, q, since, ... as the API reads them) always
spm_waf_categories GET /api/waf/categories always
spm_list_domain_blocklist GET /api/domain-blacklist (limit, offset, search) always
spm_block_domain POST /api/domain-blacklist only with SPM_MCP_READONLY=false
spm_unblock_domain DELETE /api/domain-blacklist/{id} only with SPM_MCP_READONLY=false
spm_toggle_waf_category POST /api/waf/categories/toggle only with SPM_MCP_READONLY=false
spm_allow_egress POST /api/egress-allowlist only with SPM_MCP_READONLY=false
spm_reload_config POST /api/maintenance/reload-config only with SPM_MCP_READONLY=false

The server is read-only by default. The read tools return traffic data that anyone whose requests cross the proxy can shape (URLs, domains, user agents), so text in a log row can try to instruct the model; with the mutating tools available, an auto-approved call could disable a WAF category or open egress. The output of every operation the backend marks x-spm-untrusted (today the dashboard, analytics, log and domain blocklist tools) is wrapped in {"untrusted_data_notice": ..., "data": ...}, and every tool carries MCP annotations: readOnlyHint for a GET, destructiveHint for every write, idempotentHint for a GET or a PUT. An operation that takes dry_run answers what it would do unless the call says confirm: true. If you enable the mutating tools, do not auto-approve them.

Authenticate with a token

SPM_TOKEN needs spm-mcp 0.4.0 or later and Secure Proxy Manager 3.28.0 or later; with older versions, use SPM_USERNAME and SPM_PASSWORD.

Create a token in the dashboard under Settings > Admin and backup > API tokens (or POST /api/tokens) and give it to the server as SPM_TOKEN. A read token is enough for the default read-only server. The mutating tools need both SPM_MCP_READONLY=false and a write token: with a token, the server asks GET /api/session for its scope at start and registers them only when the answer is write. A read token, or an answer it cannot read, registers none and says so on stderr.

A token is limited to its scope, never reaches the token, password, backup or database export routes, can be revoked alone, and the audit log records its changes as token:<name>. See the authentication API.

SPM_USERNAME and SPM_PASSWORD still work when SPM_TOKEN is not set, with a warning on stderr. They are deprecated and will be removed in the next release.

Configure

Env Default Meaning
SPM_URL http://localhost:5001 SPM backend API base URL
SPM_TOKEN empty SPM API token, sent as Authorization: Bearer
SPM_USERNAME admin Deprecated: admin user (Basic auth), used only without SPM_TOKEN
SPM_PASSWORD empty Deprecated: admin password, used only without SPM_TOKEN
SPM_VERIFY true false to skip TLS verification for a self-signed HTTPS URL
SPM_MCP_READONLY true false, 0 or no to also register the mutating tools

http://localhost:5001 is the backend's host-only port, so the default works on the machine that runs the stack. From elsewhere, use https://<host>:8443 with SPM_VERIFY=false (or a trusted certificate).

Run

With uv, from PyPI:

SPM_URL=http://localhost:5001 SPM_TOKEN=spm_... uvx spm-mcp

From this directory of a clone:

SPM_URL=http://localhost:5001 SPM_TOKEN=spm_... uvx --from . spm-mcp

In an MCP client configuration (for example Claude Desktop):

{
  "mcpServers": {
    "secure-proxy-manager": {
      "command": "uvx",
      "args": ["spm-mcp"],
      "env": {
        "SPM_URL": "http://localhost:5001",
        "SPM_TOKEN": "spm_..."
      }
    }
  }
}

The Dockerfile here builds an image that runs the server over stdio as a non-root user; the shipped compose files do not include it.

Requires Python 3.11 or later. MIT-licensed, part of Secure Proxy Manager.

Metadata

Release files for spm-mcp 0.5.0

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

Source distribution (sdist)

Source distribution for spm-mcp 0.5.0
File Size Uploaded Provenance Actions
spm_mcp-0.5.0.tar.gz 30.1 kB With provenance Details for spm_mcp-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spm-mcp 0.5.0
File Interpreter ABI Platform Actions
spm_mcp-0.5.0-py3-none-any.whl Python 3 none any Details for spm_mcp-0.5.0-py3-none-any.whl

Total release size: 39.5 kB

Release files / spm_mcp-0.5.0.tar.gz

Download URL spm_mcp-0.5.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
677a1abdbd91928224901a6ccd0efed8063b1f4fe0c30ec19a26b0b9ab0a9d97
BLAKE2b-256 checksum
How to use checksums
d76d529864052690facfca7f96668ce057c1413fcb1bd03231648f6292c054bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 16, 2026.

Transparency log

Release files / spm_mcp-0.5.0-py3-none-any.whl

Download URL spm_mcp-0.5.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bc32ae87dad480334837604d4d02c0a0e9c42b8621c38e001093782c3cefcde
BLAKE2b-256 checksum
How to use checksums
7e49d4864a0937f8124516938a043f5bd624103823d897e8e452159a0f3714f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 16, 2026.

Transparency log

Security for spm-mcp 0.5.0

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 spm_mcp-0.5.0.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 16, 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.

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