@tamago-labs/wayfind-mcp 0.2.0 → 0.3.4

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 ADDED
@@ -0,0 +1,178 @@
1
+ # Wayfind Solana MCP
2
+
3
+ ![NPM Version](https://img.shields.io/npm/v/@tamago-labs/wayfind-mcp)
4
+
5
+ **Wayfind Solana MCP** is a Model Context Protocol (MCP) server for the Wayfind AI risk intelligence platform. It provides wallet operations, tokenized stock data, risk analysis, and OKX DEX swap integration for Solana wallets.
6
+
7
+ ## Features
8
+
9
+ - **10 MCP tools** covering wallet management, market data, risk analysis, and token swaps
10
+ - **OKX DEX integration** for swap quotes and end-to-end token swaps (get instruction → sign → send)
11
+ - **Tokenized stock data** from Wayfind API — prices, market overview, pre-IPO markets
12
+ - **Risk portfolio analysis** — user risk profiles with factor breakdowns
13
+ - **Auto wallet generation** — creates and persists a Solana wallet if no private key is provided
14
+ - **Token symbol resolution** — maps mint addresses to symbols for base tokens, RWA stocks, and pre-IPO tokens
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install -g @tamago-labs/wayfind-mcp
20
+ ```
21
+
22
+ ## Configuration
23
+
24
+ ### Environment Variables
25
+
26
+ | Variable | Required | Default | Description |
27
+ |----------|----------|---------|-------------|
28
+ | `SOLANA_PRIVATE_KEY` | No* | Auto-generated | Base58-encoded Solana private key |
29
+ | `SOLANA_RPC_URL` | No | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint |
30
+ | `WAYFIND_API_KEY` | No* | Demo default | Wayfind API key (UserProfile ID) — get from [wayfind.click](https://wayfind.click/) dashboard. Omit for demo risk profile |
31
+
32
+ *If `SOLANA_PRIVATE_KEY` is not set, a new wallet is generated and saved to `.wallet.json`.
33
+ *`WAYFIND_API_KEY` uses a demo key by default which returns a sample risk profile. For your own risk profile, get your API key from the Wayfind dashboard.
34
+
35
+ ### OpenCode
36
+
37
+ Add to `~/.config/opencode/opencode.jsonc`:
38
+
39
+ ```jsonc
40
+ {
41
+ "$schema": "https://opencode.ai/config.json",
42
+ "mcp": {
43
+ "servers": {
44
+ "wayfind-solana": {
45
+ "type": "local",
46
+ "command": ["npx", "-y", "@tamago-labs/wayfind-mcp"],
47
+ "environment": {
48
+ "SOLANA_PRIVATE_KEY": "your_base58_key_here (omit to auto-create a new wallet)"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ ### Claude Desktop
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "wayfind-solana": {
62
+ "command": "npx",
63
+ "args": [
64
+ "-y",
65
+ "@tamago-labs/wayfind-mcp"
66
+ ],
67
+ "env": {
68
+ "SOLANA_PRIVATE_KEY": "your_base58_key_here (omit to auto-create)"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Cursor
76
+
77
+ ```json
78
+ {
79
+ "mcp": {
80
+ "servers": {
81
+ "wayfind-solana": {
82
+ "command": "npx",
83
+ "args": ["-y", "@tamago-labs/wayfind-mcp"],
84
+ "env": {
85
+ "SOLANA_PRIVATE_KEY": "your_base58_key_here (omit to auto-create)"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ## Available Tools
94
+
95
+ ### Wallet Operations
96
+
97
+ | Tool Name | Description | Example Prompt |
98
+ |-----------|-------------|----------------|
99
+ | `solana_get_wallet_address` | Get the wallet address derived from the private key | "What's my wallet address?" |
100
+ | `solana_get_balance` | Get SOL and SPL token balances with symbol resolution | "Show my wallet balances" |
101
+ | `solana_get_swap_quote` | Get an OKX DEX swap quote for a token pair | "How much USDC for 1 SOL?" |
102
+ | `solana_swap_tokens` | Swap tokens on Solana via OKX DEX (signs and sends) | "Swap 0.1 SOL to USDC" |
103
+
104
+ ### Market Data
105
+
106
+ | Tool Name | Description | Example Prompt |
107
+ |-----------|-------------|----------------|
108
+ | `wayfind_get_tokens` | List all tokenized stocks with prices | "Show me all tokenized stocks" |
109
+ | `wayfind_get_tokenized_stocks` | Get all tokenized versions of a stock ticker across blockchains | "Get all AAPL tokens" |
110
+ | `wayfind_get_market_overview` | Get market stats: total cap, volume, gainers, losers, trending | "Show market overview" |
111
+ | `wayfind_get_pre_ipo` | List pre-IPO markets with mark prices and valuations | "Show pre-IPO markets" |
112
+
113
+ ### Risk Analysis
114
+
115
+ | Tool Name | Description | Example Prompt |
116
+ |-----------|-------------|----------------|
117
+ | `wayfind_get_risk_profile` | Get the risk profile created from the Wayfind dashboard | "Show my risk profile" |
118
+
119
+ ## Architecture
120
+
121
+ ```
122
+ wayfind-mcp/
123
+ ├── package.json # @tamago-labs/wayfind-mcp
124
+ ├── tsconfig.json
125
+ ├── tsup.config.ts # Build: CJS + ESM + .d.ts
126
+ ├── .gitignore
127
+ └── src/
128
+ ├── index.ts # MCP server bootstrap
129
+ ├── config.ts # Env validation + auto-wallet creation
130
+ ├── types.ts # McpTool interface
131
+ ├── agent/
132
+ │ └── index.ts # Agent class: RPC client, signer, symbol resolution
133
+ └── mcp/
134
+ ├── index.ts # Aggregates all tools
135
+ ├── solana/ # Solana wallet + swap tools
136
+ │ ├── get_wallet_address_tool.ts
137
+ │ ├── get_balance_tool.ts
138
+ │ ├── get_swap_quote_tool.ts
139
+ │ └── swap_tokens_tool.ts
140
+ └── wayfind/ # Wayfind API tools
141
+ ├── get_tokens_tool.ts
142
+ ├── get_tokenized_stocks_tool.ts
143
+ ├── get_risk_profile_tool.ts
144
+ ├── get_market_overview_tool.ts
145
+ └── get_pre_ipo_tool.ts
146
+ ```
147
+
148
+ ## Wallet Auto-Creation
149
+
150
+ When `SOLANA_PRIVATE_KEY` is not set, the server generates a new Solana wallet:
151
+
152
+ 1. Generates a 64-byte secret key using `@solana/kit`
153
+ 2. Saves to `.wallet.json` in the working directory (gitignored, mode `0600`)
154
+ 3. Reuses the saved key on subsequent restarts
155
+ 4. Uses `flag: "wx"` to prevent overwriting an existing wallet
156
+
157
+ **Note:** Anyone with access to `.wallet.json` can control the wallet's funds. Do not expose this file.
158
+
159
+ ## Dependencies
160
+
161
+ | Package | Version | Purpose |
162
+ |---------|---------|---------|
163
+ | `@modelcontextprotocol/sdk` | ^1.10.2 | MCP server + StdioServerTransport |
164
+ | `@solana/kit` | ^2.3.0 | Solana SDK (RPC, keypairs, transactions) |
165
+ | `bs58` | ^6.0.0 | Base58 encoding |
166
+ | `zod` | ^3.24.3 | Tool parameter schemas |
167
+
168
+ ## Building
169
+
170
+ ```bash
171
+ npm install
172
+ npm run build # Outputs to dist/
173
+ npm start # Run the server
174
+ ```
175
+
176
+ ## License
177
+
178
+ MIT