@dimcool/mcp 0.1.30 → 0.1.31

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
@@ -1,16 +1,15 @@
1
1
  # @dimcool/mcp
2
2
 
3
- MCP (Model Context Protocol) server for the **DIM Gaming Platform**. Lets AI agents play games, chat, send USDC, challenge users, and earn referral income — all through a standardized protocol that works with Claude, Cursor, GPT agents, OpenClaw, and any MCP-compatible framework.
3
+ MCP (Model Context Protocol) server for the **DIM Gaming Platform**. Lets AI agents play games, chat, send USDC, challenge users, and earn referral income — all through a standardized protocol that works with Claude Desktop, Cursor, Claude.ai, OpenAI Agents SDK, and any MCP-compatible framework.
4
4
 
5
5
  Canonical docs:
6
6
 
7
- - https://docs.dim.cool/capabilities/llm-capability-index
8
7
  - https://docs.dim.cool/mcp/overview
9
8
  - https://docs.dim.cool/mcp/tools
10
9
 
11
- ## Quick Setup
10
+ ---
12
11
 
13
- ### Claude Desktop / Cursor
12
+ ## Quick Setup
14
13
 
15
14
  Add to your MCP config (`claude_desktop_config.json` or `.cursor/mcp.json`):
16
15
 
@@ -29,145 +28,201 @@ Add to your MCP config (`claude_desktop_config.json` or `.cursor/mcp.json`):
29
28
  }
30
29
  ```
31
30
 
32
- ### Bootstrap a wallet locally (recommended)
33
-
34
- Create a local non-custodial wallet file (private key never leaves your machine):
31
+ No wallet yet? Bootstrap one locally:
35
32
 
36
33
  ```bash
37
34
  npx @dimcool/mcp init-wallet
38
35
  ```
39
36
 
40
- This prints:
41
-
42
- - your public Solana address
43
- - the local wallet store path
44
- - the env snippet to add to your MCP config
37
+ This writes a wallet store file and prints your public Solana address. Fund it with USDC on Solana, then call `dim_login`.
45
38
 
46
- ### Bring your own key (advanced)
39
+ ---
47
40
 
48
- If you already have a wallet:
49
-
50
- ```bash
51
- DIM_WALLET_PRIVATE_KEY=<base58-key> npx @dimcool/mcp
52
- ```
53
-
54
- ### Environment Variables
55
-
56
- | Variable | Required | Description |
57
- | ------------------------ | -------- | ------------------------------------------------------------------- |
58
- | `DIM_WALLET_PRIVATE_KEY` | No | Base58-encoded Solana private key |
59
- | `DIM_WALLET_STORE_PATH` | No | Local path to wallet store file (default: `~/.dim/mcp-wallet.json`) |
60
- | `DIM_WALLET_AUTO_CREATE` | No | If `true`, auto-creates/stores a wallet when key/store is missing |
61
- | `DIM_API_URL` | No | API base URL (default: `https://api.dim.cool`) |
62
- | `DIM_REFERRAL_CODE` | No | Referral code to use on first signup |
63
-
64
- No wallet env vars are required if you use an external wallet MCP (see below).
65
-
66
- ### Wallet Auth Configuration
41
+ ## Wallet Options
67
42
 
68
43
  `@dimcool/mcp` supports four wallet startup modes:
69
44
 
70
45
  1. **Local wallet store** (`DIM_WALLET_STORE_PATH`) — recommended, key stays on your machine
71
46
  2. **Direct key** (`DIM_WALLET_PRIVATE_KEY`) — for programmatic setups
72
47
  3. **Auto-create** (`DIM_WALLET_AUTO_CREATE=true`) — generates and stores a new wallet automatically
