@panoptic-eng/mcp 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,8 +22,8 @@ its MCP settings, etc.).
22
22
  "command": "npx",
23
23
  "args": ["-y", "@panoptic-eng/mcp"],
24
24
  "env": {
25
- "PANOPTIC_RPC_URL": "https://mainnet.base.org",
26
- "PANOPTIC_CHAIN_ID": "8453",
25
+ "PANOPTIC_RPC_URL": "https://eth-mainnet.g.alchemy.com/v2/<key>",
26
+ "PANOPTIC_CHAIN_ID": "1",
27
27
  // optional — enables enhanced analytics tools
28
28
  "PANOPTIC_SUBGRAPH_URL": ""
29
29
  }
@@ -35,15 +35,20 @@ its MCP settings, etc.).
35
35
  Configuration may also be passed as CLI flags, which override the env vars:
36
36
 
37
37
  ```bash
38
- npx @panoptic-eng/mcp --rpc-url https://mainnet.base.org --chain-id 8453
38
+ npx @panoptic-eng/mcp --rpc-url https://eth-mainnet.g.alchemy.com/v2/<key> --chain-id 1
39
39
  ```
40
40
 
41
- Supported chains: Ethereum mainnet (`1`), Base (`8453`), Sepolia (`11155111`).
41
+ Supported chains: Ethereum mainnet (`1`), Sepolia (`11155111`).
42
42
 
43
- ## v0 tools (read-only, pure RPC)
43
+ ## v0 tools (read-only)
44
+
45
+ All tools are read-only (they never build or send transactions). The one
46
+ exception to statelessness is `configure_session`, which mutates in-process
47
+ session preferences rather than reading the chain.
44
48
 
45
49
  | Tool | What it does |
46
50
  | --- | --- |
51
+ | `configure_session` | **Local session state — not an RPC read.** Set/read this session's preferences — notably the preferred delta reporting frame (`assetIndex`) — so delta tools don't re-ask which token to denominate net delta in. State lives in the server process for the session only. |
47
52
  | `list_pools` | Known pool deployment + live pool state (tokens, tick, trackers, health). |
48
53
  | `explain_position` | Decode a TokenId into readable legs + a strategy label (no RPC). |
49
54
  | `identify_address` | Map an address to its role in a Panoptic deployment. |
@@ -57,6 +62,10 @@ Supported chains: Ethereum mainnet (`1`), Base (`8453`), Sepolia (`11155111`).
57
62
  | `position_scenario` | Payoff / NLV curve — net liquidation value across a band of hypothetical prices. |
58
63
  | `hedge_params` | SDK-native delta-hedge parameters (`getDeltaHedgeParams`) to reach a target delta; whole-portfolio or single-position. |
59
64
  | `trade_history` | Chronological mints/burns from on-chain events (event-level only — no realized P&L). |
65
+ | `list_vaults` | Known HypoVault deployments: vaults, managers, accountant, underlying token, pool, trackers, and strategy labels. |
66
+ | `vault_summary` | Live HypoVault state: supply, manager/accountant, fees, epochs, reserved withdrawal assets, and current epoch totals. |
67
+ | `vault_account` | A user's HypoVault share balance, basis, queued deposit/withdrawal, redeposit flag, and executable epoch hints. |
68
+ | `vault_exposure` | Treat a HypoVault as the Panoptic account and return positions, collateral, greeks, and margin health. |
60
69
 
61
70
  `get_portfolio`, `account_health`, `suggest_delta_hedge`, `advise_position`,
62
71
  `preview_position`, `position_scenario`, and `hedge_params` discover positions
@@ -65,6 +74,18 @@ Pass `fromBlock` to bound the scan on chains with a distant deployment block.
65
74
  These account tools need an RPC that permits `eth_getLogs`; many free public
66
75
  endpoints throttle or block large log scans, so a private RPC is recommended.
67
76
 
77
+ An account's aggregate net delta is a single figure and must be denominated in
78
+ one token's units (its "reporting frame"). There is no canonical pool asset —
79
+ each position leg carries its own — so `suggest_delta_hedge` and `hedge_params`
80
+ (portfolio mode) resolve the frame as: explicit `assetIndex` argument → session
81
+ preference → **ask the user**. When neither is set they return a
82
+ `needs_asset_preference` prompt rather than silently guessing; call
83
+ `configure_session` with `assetIndex` to record the choice for the session.
84
+
85
+ HypoVault NAV/share-price reads are intentionally not exposed in v0 because
86
+ `totalAssets(bytes)` and `convertToAssets(uint256,bytes)` require
87
+ managerInput-aware accounting; use `vault_summary` for raw vault state.
88
+
68
89
  Build + simulate tools (`build_position`, `build_strategy`, `simulate_tx`, …)
