SlipSentry MCP
Official# SlipSentry MCP
Deterministic pre-sign trade firewall for autonomous Solana AI agents.
Live console: [https://slipsentry.thecode.blog](https://slipsentry.thecode.blog)
Streamable HTTP MCP endpoint: `POST https://slipsentry.thecode.blog/mcp` (JSON discovery: `GET /api/mcp-info`)
## What it solves
Autonomous Solana trading bots prepare swaps without a human watching pool depth or token metadata. Before a wallet daemon signs a swap transaction, it needs numeric answers: are the mint and freeze authorities revoked on Solana mainnet? Does the order exceed a safe share of the deepest DEX pool? Does live Jupiter routing create excessive price impact? Do the top 10 wallets control too much of the supply?
SlipSentry MCP evaluates 6 deterministic rules using CoinGecko On-Chain API, Solana Mainnet RPC, and Jupiter Swap v1 Quote. Every call returns a machine-readable `ALLOW`, `WARN`, or `BLOCK` verdict, a boolean `canSign`, an estimated `maxSafeOrderUsd` (reduced orders must be re-audited before signing), and an HMAC-SHA256 signed receipt with a 5-minute TTL.
Autonomous agents can connect through three interfaces:
1. Streamable HTTP MCP at `POST https://slipsentry.thecode.blog/mcp` (JSON-RPC 2.0, protocol `2025-03-26`; `GET /mcp` returns `405 Method Not Allowed` with `Allow: POST` because no GET SSE stream is offered, and notification-only batches return empty `202 Accepted`).
2. Local `stdio` MCP server (`npm run mcp:stdio` or `node bin/slipsentry-mcp.mjs`) for Claude Desktop, Cursor, or headless orchestrators.
3. In-process JavaScript adapter (`lib/solanaAgentAdapter.mjs`: `getSlipSentryAgentTools()` and `assertSafeBeforeSign()`) for Solana Agent Kit, OpenAI, or LangChain bots.
## Screenshots
### 1. Live Pre-Sign Block ($100,000 USDC -> WIF)

### 2. Safe Order Size Pass ($1,000 USDC -> WIF)

### 3. MCP Wire Trace, Signed Receipt Verifier & Agent Config

## How CoinGecko API is used
SlipSentry calls four CoinGecko Solana On-Chain API endpoints from the server (`lib/coingecko.mjs`) with in-flight request deduplication, bounded caching, per-mint refresh cooldowns, and a 10-minute stale fallback ceiling (`STALE_UPSTREAM_DATA` suppresses `ALLOW` if cached fallback data exceeds 10 minutes):
- `GET /onchain/networks/solana/tokens/{mint}/info`: retrieves token metadata, holder count, CoinGecko GT composite safety score (`gt_score`), `gt_verified`, tri-state `is_honeypot` (`flagged`, `clean`, or `unknown`), and primary top-10 holder concentration (`holders.distribution_percentage.top_10`).
- `GET /onchain/networks/solana/tokens/{mint}/pools?page=1`: aggregates active Solana DEX pools (Raydium, Orca, Meteora, PumpSwap) to compute top-5 pool liquidity depth, deepest single-pool reserve, and 24-hour volume.
- `GET /onchain/networks/solana/tokens/{mint}/top_holders`: provides top holder rows and acts as the fallback source for top-10 concentration when `/info` omits `distribution_percentage.top_10`.
- `GET /onchain/networks/solana/pools/{pool_address}/trades`: reads recent buy and sell flow on the deepest pool for provenance diagnostics (not counted as a pass/block rule).
Without CoinGecko On-Chain API, Solana RPC can check account authority flags and Jupiter can quote one swap route, but neither supplies cross-DEX pool liquidity depth, holder concentration, or GT safety scoring.
Data by [CoinGecko API](https://www.coingecko.com/en/api).
## How Solana is used
Every audit queries live Solana Mainnet state and routing (`lib/solana.mjs`):
- Solana Mainnet RPC `getAccountInfo(mint, { encoding: "jsonParsed" })` (with automatic failover between `api.mainnet-beta.solana.com` and `solana-rpc.publicnode.com`) reads the on-chain SPL Token or Token-2022 mint account to verify that `mintAuthority`, `freezeAuthority`, and Token-2022 `permanentDelegate` are absent.
- Jupiter Swap v1 Quote (`https://lite-api.jup.ag/swap/v1/quote`) quotes USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) into the target mint at the exact requested atomic amount to measure live executable price impact in basis points and hop-by-hop AMM route labels. Non-USDC `inputMint` values and out-of-range amounts (`< $1`, `> $10,000,000`, or more than 6 decimals) are rejected instead of clamped.
- Solana Agent Kit pre-sign middleware (`lib/solanaAgentAdapter.mjs`) exposes `assertSafeBeforeSign({ outputMint, amountUsd, policy })`, which blocks unless `verdict === "ALLOW"` and the HMAC-SHA256 receipt passes signature, TTL, `policyHash`, and trade-intent verification.
## MCP Tools
| Tool | Purpose |
| :--- | :--- |
| `audit_solana_trade` | Runs the 6-rule pre-sign audit (`outputMint`, `amountUsd`, USDC `inputMint`, optional `policy`). Returns `verdict` (`ALLOW` / `WARN` / `BLOCK`), `canSign`, estimated `maxSafeOrderUsd`, per-rule evidence, and an HMAC-SHA256 signed receipt. |
| `check_token_safety` | Returns Solana RPC `mintAuthority`/`freezeAuthority` status alongside CoinGecko GT safety score, `gtVerified`, tri-state `honeypotStatus`, and top-10 holder concentration. |
| `verify_pool_depth_and_impact` | Computes CoinGecko top-5 pool reserves, deepest pool ratio, and live Jupiter Swap v1 price impact for a USDC order size. |
| `verify_policy_receipt` | Verifies the HMAC-SHA256 signature (`crypto.timingSafeEqual`) and 5-minute TTL (`valid`), and returns `authorizedToSign` (`true` only when `verdict === "ALLOW"` and optional `expected` bindings for `policyHash`, `outputMint`, and `amountUsd` match). |
## Receipt verification and signing authorization
Signature validity and signing authorization are separate fields:
- `valid: true` confirms the receipt was signed by SlipSentry and has not expired. A `BLOCK` or `WARN` receipt still returns `valid: true` so audit logs can prove a rejection was authentic.
- `authorizedToSign: true` is returned only when `valid === true`, `verdict === "ALLOW"`, and every caller-supplied `expected` field (`expectedPolicyHash`, `expectedChain`, `expectedInputMint`, `expectedOutputMint`, `expectedAmountUsd`) matches the receipt payload.
Signing daemons must require both `valid === true` and `authorizedToSign === true`, and verify `policyHash` against their own trusted policy configuration (`getPolicyHash(policy)`).
## Quickstart for Autonomous Agents
### 1. Call the live Streamable HTTP MCP endpoint
```bash
curl -sS -X POST https://slipsentry.thecode.blog/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "audit_solana_trade",
"arguments": {
"outputMint": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"amountUsd": 100000
}
}
}'
```
### 2. Connect Claude Desktop or Cursor via local `stdio` MCP
```json
{
"mcpServers": {
"slipsentry": {
"command": "node",
"args": ["/absolute/path/to/slipsentry-mcp/bin/slipsentry-mcp.mjs"],
"env": {
"COINGECKO_API_KEY": "your_coingecko_api_key",
"COINGECKO_TIER": "pro"
}
}
}
}
```
### 3. Gate a Solana Agent Kit or JavaScript bot before signing
```js
import { assertSafeBeforeSign } from './lib/solanaAgentAdapter.mjs';
// Throws SLIPSENTRY_BLOCKED if verdict !== 'ALLOW', or SLIPSENTRY_RECEIPT_REJECTED if policyHash/intent verification fails
const signedReceipt = await assertSafeBeforeSign({
outputMint: 'EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm',
amountUsd: 1000,
});
```
## Local Setup
Requirements: Node.js 22+ and a CoinGecko API key (`COINGECKO_TIER=pro` for Analyst/Pro keys or `demo` for Demo keys).
```bash
git clone https://github.com/ByKite/slipsentry-mcp.git
cd slipsentry-mcp
cp .env.example .env
# Edit .env and set COINGECKO_API_KEY and SLIPSENTRY_SIGNING_SECRET
npm install
```
Run the API and Streamable HTTP MCP server (`http://127.0.0.1:8445`):
```bash
npm run dev:server
```
In a second terminal, run the Vite console (`http://127.0.0.1:5175`, proxies `/api` and `/mcp` to port `8445`):
```bash
npm run dev:web
```
Or run the standalone `stdio` MCP server directly:
```bash
npm run mcp:stdio
```
## Checks & Tests
```bash
npm run check
npm test
```
The test suite verifies input validation, deterministic policy verdicts, separation of `valid` and `authorizedToSign`, tri-state `is_honeypot` handling, 10-minute stale cache rejection, unrounded pool-depth comparison, MCP `2025-03-26` HTTP behavior (`GET /mcp -> 405`, notification batch `202`, `Origin` check), a `stdio` subprocess roundtrip (`tools/list` and `tools/call`), `assertSafeBeforeSign`, and live mainnet calls for `WIF` and `TRUMP`.
## Limitations
- SlipSentry audits trade intent and issues signed receipts. It does not hold private keys, parse or bind raw serialized Solana transaction bytes, or broadcast transactions on-chain. Binding the final serialized transaction message on the signer side is the next production step.
- Only USDC-denominated buys (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) are quoted in this release; other `inputMint` addresses return a parameter error.
- `maxSafeOrderUsd` is an analytical estimate derived from current deepest-pool reserves and single-point quote impact. If an agent reduces its order size, it must run a fresh `audit_solana_trade` call before signing.
- On Solana SPL tokens, CoinGecko commonly returns `is_honeypot: "unknown"`. SlipSentry keeps all three states (`flagged`, `clean`, `unknown`): unverified tokens with `unknown` status produce `WARN` (`HONEYPOT_UNVERIFIED`), while CoinGecko `gt_verified` tokens pass Rule 6 with on-chain mint and freeze authorities checked separately in Rule 1.
- Top-10 holder percentages and GT safety scores reflect CoinGecko upstream refresh intervals. Public `/mcp` and `/api/audit` routes enforce per-IP rate limiting, a concurrency cap, and browser `Origin` checks while permitting headless MCP clients with no `Origin` header.
- Receipt verification requires `SLIPSENTRY_SIGNING_SECRET` to stay consistent across restarts; when unset, the server creates an ephemeral per-process secret (`signingMode: "ephemeral"`).
## License
MIT. See [LICENSE](LICENSE).
TDQS
Scored across 4 tools
audit_solana_trade is a composite that bundles the checks performed by check_token_safety (authorities, holders, GT score) and verify_pool_depth_and_impact (pool depth, price impact), so an agent may be unsure when to run the granular tools versus the one-shot audit. verify_policy_receipt is clearly distinct as the post-hoc receipt verifier. The descriptions do signal that the audit is the end-to-end path, which mitigates most confusion.
All four names are snake_case and follow a verb_noun structure (audit_/check_/verify_/verify_). Minor deviation: three different near-synonym verbs (audit, check, verify) are used for closely related inspection actions, and one name is a long conjunction (verify_pool_depth_and_impact). Still readable and predictable.
Four tools is well-scoped for a narrow pre-sign Solana trade safety service: one composite audit, two granular checks, and one receipt verifier. Each tool earns its place and there is no filler.
The surface covers the core lifecycle of assess -> sign -> verify receipt, with both coarse and granular inspection. Gaps: audits are only defined for buys (no sell/exit-side audit) and there is no tool to list, fetch, or refresh an existing receipt beyond signature/TTL verification, which agents must work around by re-running the audit.