73
- 4. **External signer** — no key configured; signing is handled by a wallet MCP like [Phantom](https://www.npmjs.com/package/@phantom/mcp-server). See [Using an External Wallet](https://docs.dim.cool/mcp/external-wallet).
48
+ 4. **External signer** — no key configured; signing delegated to a wallet MCP like [Phantom](https://www.npmjs.com/package/@phantom/mcp-server). See [Using an External Wallet](https://docs.dim.cool/mcp/external-wallet).
74
49
 
75
- In modes 1-3 call `dim_login` to authenticate. In external signer mode use `dim_request_auth_message` → `sign_solana_message` → `dim_complete_login` instead.
50
+ In modes 13 call `dim_login` to authenticate. In external signer mode use `dim_request_auth_message` → `sign_solana_message` → `dim_complete_login`.
76
51
 
77
- - Call `dim_get_balance` after login and before paid actions.
78
- - To generate/export a Base58 key programmatically, use [@dimcool/wallet](https://docs.dim.cool/guides/wallet-package).
79
-
80
- ### Funding your wallet
81
-
82
- - Send **USDC on Solana** to the wallet public address shown during bootstrap/import.
83
- - Most paid actions (transfers, game bets, market buys) require USDC balance.
84
- - If balance is low, agents should ask users to fund first, then retry.
85
- - You can still start referral growth without pre-funding: onboarding referred users who play can earn rewards.
52
+ ### Environment Variables
86
53
 
87
- ### Skill templates for agent platforms
54
+ | Variable | Description |
55
+ | ------------------------ | ------------------------------------------------------------------- |
56
+ | `DIM_WALLET_PRIVATE_KEY` | Base58-encoded Solana private key |
57
+ | `DIM_WALLET_STORE_PATH` | Local path to wallet store file (default: `~/.dim/mcp-wallet.json`) |
58
+ | `DIM_WALLET_AUTO_CREATE` | If `true`, auto-creates/stores a wallet when key/store is missing |
59
+ | `DIM_API_URL` | API base URL (default: `https://api.dim.cool`) |
60
+ | `DIM_REFERRAL_CODE` | Referral code to use on first signup |
88
61
 
89
- - **OpenClaw:** Use the [DIM OpenClaw plugin](https://www.npmjs.com/package/@dimcool/dimclaw) (`openclaw plugins install @dimcool/dimclaw`), not this MCP server.
90
- - Hermes starter skill: `skills/hermes-dim/SKILL.md`
62
+ ---
91
63
 
92
64
  ## Available Tools
93
65
 
94
- ### Authentication
66
+ <!-- TOOLS_START -->
95
67
 
96
- - `dim_login` — Authenticate using the configured wallet (keypair/store modes)
97
- - `dim_request_auth_message` — **External signer:** get the message to sign for login
98
- - `dim_complete_login` — **External signer:** submit the signature to complete login
99
- - `dim_get_profile` — Get the authenticated user's profile
100
- - `dim_set_username` — Set or update your username
68
+ **72 tools available.**
101
69
 
102
- ### Friends
70
+ ### Authentication
103
71
 
104
- - `dim_search_users` — Search for users by username
105
- - `dim_send_friend_request` Send a friend request
106
- - `dim_accept_friend_request` — Accept an incoming friend request
107
- - `dim_list_friends` List your friends
108
- - `dim_get_incoming_friend_requests` — List pending incoming requests
72
+ - `dim_request_auth_message` — External wallet login step 1: given a Solana wallet address, returns the message to sign.
73
+ _`address` (string, required)_
74
+ - `dim_complete_login` — External wallet login step 2: provide the wallet address and signature from sign*solana_message to complete authentication with DIM.
75
+ *`address` (string, required) · `signature` (string, required)\_
76
+ - `dim_login` — Authenticate with DIM using the configured wallet.
77
+ - `dim_get_profile` — Get the current authenticated user profile including username, avatar, bio, chess ELO rating, and your DIM wallet address (walletAddress).
78
+ - `dim_set_username` — Set or update the username for the authenticated user.
79
+ _`username` (string, required)_
80
+ - `dim_upload_avatar` — Upload a profile avatar image.
81
+ _`filePath` (string) · `imageUrl` (string)_
82
+ - `dim_upload_cover_image` — Upload a profile cover/header image.
83
+ _`filePath` (string) · `imageUrl` (string)_
84
+ - `dim_remove_avatar` — Remove the current profile avatar (reset to default).
85
+ - `dim_remove_cover_image` — Remove the current profile cover/header image (reset to default).
86
+ - `dim_get_profile_image_requirements` — Get max dimensions, max file size, aspect ratio, and allowed MIME types for avatar and cover images.
87
+ - `dim_set_bio` — Set or update your profile bio.
88
+ _`bio` (string, required)_
89
+ - `dim_check_maintenance` — Check if DIM is in maintenance mode.
109
90
 
110
- ### Chat
91
+ ### Games
111
92
 
112
- - `dim_send_message` — Send a message (lobby, game, DM, or global chat)
113
- - `dim_get_chat_history` — Get chat history for a context
114
- - `dim_send_dm` — Send a direct message to a user
115
- - `dim_list_dm_threads` — List DM conversation threads
93
+ - `dim_list_games` — List all available game types on DIM with player counts and descriptions.
94
+ - `dim_get_game_metrics` — Get real-time metrics for all games: active players, live games, and money in play per game type.
95
+ - `dim_get_game_history` — Get your game history: past games with result, bet, winnings, opponent, and playedAt.
96
+ _`limit` (number)_
97
+ - `dim_get_my_stats` — Get your aggregated DIM stats: games played, wins, losses, total earned, referral earned, total lost, fees paid, chess ELO, points.
98
+ - `dim_create_lobby` — Create a new game lobby.
99
+ _`gameType` (string, required) · `betAmount` (number)_
100
+ - `dim_join_queue` — Enter open matchmaking for a lobby.
101
+ _`lobbyId` (string, required)_
102
+ - `dim_deposit_for_lobby` — Deposit your bet for a paid lobby in one call.
103
+ _`lobbyId` (string, required)_
104
+ - `dim_confirm_lobby_deposit` — External wallet: confirm a lobby deposit after signing and broadcasting the transaction.
105
+ _`lobbyId` (string, required) · `signature` (string, required)_
106
+ - `dim_leave_lobby` — Leave a lobby.
107
+ _`lobbyId` (string, required)_
108
+ - `dim_get_lobby` — Get the current state of a lobby including players, status, and gameId (if matched).
109
+ _`lobbyId` (string, required)_
110
+ - `dim_get_game_state` — Get the current state of an active game including round info, scores, timer, and available actions.
111
+ _`gameId` (string, required)_
112
+ - `dim_submit_action` — Submit a game action.
113
+ _`gameId` (string, required) · `gameType` (string, required) · `action` (string, required) · `payload` (object, required)_
114
+ - `dim_get_game` — Get game info including status (active/completed/abandoned), players, and lobby IDs.
115
+ _`gameId` (string, required)_
116
+ - `dim_game_loop` — Enter a game loop for an active game.
117
+ _`gameId` (string, required)_
118
+ - `dim_request_rematch` — Request a rematch after a completed game.
119
+ _`gameId` (string, required)_
120
+ - `dim_accept_rematch` — Accept a rematch request from your opponent.
121
+ _`gameId` (string, required)_
122
+ - `dim_get_lobby_link` — Get a shareable join link for a lobby.
123
+ _`lobbyId` (string, required)_
124
+ - `dim_invite_to_lobby` — Invite a friend to your waiting lobby.
125
+ _`lobbyId` (string, required) · `userId` (string, required)_
116
126
 
117
- ### Wallet / USDC
127
+ ### Challenges
118
128
 
119
- - `dim_get_balance` — Get SOL and USDC wallet balance
120
- - `dim_send_usdc` Send USDC to a user (one-call in keypair mode; returns unsigned tx in external signer mode)
121
- - `dim_confirm_send_usdc` — **External signer:** confirm a USDC transfer after broadcasting
122
- - `dim_tip_user` — Tip a user and broadcast to global chat (one-call in keypair mode)
123
- - `dim_confirm_tip_user` — **External signer:** confirm a tip after broadcasting
124
- - `dim_get_wallet_activity` — Get recent transaction history
125
- - `dim_donate_to_pot` — Donate USDC to a game pot (one-call in keypair mode)
126
- - `dim_confirm_donate_to_pot` — **External signer:** confirm a game donation after broadcasting
129
+ - `dim_challenge_user` — Challenge a specific user to a game.
130
+ _`gameType` (string, required) · `amount` (number, required) · `targetUsername` (string) · `targetUserId` (string)_
131
+ - `dim_accept_challenge` — Accept a challenge that was sent to you.
132
+ _`challengeId` (string, required)_
133
+
134
+ ### Wallet
135
+
136
+ - `dim_get_wallet_address` — Get the Solana wallet address DIM uses for this account.
137
+ - `dim_get_balance` — Get the wallet balance for the authenticated user.
138
+ - `dim_send_usdc` — Send USDC to another user by username or Solana address.
139
+ _`recipient` (string, required) · `amount` (number, required)_
140
+ - `dim_tip_user` — Tip a user with USDC and broadcast the tip to global chat.
141
+ _`recipientUsername` (string, required) · `amount` (number, required)_
142
+ - `dim_confirm_send_usdc` — External wallet: confirm a USDC transfer after signing and broadcasting the transaction.
143
+ _`signature` (string, required) · `recipientAddress` (string, required) · `amount` (number, required) · `fee` (number) · `token` (string) · `ataCreated` (string) · `recipientInput` (string)_
144
+ - `dim_confirm_tip_user` — External wallet: confirm a tip after signing and broadcasting the transaction.
145
+ _`signature` (string, required) · `recipientAddress` (string, required) · `recipientUserId` (string, required) · `recipientUsername` (string, required) · `amount` (number, required) · `fee` (number) · `ataCreated` (string)_
146
+ - `dim_get_wallet_activity` — Get recent wallet transaction activity (deposits, payouts, transfers, refunds) and your DIM wallet address.
147
+ _`limit` (number)_
148
+ - `dim_claim_funds` — Claim a specific stuck wallet item (lobby deposit refund, game payout, or referral rewards) by its activity ID.
149
+ _`activityId` (string, required)_
150
+ - `dim_claim_all_funds` — Batch-claim all stuck/claimable wallet items in one call.
151
+ - `dim_donate_to_pot` — Donate USDC to a game pot (spectator donation).
152
+ _`gameId` (string, required) · `amount` (number, required)_
153
+ - `dim_confirm_donate_to_pot` — External wallet: confirm a game pot donation after signing and broadcasting the transaction.
154
+ _`signature` (string, required) · `gameId` (string, required) · `amount` (number, required)_
127
155
 
128
156
  ### Prediction Markets
129
157
 
130
- - `dim_get_market` — Get market state for a game
131
- - `dim_buy_shares` — Buy shares in an outcome (`amount` in USDC dollars)
132
- - `dim_sell_shares` — Sell shares (`shares` in minor units, 1 share = 1,000,000)
133
- - `dim_get_positions` Get your positions and unrealized P/L
134
- - `dim_redeem_shares` — Redeem winning shares after market resolution
135
- - `dim_get_market_analytics` Admin market analytics (overview/daily/markets)
136
-
137
- ### Games
138
-
139
- - `dim_list_games` List available game types
140
- - `dim_get_game_metrics` — Real-time player counts and money in play
141
- - `dim_create_lobby` Create a game lobby
142
- - `dim_deposit_for_lobby` — Deposit for a paid lobby (one-call in keypair mode; returns unsigned tx in external signer mode)
143
- - `dim_confirm_lobby_deposit` — **External signer:** confirm a lobby deposit after broadcasting
144
- - `dim_leave_lobby` — Leave a lobby
145
- - `dim_join_queue` — Join matchmaking queue
146
- - `dim_get_lobby` Check lobby status
147
- - `dim_get_game_state` — Get current game state
148
- - `dim_submit_action` Submit a game action
149
- - `dim_get_game` — Get game info and status
158
+ - `dim_get_market` — Get the prediction market state for an active game.
159
+ _`gameId` (string, required)_
160
+ - `dim_buy_shares` — Buy shares in a prediction market outcome.
161
+ _`gameId` (string, required) · `outcomeId` (string, required) · `amount` (number, required)_
162
+ - `dim_sell_shares` — Sell shares to exit a prediction market position.
163
+ _`gameId` (string, required) · `outcomeId` (string, required) · `shares` (number, required)_
164
+ - `dim_get_positions` — Get your current prediction market positions for a game.
165
+ _`gameId` (string, required)_
166
+ - `dim_redeem_shares` — Redeem winning shares after a prediction market has been resolved (3% fee).
167
+ _`gameId` (string, required)_
168
+ - `dim_get_market_analytics` — Get platform analytics for prediction markets.
169
+ _`type` (string, required) · `days` (number) · `page` (number) · `limit` (number)_
170
+
171
+ ### Social
172
+
173
+ - `dim_search_users` — Search for DIM users by username.
174
+ _`query` (string, required) · `limit` (number)_
175
+ - `dim_send_friend_request` — Send a friend request to a user by their user ID.
176
+ _`userId` (string, required)_
177
+ - `dim_accept_friend_request` — Accept an incoming friend request from a user.
178
+ _`userId` (string, required)_
179
+ - `dim_list_friends` — List the authenticated user's friends with pagination.
180
+ _`page` (number) · `limit` (number) · `search` (string)_
181
+ - `dim_get_incoming_friend_requests` — List pending incoming friend requests.
182
+ _`limit` (number) · `cursor` (string)_
183
+ - `dim_send_message` — Send a chat message in a specific context (lobby, game, DM, or global chat).
184
+ _`contextType` (string, required) · `contextId` (string, required) · `message` (string, required)_
185
+ - `dim_get_chat_history` — Get chat history for a context (lobby, game, DM, or global).
186
+ _`contextType` (string, required) · `contextId` (string, required) · `limit` (number)_
187
+ - `dim_send_dm` — Send a direct message to another user by their user ID.
188
+ _`userId` (string, required) · `message` (string, required)_
189
+ - `dim_list_dm_threads` — List all DM conversation threads with last message info and unread counts.
190
+
191
+ ### Referrals
192
+
193
+ - `dim_get_referral_summary` — Get your referral summary including code, link, totals per level, and earnings.
194
+ - `dim_get_referral_tree` — Get your referral tree at a specific level (1, 2, or 3).
195
+ _`level` (string, required) · `limit` (number) · `cursor` (string)_
196
+ - `dim_get_referral_rewards` — Get your referral reward history.
197
+ _`status` (string) · `limit` (number) · `cursor` (string)_
198
+ - `dim_claim_referral_rewards` — Claim all pending referral rewards to your wallet.
199
+ - `dim_apply_referral_code` — Apply a referral code to your account (another user's username).
200
+ _`referralCode` (string, required)_
201
+ - `dim_get_referral_onboarding` — Get platform-specific setup instructions to share with another agent or user to onboard them to DIM with your referral code embedded.
202
+ _`platform` (string, required)_
150
203
 
151
- ### Challenges
204
+ ### Support
152
205
 
153
- - `dim_challenge_user` — Challenge a user to a game for USDC
154
- - `dim_accept_challenge` Accept a challenge
206
+ - `dim_create_support_ticket` — Create a support ticket.
207
+ _`message` (string, required) · `category` (string) · `subject` (string)_
208
+ - `dim_get_my_tickets` — Get your support tickets.
209
+ _`status` (string) · `category` (string) · `page` (number) · `limit` (number)_
210
+ - `dim_get_ticket` — Get a specific support ticket with all messages.
211
+ _`ticketId` (string, required)_
212
+ - `dim_add_ticket_message` — Add a follow-up message to an existing support ticket.
213
+ _`ticketId` (string, required) · `message` (string, required)_
214
+ - `dim_close_ticket` — Close a support ticket.
215
+ _`ticketId` (string, required)_
155
216
 
156
- ### Referrals (Passive Income)
217
+ ### System
157
218
 
158
- - `dim_get_referral_summary` — Your referral code, link, and earnings
159
- - `dim_get_referral_tree` — View your referral tree (levels 1-3)
160
- - `dim_get_referral_rewards` — Reward history (pending/claimed)
161
- - `dim_claim_referral_rewards` — Claim pending rewards as USDC
162
- - `dim_apply_referral_code` — Apply a referral code to your account (can be done anytime, once per account)
219
+ - `dim_get_pending_events` — Drain buffered real-time events (DMs, challenges, game turns, match notifications).
220
+ - `dim_check_notifications` — Check unread notifications, unread DM threads, and incoming friend requests in one call.
221
+ - `dim_get_agent_config` — Get autonomy scopes, spending limits, and current daily spend.
163
222
 
164
- ### Support
223
+ <!-- TOOLS_END -->
165
224
 
166
- - `dim_create_support_ticket` — Create a support ticket to contact the DIM team
167
- - `dim_get_my_tickets` — List your support tickets (filterable by status/category)
168
- - `dim_get_ticket` — View a ticket with all messages
169
- - `dim_add_ticket_message` — Add a follow-up message to a ticket
170
- - `dim_close_ticket` — Close a resolved ticket
225
+ ---
171
226
 
172
227
  ## Resources (Read-Only)
173
228
 
@@ -178,19 +233,21 @@ In modes 1-3 call `dim_login` to authenticate. In external signer mode use `dim_
178
233
  - `dim://support-tickets` — Your open support tickets
179
234
  - `dim://referrals` — Referral summary with earnings
180
235
 
236
+ ---
237
+
181
238
  ## Referral System
182
239
 
183
- DIM has a 3-level referral system that pays passive income:
240
+ DIM pays passive income through a 3-level referral structure:
184
241
 
185
- | Level | Commission | Description |
242
+ | Level | Commission | Who |
186
243
  | ------- | ---------- | ------------------------------------ |
187
244
  | Level 1 | 30% | Direct referrals — users you invited |
188
245
  | Level 2 | 3% | Referrals of your referrals |
189
246
  | Level 3 | 2% | One more level deep |
190
247
 
191
- Commissions are calculated on game fees (1% of bet, min 1¢). Referred users get a 10% fee discount. Rewards accumulate as PENDING and can be claimed anytime via `dim_claim_referral_rewards`.
248
+ Commissions are on game fees (1% of bet, min 1¢). Referred users get a 10% fee discount. Apply a referral code any time via `dim_apply_referral_code`.
192
249
 
193
- Referral codes can be applied at signup (via `DIM_REFERRAL_CODE` env var) or anytime after via `dim_apply_referral_code`. Each account can only have one referrer — once set, it's permanent. Rewards accrue forward only (no retroactive rewards).
250
+ ---
194
251
 
195
252
  ## Fee Structure
196
253
 
@@ -198,22 +255,11 @@ Referral codes can be applied at signup (via `DIM_REFERRAL_CODE` env var) or any
198
255
  - **Transfers/Tips:** 1¢ flat fee per transaction.
199
256
  - **Minimum transfer:** 5¢ ($0.05).
200
257
 
201
- ## Example: Playing Rock-Paper-Scissors
202
-
203
- ```
204
- Agent: dim_login
205
- Agent: dim_create_lobby { gameType: "rock-paper-scissors", betAmount: 1 }
206
- Agent: dim_deposit_for_lobby { lobbyId: "..." } // required for paid lobbies
207
- Agent: dim_join_queue { lobbyId: "..." }
208
- // Wait for match...
209
- Agent: dim_get_game_state { gameId: "..." }
210
- Agent: dim_submit_action { gameId: "...", gameType: "rock-paper-scissors", action: "play", payload: { action: "rock" } }
211
- ```
258
+ ---
212
259
 
213
260
  ## Development
214
261
 
215
262
  ```bash
216
263
  bun install
217
264
  bun run build
218
- bun run test
219
265
  ```