Skip to main content
Glama
kushal613

pegcheck

by kushal613

pegcheck-mcp

Ein schreibgeschützter MCP-Server, der prüft, ob ein Robinhood Chain Stock Token derzeit zu einem fairen Preis im Vergleich zur realen Aktie, die es repräsentiert, gehandelt wird – entwickelt, um von einem KI-Agenten direkt vor einem Trade aufgerufen zu werden, nicht um von einem Menschen von einem Dashboard abgelesen zu werden.

✅ Verdict: FAIR (deviation: 0.11%)

Das Problem

Die Stock Tokens von Robinhood Chain sind selbst verwahrbare ERC-20-Token, die reale Aktien abbilden und rund um die Uhr an Onchain-DEXs gehandelt werden. Reale Aktienmärkte sind nur etwa 6,5 Stunden am Tag, 5 Tage die Woche geöffnet. Außerhalb dieser Zeiten gibt es keinen aktiven Markt, um den Token-Preis wieder auf den fairen Wert zu arbitrieren, sodass er abweichen kann.

Ein KI-Agent, der diese Token direkt onchain handelt – einen Wallet-Schlüssel besitzt und gegen einen DEX-Pool tauscht – hat keine eingebaute Möglichkeit zu wissen, ob der Preis, den er gleich zahlen wird, vertrauenswürdig ist. Jedes bestehende Tool, das diese Lücke aufzeigt (Dashboards, Telegram-Alert-Bots, Trading-Terminals), ist für einen Menschen zum Anschauen gebaut. Keines davon ist dafür gebaut, von einem Agenten mitten in einer Entscheidung aufgerufen zu werden.

Related MCP server: rhc-mcp

Die Lösung

Ein fokussiertes MCP-Tool: check_stock_token_price.

Gib ihm ein Tickersymbol. Es liefert ein strukturiertes, sitzungsbewusstes Urteil, auf das ein Agent reagieren kann – bevor er einen Trade signiert, egal ob dieser Trade über Robinhoods eigenes Trading-MCP oder direkt gegen einen Onchain-DEX läuft.

{
  "symbol": "AAPL",
  "onchain": { "priceUsd": 310.32, "method": "liquidity-weighted-average", "poolsUsed": 10 },
  "reference": { "tokenEquivalentPriceUsd": 309.99, "isTradingHalt": false },
  "deviation": { "pct": 0.11, "direction": "premium" },
  "marketSession": { "state": "weekend" },
  "verdict": "fair",
  "warnings": []
}

Dieser Server ist schreibgeschützt. Er hält niemals einen privaten Schlüssel, signiert niemals eine Transaktion und platziert niemals einen Trade.

So funktioniert es

Zwei unabhängige Datenquellen, verglichen:

  1. Onchain-Preis – jeder indexierte Robinhood-Chain-Pool für den Token, von DexScreeners öffentlicher API, gefiltert auf Pools, die in einem stabilen Referenz-Asset (USDG/USDC) notiert sind und mindestens 500 $ Liquidität haben, kombiniert zu einem liquiditätsgewichteten Durchschnitt (so dominiert ein tiefer Pool über mehrere flache, verrauschte). Fällt auf den einzelnen tiefsten Pool zurück – als geringe Konfidenz markiert – wenn nichts den Filter besteht.

  2. Referenzpreis – Robinhoods eigene öffentliche Stock Token API (/rhj/prices/{symbol}), die das rohe Bid/Ask des zugrunde liegenden Basiswerts meldet. Dieser wird mit dem aktuellen ERC-8056 multiplier (von /rhj/assets) skaliert, um den token-äquivalenten fairen Preis zu erhalten, da Dividenden in den Multiplikator reinvestiert werden, anstatt in bar ausgezahlt zu werden.

Die Abweichung zwischen den beiden wird mit einer Schwellwerttabelle verglichen, die von der aktuellen US-Marktsitzung abhängt (regular, pre-market, after-hours, weekend, holiday, closed), die lokal ohne externe Abhängigkeit berechnet wird – eine Abweichung von 2 % an einem Samstagabend ist zu erwarten; dieselbe Abweichung um 11 Uhr an einem Dienstag nicht. Die Sitzungserkennung umfasst einen vollständigen NYSE-Feiertagskalender, der algorithmisch berechnet wird (n-ter-Wochentag-im-Monat-Regeln, eine Osterberechnung für Karfreitag und die übliche Verschiebung bei Wochenendfeiertagen) und nicht von einer externen API abgerufen wird, sodass er für jedes Jahr ohne Netzwerkabhängigkeit, ohne API-Schlüssel und ohne statische Datei, die veralten könnte, funktioniert. Verifiziert gegen den offiziell veröffentlichten NYSE-Kalender 2026–2028 in test/nyseHolidays.test.ts. Siehe src/config.ts für die genauen Schwellwerte und src/nyseHolidays.ts für die Feiertagsregeln.

Installation & Ausführung

git clone https://github.com/kushal613/pegcheck-mcp.git
cd pegcheck-mcp
npm install
npm run build

Keine API-Schlüssel, keine .env-Datei, keine Wallet – jede verwendete Datenquelle ist eine kostenlose, öffentliche, schlüssellose API.

Teste es vom Terminal aus

npm run check -- AAPL
npm run check -- TSLA

Verbinde es mit einem MCP-Client

Claude Desktop / Claude Code (claude_desktop_config.json oder .mcp.json):

{
  "mcpServers": {
    "pegcheck": {
      "command": "node",
      "args": ["/absolute/path/to/pegcheck-mcp/dist/index.js"]
    }
  }
}

Cursor (.cursor/mcp.json): gleiche Struktur wie oben.

Sobald verbunden, frag deinen Agenten: „Bevor du ein TSLA-Aktien-Token kaufst, prüfe pegcheck, um zu sehen, ob der Preis gerade fair ist."

Tool-Referenz

check_stock_token_price

Feld

Typ

Beschreibung

symbol (Eingabe)

string

Ticker, z. B. "AAPL".

onchain.priceUsd

number | null

Liquiditätsgewichteter Onchain-Preis.

onchain.method

string

liquidity-weighted-average, deepest-pool (geringe Konfidenz) oder none.

reference.tokenEquivalentPriceUsd

number | null

Mittelkurs der realen Aktie, skaliert mit dem Corporate-Action-Multiplikator.

deviation.pct

number | null

Vorzeichenbehaftete %-Abweichung, Onchain vs. Referenz.

marketSession.state

string

regular | pre-market | after-hours | weekend | holiday | closed.

marketSession.holidayName

string | null

z. B. "Thanksgiving Day", wenn state "holiday" ist.

verdict

string

fair | caution | unreliable | no_liquidity | unknown_symbol.

warnings

string[]

Für Menschen lesbare Warnhinweise (veraltetes Kursangebot, Handelsstopp, Pool mit geringer Konfidenz usw.).

Architektur

src/
  config.ts        Every tunable threshold, in one place
  types.ts         Shared types for the whole pipeline
  http.ts          Fetch wrapper with timeout + consistent errors
  robinhoodApi.ts  Reference leg: /rhj/assets + /rhj/prices (Robinhood's own APIs)
  dexscreener.ts   Onchain leg: liquidity-weighted price across Robinhood Chain pools
  marketSession.ts Local US-market-session calculation (no external dependency)
  nyseHolidays.ts  Algorithmic NYSE holiday calendar (no external dependency)
  pegCheck.ts       Combines both legs into one PegCheckResult
  server.ts        MCP tool registration
  index.ts         stdio entrypoint
  cli.ts           Standalone terminal usage (no MCP client needed)
scripts/
  smoke-test.mjs   End-to-end MCP protocol handshake test (initialize -> tools/list -> tools/call)

Bekannte Einschränkungen (v0.1)

  • Keine Behandlung von frühen Handelsschlüssen. Die 13:00-Uhr-Schlüsse der NYSE (Tag nach Thanksgiving, Heiligabend an einem Wochentag) werden nicht als eigene Sitzung modelliert – diese Nachmittage melden weiterhin after-hours/closed einige Stunden später als der tatsächliche frühe Schluss. Ganztägige Feiertagsschließungen sind vollständig abgedeckt.

  • Keine venuespezifische Slippage-Schätzung. Dies meldet den aggregierten liquiditätsgewichteten Preis, nicht „was würde mein 500-$-Trade gegen diesen spezifischen Pool kosten." Das ist eine bewusste v0.1-Umfangsgrenze (ein natürliches v0.2: ein advanced-Modus, der eine Handelsgröße und einen bestimmten Pool/Venue annimmt und die Preisauswirkung schätzt).

  • Abhängigkeit von der DexScreener-Abdeckung. Wenn DexScreener einen sehr neuen Pool noch nicht indexiert hat, wird onchain.method "none" sein und das Urteil no_liquidity lauten. Das ist ein „lautes Scheitern", keine stille falsche Antwort.

  • Kein Ersatz für Due Diligence. Siehe den Haftungsausschluss unten.

Haftungsausschluss

Dieses Projekt ist nicht mit Robinhood verbunden oder von Robinhood unterstützt. Es ist ein unabhängiges, informatives Tool. Daten stammen aus Robinhoods öffentlichen APIs und DexScreeners öffentlicher API und können verzögert, unvollständig oder ungenau sein. Nichts hier ist eine Finanzberatung. Dieser Server kann keine Trades platzieren und hält keine Gelder oder Schlüssel.

Lizenz

MIT – siehe LICENSE.

Available Tools

1 tool
check_stock_token_priceA

Checks whether a Robinhood Chain Stock Token's current onchain trading price is consistent with its real-world reference stock price. Combines a liquidity-weighted average of the token's onchain DEX pools with Robinhood's own live reference quote (adjusted for the token's corporate-action multiplier), and returns a session-aware fairness verdict ('fair' | 'caution' | 'unreliable' | 'no_liquidity' | 'unknown_symbol') plus the deviation percentage and supporting data. Call this BEFORE executing a trade of a Stock Token, whether through Robinhood's own Trading MCP or directly against an onchain DEX, to avoid trading at a price that has drifted from fair value -- which is most likely to happen outside regular US market hours. Read-only: this tool never places, modifies, or signs any trade.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesThe Stock Token ticker symbol, e.g. "AAPL", "TSLA", "NVDA".

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states 'Read-only: this tool never places, modifies, or signs any trade,' which is a critical safety trait. It also discloses the algorithm (combining onchain DEX pools with a live reference quote) and the return format (session-aware verdict plus deviation percentage and supporting data), going beyond minimal requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise yet comprehensive, front-loading the core purpose before moving to method, usage guidance, and safety note. Every sentence serves a purpose: the first defines the check, the second explains the mechanism and output, the third gives explicit usage context, and the fourth declares read-only behavior. No filler or redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a single parameter and no output schema, so the description must explain both input context and expected output. It does so by describing the verdict options ('fair' | 'caution' | 'unreliable' | 'no_liquidity' | 'unknown_symbol'), the deviation percentage, and the session-aware nature. It also covers when to use it, fulfilling the informational needs for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already has 100% description coverage for the single parameter 'symbol' with examples. The tool description does not add new semantic meaning to the parameter itself; it explains the tool's purpose but not additional nuances like format constraints or edge cases. The baseline of 3 is appropriate since the parameter is fully documented in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a very specific verb+resource: it checks whether a Robinhood Chain Stock Token's onchain trading price is consistent with its real-world reference stock price. It also details the method (liquidity-weighted average of DEX pools combined with Robinhood's live quote) and the output (a fairness verdict and deviation percentage), leaving no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to call this BEFORE executing a trade of a Stock Token, whether via Robinhood's Trading MCP or directly against a DEX, to avoid trading at a price that has drifted from fair value. It also notes this is most likely outside regular US market hours. It does not provide explicit when-not-to-use or alternatives, but since there are no sibling tools, this is acceptable; a 4 reflects clear context without exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev0.1.0
    • First observedcheck_stock_token_price

TDQS

A4.5/5.0

Scored across 1 tool

Disambiguation5/5

With only a single tool, there is no possibility of confusion or overlap. The tool's purpose is clearly distinct from anything else, meeting the 'clearly distinct purpose' criterion perfectly.

Naming Consistency5/5

The tool name 'check_stock_token_price' follows a clean verb_noun pattern, and with only one tool there is no inconsistency. The name accurately describes the action and object.

Tool Count3/5

A single tool feels thin for most servers, but here the scope is narrowly defined around one specific check. It is borderline acceptable but on the low end of the typical range, making it a 3 per calibration guidelines.

Completeness5/5

The tool fully addresses its stated purpose—checking price fairness before trading. It provides a verdict, deviation percentage, and supporting data, with no obvious missing operations for that specific task. It is not a CRUD domain, so the completeness is judged against the narrow mission.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    Enables AI agents to interact with Robinhood Chain via USDG payments, offering tools for balance, pricing, trading, and more.
    18
    58
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to read Robinhood Chain stock-token positions, quote swaps, and execute swaps through the Model Context Protocol, bridging on-chain assets that Robinhood's own off-chain MCP cannot reach.
    4
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to trade tokenized stocks (e.g., NVDA, TSLA) on Robinhood Chain via MCP, with non-custodial keys and spending caps.
    7 npm
    MIT