69
90
  that return unsigned transaction envelopes are planned for a future release and
70
91
  are **not** shipped yet. All numeric on-chain quantities are serialized as
@@ -79,7 +100,7 @@ pnpm --filter @panoptic-eng/mcp typecheck # tsc --noEmit
79
100
  pnpm --filter @panoptic-eng/mcp lint
80
101
 
81
102
  # Inspect locally against a real RPC:
82
- PANOPTIC_RPC_URL=https://mainnet.base.org PANOPTIC_CHAIN_ID=8453 \
103
+ PANOPTIC_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/<key> PANOPTIC_CHAIN_ID=1 \
83
104
  npx @modelcontextprotocol/inspector node dist/cli.js
84
105
  ```
85
106
 
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { SERVER_VERSION, createContext, createServer, resolveConfig } from "./server--YF2LHqv.js";
2
+ import { SERVER_VERSION, createContext, createServer, resolveConfig } from "./server-CabyB7Fb.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
 
5
5
  //#region src/cli.ts
package/dist/index.d.ts CHANGED
@@ -4,14 +4,10 @@ import { Address, Hex, PublicClient } from "viem";
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
 
6
6
  //#region src/config.d.ts
7
- /** Chain ids Panoptic has deployments for (mainnet, Base, Sepolia). */
8
- /** Chain ids Panoptic has deployments for (mainnet, Base, Sepolia). */
9
- declare const KNOWN_CHAIN_IDS: readonly [1, 8453, 11155111];
7
+ declare const KNOWN_CHAIN_IDS: readonly [1, 11155111];
10
8
  /**
11
- * Resolve an optional user-supplied chain-id string to a trusted known-chain
12
- * constant, falling back to `fallback` when omitted/blank. Matches on canonical
13
- * decimal form only (never Number(), so "1e0" is rejected) and throws on
14
- * unsupported ids.
9
+ * Resolve an optional user-supplied chain-id string to a trusted, deployed
10
+ * known-chain constant, falling back to `fallback` when omitted/blank.
15
11
  */
16
12
 
17
13
  interface ServerConfig {
@@ -20,10 +16,25 @@ interface ServerConfig {
20
16
  /** Optional indexer URL; enables enhanced analytics tools. */
21
17
  subgraphUrl?: string;
22
18
  }
19
+ /**
20
+ * Mutable per-process session state. The stdio server runs for the lifetime of
21
+ * one agent session, so tools can record user preferences here (via
22
+ * `configure_session`) and later tools read them back. Nothing here is
23
+ * persisted across restarts.
24
+ */
25
+ interface SessionState {
26
+ /**
27
+ * The user's preferred delta reporting frame for this session (0n = token0,
28
+ * 1n = token1). When set, delta tools report net delta in this frame instead
29
+ * of asking. There is no canonical pool asset — this is a user choice.
30
+ */
31
+ preferredAssetIndex?: 0n | 1n;
32
+ }
23
33
  interface PanopticContext {
24
34
  config: ServerConfig;
25
35
  client: PublicClient;
26
36
  deployment: ChainDeployment;
37
+ session: SessionState;
27
38
  }
28
39
  /**
29
40
  * Resolve server config from CLI flags (`--rpc-url`, `--chain-id`,
@@ -33,9 +44,7 @@ interface PanopticContext {
33
44
  */
34
45
  declare function resolveConfig(argv: string[], env: NodeJS.ProcessEnv): ServerConfig;
35
46
  /** Create the shared context (viem client + resolved deployment) for tools. */
36
- declare function createContext(config: ServerConfig): Promise<PanopticContext>;
37
-
38
- //#endregion
47
+ declare function createContext(config: ServerConfig): Promise<PanopticContext>; //#endregion
39
48
  //#region src/serialize.d.ts
40
49
  /**
41
50
  * Recursively convert a value into a JSON-safe form. The only Panoptic-specific
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe } from "./server--YF2LHqv.js";
1
+ import { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe } from "./server-CabyB7Fb.js";
2
2
 
3
3
  export { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe };