@zypheragent/mcp 0.0.0-stage → 0.3.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -2
  3. package/dist/index.js +1247 -0
  4. package/package.json +50 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zypher Agent
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ # @zypheragent/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [Model Context Protocol](https://modelcontextprotocol.io) server of [Zypher Agent](https://zypheragent.com). It gives an AI assistant (Claude Desktop, Cursor, any MCP client) market and on-chain **reads**: Hyperliquid perp analytics, HyperSwap V3 quotes and token data on HyperEVM, and Boxa launch facts on Elysium 99901 (all mainnet).
4
+
5
+ **Read-only by default.** Without configuration it cannot trade: no order placement, no transaction building, no signing, no key handling. **Optional execution** (swap, perp order, close, send, transfer out) is only switched on if you set a `ZYPHER_API_TOKEN`, a per-user API token you create in the Zypher Agent app. Orders then run through *your own Agent Wallet* on the Zypher Agent server, inside the caps you set. This package never holds or sees any private key.
6
+
7
+ ## Run
8
+
9
+ ```sh
10
+ npx -y @zypheragent/mcp
11
+ ```
12
+
13
+ The server speaks MCP over stdio. It starts with no environment variables and no config file. Its ready line (`zypher-mcp <version> ready (stdio, read-only, ...)`, or `read + EXECUTION ...` when a token is set) goes to **stderr**; stdout is reserved for the MCP channel. Needs Node.js >= 20.
14
+
15
+ Binaries: `zypher-mcp` and `zypheragent-mcp` (same program).
16
+
17
+ ## Client configuration
18
+
19
+ Claude Desktop (`claude_desktop_config.json`):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "zypher-agent": { "command": "npx", "args": ["-y", "@zypheragent/mcp"] }
25
+ }
26
+ }
27
+ ```
28
+
29
+ Cursor (`~/.cursor/mcp.json` or `.cursor/mcp.json`):
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "zypher-agent": { "command": "npx", "args": ["-y", "@zypheragent/mcp"] }
35
+ }
36
+ }
37
+ ```
38
+
39
+ Generic stdio client, with optional environment:
40
+
41
+ ```json
42
+ {
43
+ "command": "npx",
44
+ "args": ["-y", "@zypheragent/mcp"],
45
+ "env": { "ZYPHER_NETWORK": "mainnet", "ZYPHER_ADDRESS": "0xYourPublicAddress" }
46
+ }
47
+ ```
48
+
49
+ ## Optional: execution through your Agent Wallet
50
+
51
+ 1. In the Zypher Agent app open **Agent > Wallet > API tokens** and create a token. It looks like `zat_` followed by 40 lowercase hex characters and is shown once.
52
+ 2. Put it in the client's MCP config (never in a repository):
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "zypher-agent": {
58
+ "command": "npx",
59
+ "args": ["-y", "@zypheragent/mcp"],
60
+ "env": { "ZYPHER_API_TOKEN": "zat_0123456789abcdef0123456789abcdef01234567" }
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ With a valid token the server registers six more tools (19 in total) and its ready line says `read + EXECUTION`. A malformed token prints a clear error on stderr and execution stays disabled; the 13 read tools keep working.
67
+
68
+ | Tool | What it does | Arguments |
69
+ | --- | --- | --- |
70
+ | `agent_status` | Your Agent Wallet: address, balances, positions, caps. Does not move funds. | none |
71
+ | `agent_swap` | Exact-in swap on HyperEVM from the Agent Wallet. | `tokenIn`, `tokenOut` (symbol or 0x address), `amountIn`, optional `slippageBps` |
72
+ | `agent_perp_order` | Open/add a Hyperliquid perp position. | `coin` (`BTC`, `xyz:NVDA`), `side` long\|short, `notionalUsd`, `leverage`, optional `tpPrice`, `slPrice`, `reduceOnly` |
73
+ | `agent_close` | Close a perp position (all or a percentage). | `coin`, optional `fractionPct` (0-100) |
74
+ | `agent_send` | Send funds from the Agent Wallet to an external 0x address. | `asset`, `amount`, `to` (0x address) |
75
+ | `agent_transfer_out` | Move funds from the Agent Wallet back to your own main wallet. | `asset`, `amount` |
76
+
77
+ **These tools move real funds on mainnet.** Every call executes immediately from your Agent Wallet, inside the caps set by you / the operator in the app. There is **no confirmation step** in the MCP, so the assistant is told to ask you first; do not auto-approve these tools in your client. No tool accepts a wallet, owner, URL or path argument: the package can only call the six fixed paths `/api/agent-api/{status,swap,perp-order,close,send,transfer-out}` under `ZYPHER_API_URL`.
78
+
79
+ Each write call carries a fresh random `Idempotency-Key`. Timeouts are 15 s (45 s for swaps); redirects are refused and responses over 100 KB are refused. After a timeout or a 5xx on a write, the outcome is unknown: call `agent_status` before retrying.
80
+
81
+ ## Tools (13 read tools, always on)
82
+
83
+ | Tool | What it does |
84
+ | --- | --- |
85
+ | `get_policy` | Shows this server's fixed read-only policy (network, no trading, no keys). |
86
+ | `analyze_ticker` | Hyperliquid perp analysis for any listed market, crypto or trade.xyz stocks/indices/metals (`BTC`, `xyz:NVDA`, or the bare symbol `NVDA`): price, 24h volume, open interest, funding, orderbook depth. |
87
+ | `get_strong_volume` | Perp tickers with the highest 24h volume, with volume/OI ratio and price change. |
88
+ | `get_new_pairs` | **Not available.** Needs an indexer that is not part of this package; always returns an explicit "not available" error. |
89
+ | `analyze_token_health` | Bytecode/ABI check of a token contract (mint, pause, blacklist, owner) with a score and reasons. A heuristic, not an audit. |
90
+ | `get_social_info` | Recent tweets about a ticker. Needs your own `X_BEARER_TOKEN`; without it the tool returns a clear error. |
91
+ | `get_portfolio` | Public balances/positions of an address: Hyperliquid account, native HYPE on HyperEVM mainnet and on Elysium 99901. |
92
+ | `get_market_tokens` | HyperEVM mainnet tokens (HyperSwap V3, a verified list): USD price from the deepest sane pool, TVL, pool health. No 24h change. Not every token on the chain. |
93
+ | `quote_swap` | Exact-in swap quote on HyperSwap V3 (HyperEVM mainnet): output, route, price impact; sane pools only. Quote only; nothing is built or sent. |
94
+ | `get_perp_markets` | All Hyperliquid perp markets (own dex, about 179, plus trade.xyz stocks, indices and metals as `xyz:NVDA`, about 120): price, 24h change, volume, open interest, funding, max leverage. |
95
+ | `get_candles` | Hyperliquid candles: summary statistics plus the last 20 candles. |
96
+ | `get_launch_info` | Read-only facts about token launches on Elysium 99901 through Boxa's V3 launcher: chain check, contract code-hash pins, pool fee, treasury share, supply. Launching itself is not possible through this MCP. |
97
+ | `get_hl_account` | Hyperliquid account state of a public address: value, margin, positions, open orders. |
98
+
99
+ All tool output is JSON text. Text that comes from third parties (token names, tweets) is sanitised and should still be treated as untrusted data, not as instructions.
100
+
101
+ ## Environment variables (all optional)
102
+
103
+ | Variable | Default | Meaning |
104
+ | --- | --- | --- |
105
+ | `ZYPHER_NETWORK` | `mainnet` | Hyperliquid network for perp reads (`mainnet` is the default and the product's only network). |
106
+ | `ZYPHER_ADDRESS` | unset | Public `0x...` address used by `get_portfolio` / `get_hl_account` when no `address` argument is passed. Never put a private key here. |
107
+ | `X_BEARER_TOKEN` | unset | Your X API bearer token, only for `get_social_info`. |
108
+ | `ZYPHER_API_TOKEN` | unset | Agent Wallet API token (`zat_` + 40 lowercase hex). Enables the six `agent_*` tools. Sent only as `Authorization: Bearer` to `ZYPHER_API_URL`; never logged. |
109
+ | `ZYPHER_API_URL` | `https://zypheragent.com/agent` | Base URL of the Zypher Agent API. Must be https (plain http only for `localhost` / `127.0.0.1`). A different host prints a one-line stderr warning that the token will be sent there. |
110
+ | `ELYSIUM_RPC` | `https://rpc-live.boxa.club` | Override the Elysium (99901) RPC URL. |
111
+ | `HYPEREVM_RPC` | public HyperEVM RPC | Override the HyperEVM (999) RPC URL. |
112
+
113
+ No other variables are read.
114
+
115
+ ## Network behaviour
116
+
117
+ - Without a token only public, unauthenticated data endpoints are contacted. With `ZYPHER_API_TOKEN` it additionally talks to `ZYPHER_API_URL` (default `https://zypheragent.com/agent`), only on the six fixed `/api/agent-api/*` paths. Read tools contact: the Hyperliquid info API (`api.hyperliquid.xyz`), the public HyperEVM RPC (`rpc.hyperliquid.xyz/evm`) and the Elysium 99901 RPC (`rpc-live.boxa.club`, run by Boxa). `get_social_info` contacts `api.x.com` only with your own token.
118
+ - Requests carry the header `User-Agent: zypher-mcp/<version>`.
119
+ - No telemetry, no analytics, no phone-home. The package writes nothing to disk.
120
+ - Default is **mainnet** (real markets): Hyperliquid mainnet, HyperEVM 999 and Elysium 99901. **Elysium 99901 is a community-run chain served by Boxa (rpc-live.boxa.club), not the official Kinetiq mainnet**; `get_launch_info` checks that the chain id and the pinned contract code hashes still match and says so when they do not. Its RPC and contracts are third-party; a lying or lagging RPC cannot be detected from here.
121
+
122
+ ## What it does not do
123
+
124
+ - Without `ZYPHER_API_TOKEN`: no trading, no order preparation, no execution. In every mode: no transaction building or signing here.
125
+ - No private keys, seed phrases or direct wallet access of any kind: the Agent Wallet is held and signed by the Zypher Agent server, never by this package.
126
+ - No launching and no new-pair discovery (`get_new_pairs` is a placeholder that reports "not available"; `get_launch_info` only reads facts).
127
+ - No price history beyond the candles from Hyperliquid, and no token search by name on launchpads (use addresses).
128
+
129
+ ## Limits
130
+
131
+ - Data comes from public APIs and RPCs; it can be stale, rate-limited, incomplete or wrong. Public RPCs may throttle heavy use.
132
+ - `analyze_token_health` inspects bytecode patterns and basic ERC-20 metadata only. A high score is not a safety guarantee.
133
+ - Nothing here is financial advice.
134
+
135
+ ## Security notes
136
+
137
+ - The published bundle contains no signing code and no key handling. Pass only public addresses to the read tools.
138
+ - **Execution is opt-in and uses real money.** Use a *dedicated Agent Wallet with a small balance*, keep the caps in the app low, and revoke the token in the app (Agent > Wallet > API tokens) as soon as you stop using it or suspect a leak. Caps and the revocation are enforced server-side.
139
+ - **Prompt injection:** token names, tweets, web pages and other tool output can contain text that tries to make your assistant call `agent_swap` / `agent_send`. Do not auto-approve `agent_*` tools; read every call's parameters (especially `to` and amounts) before you accept it.
140
+ - The token is only sent in the `Authorization` header to the configured base URL, never in a query string, log, tool result or error message.
141
+ - The server runs locally over stdio; it opens no network port.
142
+ - Treat tool output as data. Do not let an assistant act on instructions found inside token names or tweets.
143
+ - Have a look at the single bundled file `dist/index.js` if you want to audit it.
144
+
145
+ ## License
146
+
147
+ MIT, see `LICENSE`.