Live package

@stacksona/mcp-server

Give an MCP client the real Stacksona Gate tools without building the Gate HTTP and polling layer yourself.

Connect it

  1. 1
    Install.

    npm install -g @stacksona/mcp-server

  2. 2
    Set environment.

    STACKSONA_GATE_URL and STACKSONA_API_KEY.

  3. 3
    Add the server to your MCP client.

    The client immediately receives eight Stacksona tools.

MCP client config

json
{
  "mcpServers": {
    "stacksona": {
      "command": "stacksona-mcp-server",
      "env": {
        "STACKSONA_GATE_URL": "https://{gate-id}.stacksona.cloud",
        "STACKSONA_API_KEY": "sg_your_api_key"
      }
    }
  }
}

Available tools

MCP toolPurpose
stacksona_resolve_toolsResolve registered Gate tool contracts.
stacksona_log_eventAppend timeline evidence.
stacksona_request_decisionEvaluate one exact proposed tool call.
stacksona_request_decision_and_pollEvaluate and follow the exact review thread when human review is required.
stacksona_get_decisionRead a review by thread or task.
stacksona_list_decisionsList recent pending or completed review references.
stacksona_submit_revisionSubmit reviewer-requested changes on the same review thread.
stacksona_validate_approval_tokenValidate and consume signed one-time approval proof.

Typical agent flow

text
stacksona_request_decision_and_poll
  task_id: refund-order-8821
  tool_name: issue_refund
  payload: { order_id: "8821", amount: 500, currency: "usd" }

allow / approved        -> execute exact proposed call
reject / rejected       -> stop
changes_requested       -> revise, then stacksona_submit_revision

The poll helper honors Gate's recommended delay when present and returns on changes_requested so the agent can revise instead of waiting forever.

Dynamic tool contracts

Use stacksona_resolve_tools before model tool selection to load the exact registered name, description, and input schema from Gate.

Signed approvals

For actions configured to require signed proof, call stacksona_validate_approval_token before forwarding the action and branch on the returned valid value.

Enforcement still belongs at the executable boundary

If an MCP client can call the raw domain tool directly, calling Stacksona first is guidance rather than enforcement. Put Gate in the wrapper that owns access to the real side effect.

Package version

@stacksona/mcp-server 0.3.0 · Node.js 18+