Skip to main content
Glama
B20 Stock Sentinel MCP Server

B20 Stock Sentinel MCP Server

B20 Stock Sentinel

A read-only Base research terminal for agents that need to answer two different questions. How many shares does an account represent? What dollar reference value does the issuer publish for its tokens? A TypeScript integer engine powers a stdio MCP server, a CLI and a React terminal.

Read-only research & agent guardrail tool only; Coinbase B20 tokenized stocks are available only to eligible non-US jurisdictions; no trading execution or custody

Open the offline terminal

After extracting the handoff ZIP, open dist/offline.html directly in a current browser. Data, JavaScript, fonts, styles and licenses are embedded. The first screen shows that one SNDKc represents eight shares. Select Reconcile SNDKc to compare $100 and $800 at a simulated $100 per share. Switch Price basis to the issuer’s token NAV. Both columns then show the same official value. Check SNDKc policy opens the guard for that position. The 54-second screen recording is in docs/demo_b20_sentinel_1080p.mp4.

For a local development or MCP installation, use Node 24.14 or newer and its npm. The offline installer targets macOS arm64 and Linux x64. The acceptance receipt identifies the platform actually tested. Other platforms can use the public registry and the lockfile.

node scripts/install-offline.mjs
npm test
npm run build
npm run preview

Open the loopback URL printed by the server. Read live fetches Coinbase from the local server. Wallet lookups require an explicit public address. The backend forwards public reads to the Base endpoints. When opening the HTML directly, Live setup shows the local server commands. The frozen replay and exports work offline. Online installation uses npm ci in place of the bundled installer. A source-only checkout can run npm run dev.

Related MCP server: bactory-mcp

Frozen evidence

The Coinbase collection finished at 2026-12-02 02:24:38 UTC. The four original endpoint responses were collected at 02:23:40 UTC. Following four additional stock-page cursors produced the full catalogue. Each response has its own UTC collection time, URL, response-body SHA-256 and exact UTF-8 body in data/b20_snapshot_20261202.json. Its detached SHA-256 is 425974f37484bbdc2f89ccaffc0cb233e7637018b8475e072fe2cef748b32388. The loader verifies the complete file and each original body. The pages span a collection interval. RPC calls within an individual inspection share one verified block number.

Frozen scope

Records

Positive supply

API NAV

Mapped feed

Multiplier ≠ 1

Linked primary filing

Original first page

100

100

10

10

8

99

All five pages

435

173

13

13

13

433

The issuer feed directory contained 14 mappings overall. Only 13 matched a listed contract by address. Primary filings match on ticker and underlying ISIN. The guard checks the issuer's ADGM identifier for the AE prefix and ISIN check digit. It also checks first mint, positive supply, reported pauses and the three Base registry addresses. The documents field links to the published ADGM PDF. The date and identity of a catalogue entry do not establish a holder's eligibility. Coinbase API documentation

Getting the units right

Input price basis

Exact dollar calculation

SNDKc for one token

Coinbase API NAV or Chainlink token feed

Normalized token balance × USD per token

Both models return $725.37839688 in the freeze

Explicit local share price

Normalized token balance × multiplier × USD per underlying share

At a simulated $100/share, naive $100 and corrected $800

Missing API NAV

Dollar values remain null

PMc retains its share conversion without a dollar quote

A raw balance is an unsigned ERC-20 integer. Divide it by 10 to the power of the token's decimals to obtain token quantity. Multiplying it by the WAD multiplier and flooring to the token's atomic precision reproduces the UI balance. Dollar scenarios retain the full rational product through the final conversion. The issuer's NAV and the Chainlink feed both include the multiplier. Comparing the two checks two delivery paths for the same reference. Base integration guide · Chainlink feed methodology

mispricing_delta_usd is corrected minus naive USD. mispricing_bps divides that difference by corrected value, then multiplies by 10,000. A zero denominator yields null. Positive values indicate understatement. The distinct policy metric multiplier_drift_bps is the absolute distance of the multiplier from 1, multiplied by 10,000. SNDKc has a 70,000 bps drift and an 87.50% single-share unit error. PMc's 1.558821201905387 multiplier produces a 35.85% unit error in the same scenario.

Financial calculations use BigInt. JSON numeric lexemes survive parsing without a binary64 conversion. The price parser accepts up to 18 fractional places and rejects excess precision. Monetary outputs round once to at most 18 places, basis points to six places and displayed percentages to two. Risk thresholds compare unrounded integer products. In live checks, the contract's WAD is authoritative. The report retains both values and distinguishes one relative binary64 epsilon of REST precision from a material API/onchain discrepancy.

Agent policy

The guard accepts a ticker or verified contract address, a raw unit string, a drift ceiling in bps, a maximum NAV age in minutes, a decimal USD position limit, a prospectus requirement and a pause override. BLOCK takes precedence over WARN, then ALLOW. The payload carries distinct reason codes, corrected shares, effective multiplier, clock, source, filing and registry evidence. Every verdict is a local policy result. The terminal keeps the current balance, scenario and policy inputs while switching views in the same session. Restore default limits and checks resets only the policy controls. Opening a fresh session starts with the defaults.

Condition

Policy result

Missing or invalid NAV, timestamp in the future, clock behind last observation, invalid multiplier

BLOCK

Age over the configured limit, including after-hours observations

BLOCK

Failed or invalid mapped oracle, stale round, nonpositive price, incomplete round or >100 bps feed gap by default

BLOCK

Quantity-adjusted position or multiplier drift above its inclusive limit

BLOCK

Reported pause

BLOCK by default, WARN with explicit pause override

Primary filing or ADGM ID missing

BLOCK when required, otherwise WARN

Nonpositive supply, unconfirmed first mint, missing Base registry or material multiplier disagreement

BLOCK

Healthy token and reference but no mapped feed

WARN when the remaining checks pass

Requested live data fell back to the frozen catalogue

BLOCK

Age states include FRESH, STALE_AFTER_HOURS, STALE_CRITICAL, MISSING_API_NAV and CHAINLINK_DIVERGENCE. After-hours labelling uses New York weekdays and 09:30–16:00 regular hours with timezone/DST conversion. An expired value outside that window can receive the after-hours label up to 72 hours old. Older observations or expired regular-session values are critical. This descriptive rule has no exchange-holiday calendar. Every age breach blocks. A later critical fault can supersede the primary state while all findings remain in the reasons array.

Frozen mode evaluates at capture time for reproducible historical replay. Live mode uses current UTC and a clock high-water mark. Live catalogue export checks every priced or mapped token against its contract, and includes blocked unpriced rows with explicit unavailable fields. The web and CLI can produce both formats from one evaluation clock.

CLI and stdio MCP

node cli/index.ts audit --snapshot --ticker SNDKc --raw 100000000
node cli/index.ts audit --ticker PMc --raw 100000000 --share-price 100
node cli/index.ts guard --ticker SNDKc --policy '{"maxMultiplierDriftBps":70000}'
node cli/index.ts export --format json > reconciliation.json
node cli/index.ts export --format csv > reconciliation.csv
node cli/index.ts export --live --format both > paired-reconciliation.json
node cli/index.ts network --live --network base-sepolia
node mcp/index.ts --snapshot

For an MCP host set the command to node, set its working directory to the extracted repository and use arguments mcp/index.ts and --snapshot or --live. A host without a working-directory option can use the locally resolved script path. When a client sanitizes its subprocess environment and your network relies on a proxy, pass through your existing HTTP(S) proxy and bypass environment settings. The live smoke client in scripts/mcp-live-proof.mjs demonstrates the allowlisted passthrough.

MCP tool

Output

b20_list_stocks

Scope counts, cursor offset, captured-at and address-identified rows

b20_audit_multiplier_drift

Corrected shares, price basis, naive and reference values, gap

b20_check_nav_freshness

API clock, oracle status, round and divergence

b20_evaluate_agent_guard

Structured policy decision and evidence

b20_inspect_wallet_exposure

Selected-token public balance, UI balance, supply and block, or unknown

b20_probe_network

Verified chain ID and block for Base or Base Sepolia

Tool calls use standard MCP initialization and newline-framed JSON-RPC over stdio. The server returns JSON as structured content and text. All tools declare read-only annotations. Unknown or ambiguous instruments and malformed inputs report errors.

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"b20_evaluate_agent_guard","arguments":{"ticker":"SNDKc","rawBalanceUnits":"100000000","maxMultiplierDriftBps":100,"maxNavAgeMinutes":60,"maxPositionUsd":"10000","requireProspectus":true,"allowPaused":false}}}

CSV columns use decimal strings with no locale formatting. Unquoted empty fields represent JSON null, quoted empty fields represent an empty string. Exports include the effective policy and clock. For an identical live pair, use --format both or the web export buttons on one capture. Independent live fetches can see different rounds.

To freeze another collection in a new file, redirect node cli/index.ts snapshot --live and generate the adjacent .sha256 with shasum -a 256. Pass the new file through --file. An incomplete live capture exits with an error.

RPC evidence and acceptance

At Base mainnet block 64,943,698, the Uniswap v4 PoolManager held 15.62881306 SNDKc. Its onchain UI balance was 125.03050448 shares with an 8× multiplier. The raw and UI calls, total supply, multiplier, oracle decimals and round all used the same block. A second sample used the issuer-published factory and recorded a genuine zero. The public account is a protocol contract. Account attribution · Pinned read receipt

The public RPC adapter checks chain ID, pins a block, limits each attempt and falls through to the second mainnet endpoint. It supports the canonical scaled balance alias when the UI method is unsupported. Malformed responses and failed reads return an unavailable result. The issuer's registry supplies mainnet token addresses. Sepolia is independently probed for chain ID and block. The code requires a verified registry before inspecting an instrument on that network.

  • verification/qa_20261202.json covers the four Chromium sizes, first-screen controls, filtered instrument selection, single-tab-stop matrix navigation, cross-view policy and export consistency, offline double-click, timeout fallback and an unavailable wallet scenario.

  • verification/mcp-live.json and verification/browser-live.json record the live entry points. Run node scripts/browser-live.mjs to repeat the optional public API, wallet, feed and export checks with a network connection. verification/public-endpoints.json contains the exact metadata and normalized-supply response for SNDKc.

  • npm test exercises deterministic boundaries, CLI commands and a real MCP client/server subprocess. npm run verify:browser runs against the production build and local Chrome/Chromium. Use CHROME_PATH for another installed Chromium executable.

  • npm run demo records the English-captioned operation of Chromium. The capture uses separate 1920 × 960 browser and 1920 × 120 caption inputs. Re-recording requires local FFmpeg, ffprobe and Python 3. Run python3 scripts/check-demo.py to compare all 1,296 encoded frames with the clean source references. npm audit and npm audit --omit=dev query the public advisory service.

  • scripts/check-release.py verifies a release ZIP in an empty temporary directory. Its receipt includes manifests, offline installation, tests, a production rebuild, browser checks, dependency audits and privacy inspection.

Original code is MIT-licensed. Distribution notices accompany the build. License · Third-party notices

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Provides AI assistants with live Base market data and Chainlink oracle freshness, and simulates AgentGuard checks so users can analyze markets and verify whether proposed treasury actions would execute.
      12
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local, offline, read-only stdio server that enables inspection of stablecoin identity, wallet state, source lineage, evidence conflicts, and vault-readiness signals through six tools and six static resources.
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes nineteen tools, three resources and a wallet-checkup prompt over stdio so an AI assistant can run strict deployment verification, read protocol and account state at pinned blocks, inspect wallets and deposited NFTs, and prepare unsigned claim/merge bundles. It works read-only against Sepolia via the shared SDK, never accepting keys, signing, broadcasting or calling arbitrary RPC methods.
      1
      MIT