runggate-mcp-server
by Gong-shijie
README.md
# RungGate — Deterministic MCP & SaaS Vendor Governance Copilot
> **Codegeist 2026 Submission** (`Best Atlassian MCP App` + `Apps for Software Teams`)
> **100% Deterministic Engine · `$0` Paid LLM API Cost · Forge UI Kit 2 + Rovo MCP**
RungGate brings deterministic AI-tooling and SaaS vendor governance directly into **Jira**, **Confluence**, **Rovo**, and external coding agents (**Claude Code**, **Cursor**, **Antigravity**) via Atlassian Forge's `rovo:mcp`, `rovo:agent`, `action`, `jira:issuePanel`, and `confluence:macro` modules.
## Architecture Overview
```mermaid
flowchart LR
Agent["Claude Code / Cursor / Antigravity / Rovo Agent"] -->|MCP JSON-RPC 2.0 / action| ForgeMCP["Forge Handler: src/handlers/mcpServer.ts"]
JiraUI["Jira Issue Panel (UI Kit 2): src/frontend/jiraPanelApp.tsx"] -->|"@forge/bridge invoke"| UIRes["UI Resolver: src/handlers/uiResolver.ts"]
ConfUI["Confluence Macro (UI Kit 2): src/frontend/confluenceMacroApp.tsx"] -->|"@forge/bridge invoke"| UIRes
ForgeMCP --> McpAud["src/engine/mcpAuditor.ts ($0 Rules MCP001-MCP007)"]
ForgeMCP --> Vendor["src/engine/vendorTrust.ts ($0 HTTP/TLS Posture)"]
ForgeMCP --> ConfAud["src/engine/confluenceAuditor.ts (Spec Extractor & Policy Gate)"]
ForgeMCP --> JiraFmt["src/engine/jiraFormatter.ts (Markdown + ADF v1)"]
UIRes --> ForgeMCP
ForgeMCP <-->|Cached Telemetry| KVS["Forge KVS (@forge/kvs / InMemoryKvsStorage)"]
```
## Key Capabilities
### 1. Deterministic MCP Security & Token Auditing (`MCP001`–`MCP007`)
- **`MCP001` Plaintext Secret Detection**: Flags hardcoded Anthropic, OpenAI, GitHub, Atlassian (`ATATT`), Slack, AWS, Stripe, Linear, Bearer tokens, and DB URIs in `env`, `headers`, and `args` (ignoring safe `${env:...}` placeholders) with redacted snippets.
- **`MCP002` Transport & OAuth Hygiene**: Flags unencrypted non-localhost `http://` remote MCP endpoints and `NODE_TLS_REJECT_UNAUTHORIZED=0`.
- **`MCP003` Prompt Injection & Unicode Poisoning**: Detects hidden `<IMPORTANT>` tags, `"ignore previous instructions"`, `~/.ssh` / `~/.aws` exfiltration directives, `curl`/`wget` payloads, BiDi overrides, zero-width characters, and Unicode Tag block smuggling (`U+E0000–U+E007F`).
- **`MCP004` Schema Token Bloat**: Calculates exact JSON schema tokens (`~4 chars/token`) + `$4.50 / 1,000 tokens` active-user monthly API cost benchmark.
- **`MCP005` Duplicate & Near-Duplicate Tools**: Detects exact duplicate descriptions, high-overlap Jaccard near-duplicates (`>= 78%`), and verbatim repeated `inputSchema` objects.
- **`MCP006` Untyped / Overly Broad Parameters**: Flags missing `inputSchema`, omitted `properties`, untyped property definitions, and open-ended `type: "object"` properties with empty `{}`.
- **`MCP007` Supply-Chain Pinning**: Flags unpinned `npx` packages without explicit version tags.
### 2. Deterministic SaaS Vendor Trust Posture
- Evaluates TLS/HTTPS enforcement, HTTP-to-HTTPS redirect behavior, `Strict-Transport-Security` (`max-age >= 180d`), `Content-Security-Policy`, `X-Frame-Options` / `frame-ancestors`, `X-Content-Type-Options: nosniff`, `Referrer-Policy`, RFC 9116 `/.well-known/security.txt`, Trust Center, Status Page, and DPA signals.
- Produces a deterministic **0–100 Trust Score & Risk Score**, **Grade A–F**, and a 5-control **Jira Security Review Checklist**.
### 3. Confluence Governance Gate (`confluence:macro` + `audit_confluence_governance_page`)
- Extracts embedded MCP JSON configs (`mcpServers`, `servers`, `tools`) from Markdown fenced blocks, Confluence `<ac:structured-macro>` code blocks, `<pre>/<code>`, or inline JSON.
- Extracts SaaS/MCP vendor URLs and domains mentioned on the page (ignoring local filenames like `mcp.json`).
- Evaluates `maxTokens`, `minGrade`, and `blockCriticalSecrets` policy gates to return **`APPROVED`**, **`CONDITIONAL`**, or **`BLOCKED`** with ADF v1 and Markdown summaries.
- Renders natively inside Confluence via UI Kit 2 (`src/frontend/confluenceMacroApp.tsx`) with `config: true` macro configuration and interactive re-audit.
### 4. Jira Issue Panel & Remediation Tickets (`jira:issuePanel`)
- Native Forge UI Kit 2 Issue Panel (`src/frontend/jiraPanelApp.tsx`) backed by `@forge/resolver` (`src/handlers/uiResolver.ts`) and `@forge/kvs`.
- Displays cached MCP Grade, schema token cost, top findings table, 5-control Vendor Security Checklist, interactive Quick Audit inputs, and 1-click **Markdown + ADF v1** remediation ticket draft generation.
## Forge Manifest Layout (`manifest.yml`)
- **`app.rovo`**: `tag: runggate`, `name: RungGate Governance`, concise capability `description` (<= 100 chars), and discovery `keywords`.
- **`modules.rovo:mcp`**: `runggate-mcp-server` exposing all 5 `action` keys via `tools:`.
- **`modules.action`**: `audit-mcp-action`, `estimate-budget-action`, `assess-vendor-action`, `generate-ticket-action`, `audit-confluence-action` (shared by both `rovo:mcp` and `rovo:agent`).
- **`modules.jira:issuePanel`** & **`modules.confluence:macro`**: Native UI Kit 2 (`render: native`) pointing to `resources:` (`src/frontend/jiraPanelApp.tsx`, `src/frontend/confluenceMacroApp.tsx`) and `ui-resolver-fn` (`src/handlers/uiResolver.handler`).
- **`permissions.scopes`**: `read:jira-work`, `write:jira-work`, `read:confluence-content.summary`, `read:confluence-space.summary`, `storage:app`.
## MCP Tool Catalog (`RUNGGATE_MCP_TOOLS`)
| Tool Name | Action Key | Purpose |
| :--- | :--- | :--- |
| `audit_mcp_config` | `audit-mcp-action` | Full `MCP001`–`MCP007` audit, A–F grade, and prioritized remediation plan |
| `estimate_tool_token_budget` | `estimate-budget-action` | Schema token footprint + `$4.50/1k tokens` monthly & annual cost forecast |
| `assess_vendor_trust_posture` | `assess-vendor-action` | Live safe HTTP/TLS/header/`security.txt` check + Jira Security Review checklist |
| `generate_jira_remediation_ticket` | `generate-ticket-action` | Structured Markdown + ADF v1 Jira issue payload |
| `audit_confluence_governance_page` | `audit-confluence-action` | Confluence page MCP/vendor extraction + `APPROVED`/`CONDITIONAL`/`BLOCKED` gate |
## Interactive `$0` Static Demo (`demo/index.html`)
Open [`demo/index.html`](demo/index.html) directly in any browser (zero build step, zero API keys) to test all three RungGate surfaces interactively:
1. Jira Issue Panel Simulator
2. Confluence Governance Macro Gate
3. Rovo MCP JSON-RPC 2.0 Playground
## Quickstart (Local Verification & Forge Deploy)
```bash
# 1. Install Forge UI Kit 2, Resolver, KVS & TypeScript dependencies
npm install --no-audit --no-fund
# 2. Typecheck, build, and run deterministic unit + E2E tests
npm run typecheck
npm test
# 3. Provision a Forge demo site and deploy to Atlassian Cloud
forge register
forge site provision --demo-site
forge deploy
forge install
```
## `$0` Deterministic Guarantee
RungGate makes **zero calls** to paid LLM inference APIs (zero OpenAI, Anthropic, Gemini, or Forge LLM SDKs in `package.json` or app code). Every score, token estimate, security finding, Confluence gate verdict, and Jira checklist item is 100% reproducible from deterministic rules.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues