hmrdkn-labs

Pos Satpam

Community hmrdkn-labs
Updated

Pos Satpam: capped, cited CI-failure evidence for coding agents

Pos Satpam

Ask why CI failed on GitHub Actions, Jenkins or Bitbucket, and your agent getsone capped, cited answer that says what it left out. It can't touch CI exceptfor one rerun you approve.

Pos Satpam is a bounded Model Context Protocol (MCP) server for coding andoperations agents. It turns allowlisted CI provider data into small, typed,redacted evidence. The agent, chat gateway, credentials, and deployment policyremain outside the server. Read-only Grafana and Prometheus-compatibleobservability tools are also included.

ValidateLicenseNode.js

Product Boundary

AI client or chat gateway
        |
        | MCP stdio or private Streamable HTTP
        v
Pos Satpam application
  protocol -> policy -> domain evidence -> redaction and bounds
        |                 |                  |
        v                 v                  v
   MCP schemas      provider adapters    metadata-only audit
        |                 |
        +---------> observability, CI, and SCM providers

The code follows these bounded contexts:

  • Protocol owns MCP lifecycle, transports, tool registration, and errors.
  • Policy owns provider, repository, workflow, ref, dashboard, query, andcapability allowlists.
  • Evidence owns versioned envelopes, freshness, truncation, redaction, anddeterministic digests.
  • Provider adapters translate Grafana, Prometheus-compatible backends,GitHub Actions, Jenkins, Bitbucket Cloud, and SCM APIs into those contracts.
  • CI operations owns read-only status, logs, failure analysis, remediationplans, SCM evidence, telemetry correlation, and the one approval-gated GitHubfailed-job rerun.
  • Observer is an optional companion process for bounded polling/webhooknormalization, dedupe, and signed internal delivery. It is not an MCP tool ora chat gateway.

Pos Satpam does not run an LLM, receive chat messages, execute shell commands,retrieve secrets, modify source, deploy workloads, mutate alerts or dashboards,or silently call another MCP server. The only write-capable path is GitHub'srerun-failed-jobs, and it requires a fresh one-time operator approval.

Current Condition

What works today, checked 2026-11-26:

  • From source: clone, npm ci, npm run build, then run node dist/cli.jsover stdio. See Install And Run.
  • GitHub Actions is the provider that has been run against a live repository.Jenkins and Bitbucket Cloud are implemented and covered by recordedfixtures; they have not been exercised against a live server.
  • Bitbucket Data Center is a contract only. There is no adapter.
  • Real CI data needs the private HTTP transport, a YAML configuration and aGitHub App. A read-only token over stdio is not available yet.
  • The stdio server returns demo data. See Demo Data.
  • No token-savings number is claimed. It has not been measured.
  • Nothing is published yet. The npm package is published from v0.3.0, andthe image ghcr.io/hmrdkn-labs/pos-satpam appears at the next release. Theregistry listing follows the npm package. Until then, use the source route.

Private HTTP is a single-operator pre-release transport. Public exposure isblocked until OAuth, authorization, Origin policy, ingress and tenant isolationare implemented and verified. The private edge observer and chat-gateway routeremain deployment-owner work. See theimplementation status.

What The Approval Gate Does Not Cover

The one write path, rerun of failed GitHub jobs, needs a fresh one-time operatorapproval. That gate holds only if the agent has no other CI-write credential.If the agent also has a shell with a gh token or any other token that canrerun, cancel or trigger workflows, it can bypass Pos Satpam. Give the agent aread-only credential, or none, outside this server.

Install And Run

Node.js 22 or newer is required.

From source (stdio)

git clone https://github.com/hmrdkn-labs/pos-satpam.git
cd pos-satpam
npm ci
npm run build
npm run inspector:list

The last command starts node dist/cli.js and prints the tools/list result.To use the server from an MCP client, launch it as a child process:

{
  "mcpServers": {
    "pos-satpam": {
      "command": "node",
      "args": ["/absolute/path/to/pos-satpam/dist/cli.js"]
    }
  }
}

Demo Data

pos-satpam over stdio has no provider configured. It serves a built-in fakeprovider: fixed example services, alerts and metrics. Every result says so, with"providerClass": "fake" and "notice": "demo data: no provider configured".Do not treat stdio output as information about any real system. Real CI evidenceneeds the private HTTP transport below.

OCI image

The image identity is:

ghcr.io/hmrdkn-labs/pos-satpam@sha256:<immutable-digest>

This image is published by the next release workflow; the digest will be recordedin the release notes. Earlier images were published under a previous image name,recorded in the changelog. Always pin by digest. The image isnon-root, supports linux/amd64 and linux/arm64, and defaults to stdio:

docker run --rm -i ghcr.io/hmrdkn-labs/pos-satpam@sha256:<immutable-digest>

For private HTTP, run dist/http-cli.js, mount the configuration and secretfiles read-only, and pass the same environment variables shown below. Thecontainer entrypoint is node; the command selects the transport.

npm package

Published from v0.3.0. Until that release the package does not exist on theregistry and npm install @hmrdkn-labs/pos-satpam fails with E404. Afterpublication:

npx @hmrdkn-labs/pos-satpam

Private Streamable HTTP

Private HTTP is for a private, single-operator network. It requires a strictYAML runtime configuration and a bearer token in a regular 0600 file. Valuesare never put in the YAML, command line, MCP request, logs, or documentation.

node dist/http-cli.js

(pos-satpam-http after an npm install.) The HTTP process reads theseenvironment variables:

MCP_HTTP_HOST=127.0.0.1
MCP_HTTP_PORT=8765
MCP_HTTP_ALLOWED_HOSTS=127.0.0.1
OBSERVABILITY_PROVIDER_CONFIG=/private/path/provider-config.yml
MCP_TOKEN_FILE=/private/path/mcp-token
GRAFANA_TOKEN_FILE=/private/path/grafana-token   # observability profiles only

If a required variable is missing or the configuration is invalid, it prints oneline to stderr and exits with status 2.

The bearer file must be a regular 0600 file containing at least 16 bytes. TheGrafana file follows the same rule. CI credentials, GitHub App material,approval keys, and Bitbucket tokens are separate 0600 files referenced by theruntime configuration. Use the versioned examples as placeholder-onlytemplates.

The current HTTP routes are:

Route Enabled when Surface
/mcp observability is enabled seven observability tools, plus CI tools in combined
/mcp/ci CI is enabled CI tools only
/healthz HTTP process is running unauthenticated process liveness

All MCP routes require an Authorization Bearer credential and an exactconfigured Host value. /mcp is absent for ci-only; /mcp/ci is absent when CI isdisabled.

Development

npm ci
npm run validate

The controlled GitHub Actions fixture at .github/workflows/goal14-controlled-fixture.ymlis a test-only failure/rerun reference and is not a production workflow.

Profiles

Profile Transport Provider requirement Client endpoint
observability-only private HTTP metrics, alerts, Grafana, policy /mcp
ci-only private HTTP one enabled CI provider and CI allowlist /mcp/ci
combined private HTTP observability and one enabled CI provider /mcp and /mcp/ci
stdio local stdio none; serves labelled demo data from a fake provider process stdin/stdout
private-http example name for observability HTTP same as observability-only /mcp

The configuration parser requires version: 1. Observability profiles requireproviders and policy. CI profiles require ci.enabled: true; CI cannot beenabled in observability-only. The CI-only profile does not require Grafanaconfiguration or a Grafana credential.

Provider Matrix

Provider CI read contract SCM read contract Mutation Credentials
GitHub Actions status, failed-job analysis, redacted logs, dry-run remediation, failure analysis, optional telemetry/SCM GitHub commits, comparisons, and pull requests approval-gated failed jobs only GitHub App files; separate read/write token paths are enforced by the adapter
Jenkins status, failed-job analysis, redacted console evidence, dry-run remediation, failure analysis, optional telemetry/SCM configured multibranch job change evidence unsupported anonymous read or username/API token; credentialed transport requires HTTPS
Bitbucket Cloud pipeline status, failed-job analysis, redacted logs, dry-run remediation, failure analysis, optional telemetry/SCM pull-request identity, diffstat, bounded diff evidence unsupported username:token or token plus username in a 0600 file; HTTPS required
Bitbucket Data Center contract-only contract-only unsupported contract artifact only; no built-in adapter or supported runtime profile

Provider identity is metadata, not a caller-selected URL. GitHub Actions emitsgithub-actions and SCM emits github; Bitbucket Cloud emits bitbucket-cloud.Run and job identifiers remain provider-native strings, including numericstrings and supported UUID forms. Pos Satpam does not invent a cross-providernumeric ID.

URL And Reverse-Proxy Semantics

Provider configuration accepts exactly one of these forms:

base_url: https://ci.example.test/reverse-proxy/2.0

or:

endpoint:
  origin: https://ci.example.test
  path: /reverse-proxy/2.0

base_url is parsed into the same origin plus path pair. The origin must notcontain credentials, query data, or fragments. endpoint.origin must be only anHTTP(S) origin, and endpoint.path must be an absolute path without query orfragment. Do not configure both forms.

Provider request paths are appended under the configured path exactly once. Arequest for /repositories/... therefore becomeshttps://ci.example.test/reverse-proxy/2.0/repositories/..., never.../2.0/reverse-proxy/2.0/.... Absolute provider request URLs are accepted onlywhen their origin matches the configured origin. Redirects are rejected.

GitHub is restricted to the HTTPS api.github.com origin. Jenkins allowsexplicit loopback HTTP only for anonymous development; credentials alwaysrequire HTTPS. Bitbucket credentials always require HTTPS. A reverse proxy doesnot change the provider capability or authorization policy.

Evidence And Budgets

Every result includes schema version 1.0, observation time, provider class,freshness, truncation, redaction status, warnings, and normalized data.

  • Observability: at most 25 services, 100 alerts, 50 metric series, 1,440samples per series, and a 24-hour query/range window. Metric steps are 1second to 1 hour. Panel renders are at most 1,600 x 900 and dashboards atmost 2,400 x 4,000; the visual adapter also enforces byte, timeout, andconcurrency limits.
  • CI: one log call accepts at most 200 redacted lines. Provider responsesare capped at 2 MiB and freshness defaults to 300 seconds, configurable upto 3,600 seconds. Failure analysis accepts at most 10 jobs, 200 log lines,25 changed files, 40 lines per hunk request, and 20 telemetry signals.
  • SCM: direct ci.scm_change_evidence has six budgets: maxBytes(256 KiB maximum, 64 KiB default), maxFiles (100 maximum, 100 default),maxHunks (100 maximum, 50 default), maxLines (10,000 maximum, 2,000default), maxProviderRequests (16 maximum, 4 default), and maxDurationMs(60,000 maximum, 10,000 default). Results report both limits and usage.
  • Aggregate failure analysis: maxFiles 1-25, maxHunks 1-100, maxLines1-200, maxBytes 1 KiB-256 KiB, maxProviderRequests 2-32, and a positive timewindow no longer than 24 hours. Defaults derive from requested changes/loglines, with 64 KiB and 16 provider requests.
  • Telemetry contract: metric, alert, log, and trace references are boundedto 100 items; metric samples are bounded to 1,440 per series; correlationwindows are at most 24 hours. The current runtime bridge supplies namedmetrics only. It does not fetch raw logs or traces and never claims causality.
  • Observer: defaults are a 30-second poll, 5-minute overlap, 24-hourinitial lookback, 1-hour stale threshold, 100 items per page, and two pagesper target. Failed jobs default to 5, log lines to 80, payloads to 128 KiB,delivery attempts to 4, delivery timeout to 10 seconds, and lease time to 60seconds. Each value has a strict schema maximum; pagination truncation isdegraded health, not silent cursor advancement.

Oversized or unavailable evidence is marked explicitly. Raw provider payloads,raw logs, credentials, and image bytes do not become normal logs or durableobserver state.

CLI Commands And Doctor

Command Function
pos-satpam stdio server
pos-satpam-http private Streamable HTTP server
pos-satpam-doctor metadata-only runtime readiness diagnostic
pos-satpam-observer optional observer companion
pos-satpam-approval operator approval CLI

The commands are installed by the npm package from v0.3.0. From a sourcecheckout, run the built files directly: node dist/cli.js,node dist/http-cli.js, node dist/diagnostics/cli.js,node dist/observer/cli.js and node dist/approval-cli.js.

Run the doctor with paths, never with secret values:

node dist/diagnostics/cli.js \
  --config /private/path/provider-config.yml \
  --mcp-token /private/path/mcp-token \
  --grafana-token /private/path/grafana-token

For ci-only, omit --grafana-token. The doctor reports profile, providermetadata, and file readiness without printing file contents.

Operator Workflow And Rollback

  1. Copy one profile example into a private deployment directory.
  2. Create regular 0600 files for each credential and approval key; do not committhem or put values in YAML.
  3. Run pos-satpam-doctor and fix every error before starting HTTP.
  4. Start the server on loopback or a private interface with exact allowed Hostvalues. Verify /healthz, bearer denial, MCP initialization, tool discovery,and one read-only call.
  5. For CI, verify the repository/workflow allowlist and provider capabilitymetadata. Treat provider text as untrusted evidence. Followobserve -> analyze -> redact/bound -> dry-run plan -> one approval -> rerunfailed jobs -> observe; the observer never performs the approval or rerun.
  6. Pin releases by npm version or OCI digest and retain the previous known-goodreference and metadata-only observer state.

To roll back, stop the new process, restore the prior pinned npm version or OCIdigest with the same private configuration and credential file paths, and repeatthe health/MCP read-only checks. Do not delete observer state during a rollbackunless the deployment owner has confirmed a schema migration; state ismetadata-only and exists to prevent duplicate delivery. A rollback does notrevert provider-side changes, and Pos Satpam has no deployment or sourcerollback authority.

Chat Gateway And External AI Boundary

A chat gateway, a desktop client, or another AI client owns prompts, conversation state, and chatdelivery. Pos Satpam returns evidence over MCP. The optional observer sends freshsuccess or failure events to operator-configured internal routes using an HMACover timestamp.body, a deterministic request ID, bounded retries, and no rawlog lines. The analysis route may trigger an external agent to call PakSatpam's read-only CI tools; the observer itself does not run an LLM, browse,execute commands, rerun jobs, or send Discord/chat messages.

Documentation

  • Architecture and DDD boundaries
  • Installation and portability
  • Tool surface and budgets
  • Provider and CI contract
  • Operator runbook and rollback
  • CI observer contract
  • Security model and forbidden capabilities
  • Client compatibility
  • Verification and contributor workflow
  • Implementation status and blockers
  • Examples

License

Apache License 2.0. See LICENSE.

MCP Server · Populars

MCP Server · New