@dimcool/mcp 0.1.9 → 0.1.11
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 +1 -1
- package/dist/index.js +188 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ DIM_WALLET_PRIVATE_KEY=<base58-key> npx @dimcool/mcp
|
|
|
82
82
|
|
|
83
83
|
### Skill templates for agent platforms
|
|
84
84
|
|
|
85
|
-
- **OpenClaw:** Use the [DIM OpenClaw plugin](https://www.npmjs.com/package/@dimcool/
|
|
85
|
+
- **OpenClaw:** Use the [DIM OpenClaw plugin](https://www.npmjs.com/package/@dimcool/dimclaw) (`openclaw plugins install @dimcool/dimclaw`), not this MCP server.
|
|
86
86
|
- Hermes starter skill: `skills/hermes-dim/SKILL.md`
|
|
87
87
|
|
|
88
88
|
## Available Tools
|
package/dist/index.js
CHANGED
|
@@ -22861,10 +22861,12 @@ var Wallet = class {
|
|
|
22861
22861
|
*/
|
|
22862
22862
|
async getBalances() {
|
|
22863
22863
|
try {
|
|
22864
|
-
const
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
|
|
22864
|
+
const raw = await this.http.get("/wallets/me/balance");
|
|
22865
|
+
const usdcDollars = raw.usdc / 1e6;
|
|
22866
|
+
return {
|
|
22867
|
+
...raw,
|
|
22868
|
+
usdcFormatted: `$${usdcDollars.toFixed(2)}`
|
|
22869
|
+
};
|
|
22868
22870
|
} catch (error) {
|
|
22869
22871
|
this.logger.error("Failed to get balances", {
|
|
22870
22872
|
error: error instanceof Error ? error.message : String(error)
|
|
@@ -25211,24 +25213,35 @@ import { z } from "zod";
|
|
|
25211
25213
|
function registerAuthTools(server2, client) {
|
|
25212
25214
|
server2.tool(
|
|
25213
25215
|
"dim_login",
|
|
25214
|
-
"Authenticate with DIM using the configured wallet.
|
|
25216
|
+
"Authenticate with DIM using the configured wallet. After login: set a username with dim_set_username, check balance with dim_get_balance, list games with dim_list_games, or apply a referral code with dim_apply_referral_code for a 10% fee discount.",
|
|
25215
25217
|
{},
|
|
25216
25218
|
async () => {
|
|
25217
25219
|
try {
|
|
25218
25220
|
const result = await client.authenticate();
|
|
25219
|
-
const
|
|
25220
|
-
|
|
25221
|
-
|
|
25222
|
-
|
|
25223
|
-
|
|
25224
|
-
}
|
|
25221
|
+
const nextSteps = [];
|
|
25222
|
+
if (result.username == null || result.username === "") {
|
|
25223
|
+
nextSteps.push(
|
|
25224
|
+
"No username set \u2014 call dim_set_username to claim one"
|
|
25225
|
+
);
|
|
25226
|
+
}
|
|
25227
|
+
nextSteps.push("Check your balance with dim_get_balance");
|
|
25228
|
+
nextSteps.push("Explore available games with dim_list_games");
|
|
25225
25229
|
try {
|
|
25226
25230
|
const summary = await client.sdk.referrals.getSummary();
|
|
25227
25231
|
if (!summary.hasReferrer) {
|
|
25228
|
-
|
|
25232
|
+
nextSteps.push(
|
|
25233
|
+
"No referrer yet \u2014 call dim_apply_referral_code for 10% fee discount"
|
|
25234
|
+
);
|
|
25229
25235
|
}
|
|
25230
25236
|
} catch {
|
|
25231
25237
|
}
|
|
25238
|
+
const response = {
|
|
25239
|
+
success: true,
|
|
25240
|
+
userId: result.userId,
|
|
25241
|
+
username: result.username ?? null,
|
|
25242
|
+
walletAddress: client.walletAddress,
|
|
25243
|
+
nextSteps
|
|
25244
|
+
};
|
|
25232
25245
|
return {
|
|
25233
25246
|
content: [
|
|
25234
25247
|
{
|
|
@@ -25616,7 +25629,7 @@ import { z as z4 } from "zod";
|
|
|
25616
25629
|
function registerWalletTools(server2, client) {
|
|
25617
25630
|
server2.tool(
|
|
25618
25631
|
"dim_get_balance",
|
|
25619
|
-
"Get the wallet balance for the authenticated user. Returns SOL and USDC
|
|
25632
|
+
"Get the wallet balance for the authenticated user. Returns SOL and USDC (usdc in minor units; usdcFormatted is always present, e.g. $0.00 or $1.50, so you do not need to convert).",
|
|
25620
25633
|
{},
|
|
25621
25634
|
async () => {
|
|
25622
25635
|
try {
|
|
@@ -26779,6 +26792,166 @@ function registerMarketTools(server2, client) {
|
|
|
26779
26792
|
);
|
|
26780
26793
|
}
|
|
26781
26794
|
|
|
26795
|
+
// src/tools/instructions.ts
|
|
26796
|
+
var DIM_INSTRUCTIONS = [
|
|
26797
|
+
{
|
|
26798
|
+
name: "dim_login",
|
|
26799
|
+
description: "Authenticate with DIM. Call this first; then set username, check balance, list games, or apply referral code."
|
|
26800
|
+
},
|
|
26801
|
+
{
|
|
26802
|
+
name: "dim_get_profile",
|
|
26803
|
+
description: "Get current user profile (username, avatar, bio, chess ELO)."
|
|
26804
|
+
},
|
|
26805
|
+
{
|
|
26806
|
+
name: "dim_set_username",
|
|
26807
|
+
description: "Set or update your username (alphanumeric, 3\u201320 chars)."
|
|
26808
|
+
},
|
|
26809
|
+
{
|
|
26810
|
+
name: "dim_list_instructions",
|
|
26811
|
+
description: "List all available DIM tools and short descriptions (this list)."
|
|
26812
|
+
},
|
|
26813
|
+
{
|
|
26814
|
+
name: "dim_get_balance",
|
|
26815
|
+
description: "Get SOL and USDC balance; usdcFormatted is always present (e.g. $0.00)."
|
|
26816
|
+
},
|
|
26817
|
+
{
|
|
26818
|
+
name: "dim_send_usdc",
|
|
26819
|
+
description: "Send USDC to a user by username or address. 1\xA2 fee; amount in dollars."
|
|
26820
|
+
},
|
|
26821
|
+
{
|
|
26822
|
+
name: "dim_tip_user",
|
|
26823
|
+
description: "Tip a user with USDC; tip is broadcast to global chat. 1\xA2 fee."
|
|
26824
|
+
},
|
|
26825
|
+
{
|
|
26826
|
+
name: "dim_get_wallet_activity",
|
|
26827
|
+
description: "Get recent wallet activity (deposits, payouts, transfers)."
|
|
26828
|
+
},
|
|
26829
|
+
{ name: "dim_search_users", description: "Search users by username." },
|
|
26830
|
+
{
|
|
26831
|
+
name: "dim_send_friend_request",
|
|
26832
|
+
description: "Send friend request by user ID; auto-accepts if they already requested you."
|
|
26833
|
+
},
|
|
26834
|
+
{
|
|
26835
|
+
name: "dim_accept_friend_request",
|
|
26836
|
+
description: "Accept an incoming friend request."
|
|
26837
|
+
},
|
|
26838
|
+
{
|
|
26839
|
+
name: "dim_list_friends",
|
|
26840
|
+
description: "List your friends with pagination."
|
|
26841
|
+
},
|
|
26842
|
+
{
|
|
26843
|
+
name: "dim_get_incoming_friend_requests",
|
|
26844
|
+
description: "List pending incoming friend requests."
|
|
26845
|
+
},
|
|
26846
|
+
{
|
|
26847
|
+
name: "dim_send_message",
|
|
26848
|
+
description: "Send chat in a context (lobby, game, dm, global)."
|
|
26849
|
+
},
|
|
26850
|
+
{
|
|
26851
|
+
name: "dim_get_chat_history",
|
|
26852
|
+
description: "Get chat history for a context."
|
|
26853
|
+
},
|
|
26854
|
+
{
|
|
26855
|
+
name: "dim_send_dm",
|
|
26856
|
+
description: "Send a direct message to a user by ID."
|
|
26857
|
+
},
|
|
26858
|
+
{
|
|
26859
|
+
name: "dim_list_dm_threads",
|
|
26860
|
+
description: "List DM threads with last message and unread counts."
|
|
26861
|
+
},
|
|
26862
|
+
{
|
|
26863
|
+
name: "dim_list_games",
|
|
26864
|
+
description: "List available game types (RPS, Chess, Tic-Tac-Toe, etc.)."
|
|
26865
|
+
},
|
|
26866
|
+
{
|
|
26867
|
+
name: "dim_get_game_metrics",
|
|
26868
|
+
description: "Get real-time metrics: active players, live games, money in play."
|
|
26869
|
+
},
|
|
26870
|
+
{
|
|
26871
|
+
name: "dim_create_lobby",
|
|
26872
|
+
description: "Create a game lobby; bet in USDC minor units."
|
|
26873
|
+
},
|
|
26874
|
+
{
|
|
26875
|
+
name: "dim_join_queue",
|
|
26876
|
+
description: "Join matchmaking queue for a game type."
|
|
26877
|
+
},
|
|
26878
|
+
{ name: "dim_get_lobby", description: "Get lobby details by ID." },
|
|
26879
|
+
{
|
|
26880
|
+
name: "dim_get_game_state",
|
|
26881
|
+
description: "Get current state of a game (for submitting moves)."
|
|
26882
|
+
},
|
|
26883
|
+
{ name: "dim_submit_action", description: "Submit a move/action in a game." },
|
|
26884
|
+
{
|
|
26885
|
+
name: "dim_donate_to_pot",
|
|
26886
|
+
description: "Add to the pot in a lobby (optional)."
|
|
26887
|
+
},
|
|
26888
|
+
{ name: "dim_get_game", description: "Get game summary by ID." },
|
|
26889
|
+
{
|
|
26890
|
+
name: "dim_challenge_user",
|
|
26891
|
+
description: "Challenge another user to a game."
|
|
26892
|
+
},
|
|
26893
|
+
{ name: "dim_accept_challenge", description: "Accept a game challenge." },
|
|
26894
|
+
{
|
|
26895
|
+
name: "dim_get_referral_summary",
|
|
26896
|
+
description: "Get your referral stats and rewards."
|
|
26897
|
+
},
|
|
26898
|
+
{ name: "dim_get_referral_tree", description: "Get your referral tree." },
|
|
26899
|
+
{
|
|
26900
|
+
name: "dim_get_referral_rewards",
|
|
26901
|
+
description: "Get claimable referral rewards."
|
|
26902
|
+
},
|
|
26903
|
+
{
|
|
26904
|
+
name: "dim_claim_referral_rewards",
|
|
26905
|
+
description: "Claim referral rewards to your wallet."
|
|
26906
|
+
},
|
|
26907
|
+
{
|
|
26908
|
+
name: "dim_apply_referral_code",
|
|
26909
|
+
description: "Apply a referral code for 10% fee discount."
|
|
26910
|
+
},
|
|
26911
|
+
{
|
|
26912
|
+
name: "dim_create_support_ticket",
|
|
26913
|
+
description: "Create a support ticket."
|
|
26914
|
+
},
|
|
26915
|
+
{ name: "dim_get_my_tickets", description: "List your support tickets." },
|
|
26916
|
+
{ name: "dim_get_ticket", description: "Get a ticket by ID." },
|
|
26917
|
+
{ name: "dim_add_ticket_message", description: "Add a message to a ticket." },
|
|
26918
|
+
{ name: "dim_close_ticket", description: "Close a support ticket." },
|
|
26919
|
+
{ name: "dim_get_market", description: "Get prediction market for a game." },
|
|
26920
|
+
{ name: "dim_buy_shares", description: "Buy prediction market shares." },
|
|
26921
|
+
{ name: "dim_sell_shares", description: "Sell prediction market shares." },
|
|
26922
|
+
{ name: "dim_get_positions", description: "Get your market positions." },
|
|
26923
|
+
{
|
|
26924
|
+
name: "dim_redeem_shares",
|
|
26925
|
+
description: "Redeem shares after market resolution."
|
|
26926
|
+
},
|
|
26927
|
+
{ name: "dim_get_market_analytics", description: "Get market analytics." }
|
|
26928
|
+
];
|
|
26929
|
+
function registerInstructionsTool(server2) {
|
|
26930
|
+
server2.tool(
|
|
26931
|
+
"dim_list_instructions",
|
|
26932
|
+
"List all available DIM tools (instructions) with short descriptions. Use this to discover what you can do after dim_login.",
|
|
26933
|
+
{},
|
|
26934
|
+
async () => ({
|
|
26935
|
+
content: [
|
|
26936
|
+
{
|
|
26937
|
+
type: "text",
|
|
26938
|
+
text: JSON.stringify(
|
|
26939
|
+
{
|
|
26940
|
+
instructions: DIM_INSTRUCTIONS.map(({ name, description }) => ({
|
|
26941
|
+
name,
|
|
26942
|
+
description
|
|
26943
|
+
})),
|
|
26944
|
+
hint: "Call dim_login first if you have not authenticated. Then use any tool above by name."
|
|
26945
|
+
},
|
|
26946
|
+
null,
|
|
26947
|
+
2
|
|
26948
|
+
)
|
|
26949
|
+
}
|
|
26950
|
+
]
|
|
26951
|
+
})
|
|
26952
|
+
);
|
|
26953
|
+
}
|
|
26954
|
+
|
|
26782
26955
|
// src/resources.ts
|
|
26783
26956
|
function registerResources(server2, client) {
|
|
26784
26957
|
server2.resource(
|
|
@@ -26964,10 +27137,11 @@ function createDimMcpServer(config) {
|
|
|
26964
27137
|
const server2 = new McpServer({
|
|
26965
27138
|
name: "dim",
|
|
26966
27139
|
version: "1.0.0",
|
|
26967
|
-
description: "DIM Gaming Platform \u2014 Play games, chat, send USDC, challenge users, and earn referral income. Start by calling dim_login
|
|
27140
|
+
description: "DIM Gaming Platform \u2014 Play games, chat, send USDC, challenge users, and earn referral income. Start by calling dim_login. After login: set a username with dim_set_username, check balance with dim_get_balance, list games with dim_list_games, or apply a referral code with dim_apply_referral_code for a 10% fee discount."
|
|
26968
27141
|
});
|
|
26969
27142
|
const client = new DimClient(config);
|
|
26970
27143
|
registerAuthTools(server2, client);
|
|
27144
|
+
registerInstructionsTool(server2);
|
|
26971
27145
|
registerFriendsTools(server2, client);
|
|
26972
27146
|
registerChatTools(server2, client);
|
|
26973
27147
|
registerWalletTools(server2, client);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimcool/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "MCP server for DIM — lets AI agents play games, chat, send USDC, and earn referral income on the DIM platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"zustand": "^4.5.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@dimcool/sdk": "0.1.
|
|
45
|
+
"@dimcool/sdk": "0.1.10",
|
|
46
46
|
"@types/jest": "^29.5.2",
|
|
47
47
|
"@types/node": "^20.3.1",
|
|
48
48
|
"jest": "^29.5.0",
|