MCP Hub
Back to servers

promptspeak-mcp-server

Pre-execution governance for AI agents. Intercepts MCP tool calls before execution with deterministic blocking, human-in-the-loop holds, and behavioral drift detection.

npm1.1k/wk
Updated
Feb 6, 2026

Quick Install

npx -y promptspeak-mcp-server

promptspeak-mcp-server

Pre-execution governance for AI agents. Blocks dangerous tool calls before they execute.

AI agents call tools (file writes, API requests, shell commands) with no validation layer between intent and execution. A prompt injection, hallucinated argument, or drifting goal can trigger irreversible actions. PromptSpeak intercepts every MCP tool call, validates it against deterministic rules, and blocks or holds risky operations for human approval — in 0.1ms, before anything executes.

PromptSpeak Governance Demo

When to use this

  • You run AI agents that call tools (MCP servers, function calling, tool use) and need a governance layer between the agent and the tools.
  • You need human-in-the-loop approval for high-risk operations (production deployments, financial transactions, legal filings).
  • You want to detect behavioral drift — an agent gradually shifting away from its assigned task.
  • You need an audit trail of every tool call an agent attempted, whether it was allowed or blocked.
  • You operate in a regulated domain (legal, financial, healthcare) where agent actions must be deterministically constrained.

Quick start

npm install promptspeak-mcp-server

Claude Desktop / Claude Code

Add to your MCP configuration (claude_desktop_config.json or .claude/settings.json):

{
  "mcpServers": {
    "promptspeak": {
      "command": "npx",
      "args": ["promptspeak-mcp-server"]
    }
  }
}

From source

git clone https://github.com/chrbailey/promptspeak-mcp-server.git
cd promptspeak-mcp-server
npm install && npm run build
npm start

How it works: 8-stage validation pipeline

Every tool call passes through this pipeline. If any stage fails, execution is blocked.

Agent calls tool
  │
  ├─ 1. Circuit Breaker ──── Halted agents blocked instantly (no further checks)
  ├─ 2. Frame Validation ─── Structural, semantic, and chain rule checks
  ├─ 3. Drift Prediction ─── Pre-flight behavioral anomaly detection
  ├─ 4. Hold Check ────────── Risky operations held for human approval
  ├─ 5. Interceptor ───────── Final permission gate (confidence thresholds)
  ├─ 6. Tool Execution ────── Only reached if all 5 pre-checks pass
  ├─ 7. Post-Audit ────────── Confirms behavior matched prediction
  └─ 8. Immediate Action ──── Halts agent if critical drift detected post-execution

Stages 1-5 are pre-execution — the tool never runs if any check fails. Stages 7-8 are post-execution — they detect drift and can halt the agent for future calls.

MCP tools (40)

Core governance

ToolWhen to call itWhat it does
ps_validateBefore executing any agent actionValidate a frame against all rules without executing
ps_validate_batchWhen checking multiple actions at onceBatch validation for efficiency
ps_executeWhen an agent wants to perform a tool callFull pipeline: validate → hold check → execute → audit
ps_execute_dry_runWhen previewing what would happenRun full pipeline without executing the tool

Human-in-the-loop holds

ToolWhen to call itWhat it does
ps_hold_listWhen reviewing pending agent actionsList all operations awaiting human approval
ps_hold_approveWhen a held operation should proceedApprove with optional modified arguments
ps_hold_rejectWhen a held operation should be deniedReject with reason
ps_hold_configWhen tuning which operations require approvalConfigure hold triggers and thresholds
ps_hold_statsWhen monitoring hold queue healthHold queue statistics

Agent lifecycle

ToolWhen to call itWhat it does
ps_state_getWhen checking what an agent is doingGet agent's active frame and last action
ps_state_systemWhen monitoring overall system healthSystem-wide statistics
ps_state_haltWhen an agent must be stopped immediatelyTrip circuit breaker — blocks all future calls
ps_state_resumeWhen a halted agent should be allowed to continueReset circuit breaker
ps_state_resetWhen clearing agent stateFull state reset
ps_state_drift_historyWhen investigating behavioral changesDrift detection alert history

Delegation

ToolWhen to call itWhat it does
ps_delegateWhen an agent spawns a sub-agentCreate parent→child delegation with constrained permissions
ps_delegate_revokeWhen revoking a sub-agent's authorityRemove delegation
ps_delegate_listWhen auditing delegation chainsList active delegations

Configuration

ToolWhen to call itWhat it does
ps_config_setWhen changing governance rules at runtimeSet configuration key-value pairs
ps_config_getWhen reading current configurationGet current config
ps_config_activateWhen switching policy profilesActivate a named configuration
ps_config_exportWhen backing up configurationExport full config as JSON
ps_config_importWhen restoring configurationImport config from JSON
ps_confidence_setWhen tuning validation strictnessSet confidence thresholds
ps_confidence_getWhen checking current thresholdsGet current thresholds
ps_confidence_bulk_setWhen reconfiguring multiple thresholdsBatch threshold update
ps_feature_setWhen toggling pipeline stagesEnable/disable specific checks
ps_feature_getWhen checking which stages are activeGet feature flags

Symbol registry (entity tracking)

ToolWhen to call itWhat it does
ps_symbol_createWhen registering a new entity (company, person, system)Create symbol with type, metadata, and tags
ps_symbol_getWhen looking up an entityRetrieve by ID
ps_symbol_updateWhen entity data changesUpdate metadata or tags
ps_symbol_listWhen browsing entities by typeList with optional type filter
ps_symbol_deleteWhen removing an entityDelete by ID
ps_symbol_importWhen bulk-loading entitiesBatch import
ps_symbol_statsWhen monitoring registry healthRegistry statistics
ps_symbol_formatWhen displaying an entityFormat symbol for display
ps_symbol_verifyWhen confirming entity data is currentMark symbol as verified
ps_symbol_list_unverifiedWhen auditing stale dataList symbols needing verification
ps_symbol_add_alternativeWhen an entity has aliasesAdd alternative identifier

Audit

ToolWhen to call itWhat it does
ps_audit_getWhen reviewing what happenedFull audit trail with filters

Architecture

src/
├── gatekeeper/       # 8-stage validation pipeline (core enforcement)
│   ├── index.ts      #   Pipeline orchestrator + agent eviction policy
│   ├── validator.ts  #   Frame structural/semantic/chain validation
│   ├── interceptor.ts#   Permission gate with confidence thresholds
│   ├── hold-manager.ts#  Human-in-the-loop hold queue
│   ├── resolver.ts   #   Frame resolution with operator overrides
│   └── coverage.ts   #   Coverage confidence calculator
├── drift/            # Behavioral drift detection
│   ├── circuit-breaker.ts  # Per-agent halt/resume
│   ├── baseline.ts         # Behavioral baseline comparison
│   ├── tripwire.ts         # Anomaly tripwires
│   └── monitor.ts          # Continuous monitoring
├── symbols/          # SQLite-backed entity registry (11 CRUD tools)
├── policies/         # Policy file loader + overlay system
├── operator/         # Operator configuration
├── tools/            # MCP tool implementations
│   ├── registry.ts   #   29 core tools
│   └── ps_hold.ts    #   5 hold tools
├── handlers/         # Tool dispatch + metadata registry
├── core/             # Logging, errors, result patterns
└── server.ts         # MCP server entry point (stdio transport)

Performance

MetricValue
Validation latency0.103ms avg (P95: 0.121ms)
Operations/second6,977
Holds/second33,333
Test suite563 tests, 16 test files

Requirements

  • Node.js >= 20.0.0
  • TypeScript 5.3+ (build from source)
  • No external services required — SQLite for symbols, in-memory for everything else

License

MIT

Reviews

No reviews yet

Sign in to write a review