Skip to main content
Glama
README.md
# `postman-escape-mcp` — Postman / HAR to Bruno (`.bru`) & Hurl (`.hurl`) MCP Server + GitHub Action

[![z121245017-ai/postman-escape-mcp MCP server](https://glama.ai/mcp/servers/z121245017-ai/postman-escape-mcp/badges/score.svg)](https://glama.ai/mcp/servers/z121245017-ai/postman-escape-mcp)

Zero-dependency, 100% offline **Model Context Protocol (`MCP`) Server**, **CLI**, and **GitHub Action** enabling Claude Desktop, Cursor, Windsurf, Antigravity, and CI pipelines to migrate Postman Collections (`v2.0` / `v2.1`), Environments, and HTTP `.har` captures into Git-native **Bruno (`.bru`)** workspaces and CI-runnable **Hurl (`.hurl`)** test suites—while blocking leaked live API credentials before `git commit`.

## MCP Tools Exposed (`stdio`)

| Tool | Purpose | Annotations |
| :--- | :--- | :--- |
| `convert_postman_to_bruno` | Converts Postman Collection (`v2.0`/`v2.1`) + optional Environment JSON into Bruno `.bru` files, scrubbed `.env.example`, `.gitignore`, and `MIGRATION_REPORT.md`. Repairs Bruno `#8680` (`enabled: null`) crashes and normalizes dotted variable names (`api.base.url` -> `api_base_url`). | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `convert_postman_to_hurl` | Compiles Postman Collection or `.har` JSON into CI-ready `.hurl` test files (`hurl/suite.hurl` + `hurl/hurl.vars.example`) with deterministic `[Captures]` and `[Asserts]`. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `scan_api_collection_secrets` | Audits Postman JSON, `.har` captures, or Bruno `.bru` text for live `Bearer` tokens, JWTs (`eyJ...`), `Basic` auth passwords, `Cookie` headers, `x-api-key`, and cloud/API keys (`AKIA...`, `sk_live_...`, `ghp_...`) with 1-based line numbers and redacted previews. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `audit_pm_script_compatibility` | Inspects Postman `pm.*` pre-request and test scripts (full Collection JSON or raw JS snippet) and flags non-transpilable `pm.sendRequest(...)` or `CryptoJS` calls with exact line numbers and Bruno/Hurl migration guidance. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |

## Quick Start (MCP Client & Local CLI)

```bash
# Start MCP server over stdio (zero npm install / zero external dependencies)
npx -y github:z121245017-ai/postman-escape-mcp

# List MCP tool schemas from terminal
npx -y github:z121245017-ai/postman-escape-mcp --list

# Scan a .bru or Postman file from terminal
npx -y github:z121245017-ai/postman-escape-mcp --cli scan_api_collection_secrets '{"content":"headers {\n  Authorization: Bearer live_secret_token_123456\n}","fileName":"login.bru"}'
```

### Claude Desktop / Cursor / Windsurf / Antigravity Config

```json
{
  "mcpServers": {
    "postman-escape": {
      "command": "npx",
      "args": ["-y", "github:z121245017-ai/postman-escape-mcp"]
    }
  }
}
```

### Docker (`node:22-alpine`, non-root `USER node`)

```bash
docker build -t postman-escape-mcp .
docker run -i --rm postman-escape-mcp
```

## GitHub Action (`z121245017-ai/postman-escape-mcp@v1`)

Add `postman-escape-mcp@v1` to `.github/workflows/` to automatically block pull requests that commit un-scrubbed Postman, `.har`, or Bruno `.bru` credentials (`Bearer`, JWT, `Basic`, `Cookie`, `x-api-key`) and verify `pm.*` -> Bruno/Hurl script compatibility with inline `::error file=...,line=...::` PR annotations:

```yaml
name: API Secret & Migration Gate

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  api-collection-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Block leaked Postman / HAR / Bruno secrets & incompatible pm.* scripts
        uses: z121245017-ai/postman-escape-mcp@v1
        with:
          paths: '.'
          fail-on-secrets: 'true'
          fail-on-incompatible-scripts: 'true'
```

### Action Inputs & Outputs

| Name | Kind | Default | Description |
| :--- | :--- | :--- | :--- |
| `paths` | Input | `.` | Newline- or space-separated files or directories to scan. |
| `fail-on-secrets` | Input | `true` | Exit `1` when live credentials are detected in `.json`, `.har`, or `.bru` files. |
| `fail-on-incompatible-scripts` | Input | `true` | Exit `1` when Postman `pm.*` scripts contain non-transpilable calls (`pm.sendRequest`, `CryptoJS`). |
| `ignore` | Input | `node_modules,.git,dist,build,coverage,vendor` | Comma-separated directory names skipped during recursive scan. |
| `scanned-files` | Output | — | Number of API collection, environment, `.har`, and `.bru` files inspected. |
| `secrets-found` | Output | — | Total count of live credential leaks detected. |
| `script-issues-found` | Output | — | Total count of non-transpilable `pm.*` script constructs flagged. |
| `report-json` | Output | — | Structured JSON summary of audit findings. |

## Verification

```bash
npm test
```

## License

MIT License — `0` external npm dependencies, `0` network calls, `100%` local execution.

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: secret scanning, pm.* script compatibility auditing, and two separate converters targeting different output formats (Bruno vs Hurl). The two convert_* tools share a source but are unambiguous because the destination format is explicit in the name and description. An agent can reliably select the right tool from the request intent.

Naming Consistency4/5

All names are snake_case with a leading verb (scan_, audit_, convert_), which gives a predictable pattern. The two convert_postman_to_* tools are perfectly parallel, though the noun phrases vary in length/shape across the audit tools, which is a minor stylistic deviation only.

Tool Count4/5

Four tools is a tight, well-scoped surface for a Postman-to-Bruno/Hurl migration workflow, with each tool earning its place. It is slightly lean—one could imagine a dedicated environment-only or validation tool—but nothing feels redundant or missing for the core scope.

Completeness4/5

The surface covers the main migration lifecycle: secret detection, script transpilability auditing, and conversion to both Bruno and Hurl with scrubbed artifacts. Minor gaps exist around validating/round-tripping converted output (e.g., no re-parse or reverse conversion, and Hurl handles .har while Bruno conversion does not), but agents can work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues