mcpField
P
PayStage Trade Preflight

PayStage Trade Preflight

Local
paystage.xyzFinance4Updated 2d ago

About PayStage Trade Preflight

PayStage Trade Preflight evaluates proposed HIP-3 / trade.xyz orders against a local TradePolicy. It is for order flows that need a policy gate; it does not place, route, or recommend trades.

Key features

  1. 01Local TradePolicy evaluation
  2. 02allow, review, or do_not_trade decisions
  3. 03Rule results explaining decisions
  4. 04No network required for evaluation

Use cases

  1. 01Check a proposed order before trading
  2. 02Send uncertain orders for human review
  3. 03Reject orders that break hard rules

MCP support

Runs as a stdio MCP server and exposes evaluate_hip3_trade, which accepts a proposed order and policy and returns a decision with rule results.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"xyz-paystage-trade-preflight": {
"command": "npx",
"args": [
"-y",
"@paystage/trade-preflight"
]
}
}
}
Run commandnpx -y @paystage/trade-preflight

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@paystage/trade-preflight0.1.2

Tools

1

Saved tool list · updated 4d ago

ParameterTypeRequiredDescription
policyanyNo
proposalobjectYes
proposal.dexstringYes
proposal.sideenumYesbuy | sell
proposal.sizestringYes
proposal.assetstringYes
proposal.leveragenumberNo
proposal.limit_pxstringNo
proposal.order_typeenumNolimit | market
snapshotobjectNo
snapshot.dexstringYes
snapshot.metaobjectYes
snapshot.meta.universearrayYes
snapshot.assetCtxsarrayYes

Details

From the project README

@paystage/trade-preflight

MCP tool: evaluate HIP-3 / trade.xyz orders against a local TradePolicy before trading.

Not financial advice. This is a local policy gate only — it does not place orders, route orders, or recommend trades. It evaluates a proposed order against rules you define and returns a decision.

Published on npm as @paystage/[email protected].

What it does

Given a proposed HIP-3 / trade.xyz order and a local policy file, the server returns one of:

  • allow — the order satisfies every rule in the policy
  • review — the order needs a human or higher-level check before proceeding
  • do_not_trade — the order violates a hard rule in the policy

The decision is deterministic and local. No network calls are required to evaluate a policy; the tool is a gate you put in front of your own order flow.

Install

Run directly with npx:

npx -y @paystage/trade-preflight

Or install it:

npm install @paystage/trade-preflight

The package exposes a stdio MCP server (bin: paystage-trade-preflight).

MCP configuration

{
  "mcpServers": {
    "paystage-trade-preflight": {
      "command": "npx",
      "args": ["-y", "@paystage/trade-preflight"]
    }
  }
}

No environment variables are required. The policy is passed as a tool argument.

Tool

evaluate_hip3_trade

Evaluates a proposed HIP-3 / trade.xyz order against a local TradePolicy.

Inputs (shape):

  • order — the proposed order (market, side, size, price/limit, etc.)
  • policy — the local TradePolicy object (or a path to it, depending on your setup)

Output:

  • decision — allow | review | do_not_trade
  • reasons — list of rule results explaining the decision

Example policy shape:

{
  "version": 1,
  "max_notional": { "value": "100.00", "asset": "USDC", "decimals": 6 },
  "allowed_markets": ["BTC-USD", "ETH-USD"],
  "allowed_sides": ["buy", "sell"],
  "max_leverage": 1,
  "unknown_market": "review"
}

Decisions

DecisionMeaning
allowOrder satisfies all policy rules.
reviewOrder needs a human or higher-level check.
do_not_tradeOrder violates a hard policy rule.

Links

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.