@dritan/mcp 0.1.1 → 0.2.7

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 (3) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +75 -6
  3. package/package.json +14 -4
package/README.md CHANGED
@@ -42,6 +42,9 @@ npm run build && npm start
42
42
  - `wallet_get_address`
43
43
  - `wallet_get_balance`
44
44
  - `market_get_snapshot`
45
+ - `token_get_price`
46
+ - `token_get_risk`
47
+ - `token_get_aggregated`
45
48
  - `market_stream_sample`
46
49
  - `swap_build`
47
50
  - `swap_sign_and_broadcast`
package/dist/index.js CHANGED
@@ -12,11 +12,17 @@ import { z } from "zod";
12
12
  const DEFAULT_WALLET_DIR = join(homedir(), ".config", "dritan-mcp", "wallets");
13
13
  const server = new Server({
14
14
  name: "dritan-mcp",
15
- version: "0.1.0",
15
+ version: "0.1.2",
16
16
  }, {
17
17
  capabilities: {
18
18
  tools: {},
19
19
  },
20
+ instructions: [
21
+ "This server requires a DRITAN_API_KEY environment variable to use market data and swap tools.",
22
+ "Get your API key at https://dritan.dev and configure it:",
23
+ " claude mcp add dritan-mcp -e DRITAN_API_KEY=<your-key> -- npx @dritan/mcp@latest",
24
+ "Without the key, only system_check_prereqs and wallet tools (create_local, get_address, get_balance) will work.",
25
+ ].join("\n"),
20
26
  });
21
27
  function getDritanClient() {
22
28
  const apiKey = process.env.DRITAN_API_KEY;
@@ -143,6 +149,9 @@ const marketSnapshotSchema = z.object({
143
149
  mint: z.string().min(1),
144
150
  mode: z.enum(["price", "metadata", "risk", "first-buyers", "aggregated"]).default("aggregated"),
145
151
  });
152
+ const tokenMintSchema = z.object({
153
+ mint: z.string().min(1),
154
+ });
146
155
  const marketStreamSampleSchema = z.object({
147
156
  dex: z.enum(["pumpamm", "pumpfun", "launchlab", "dlmm", "damm2", "damm1", "dbc"]),
148
157
  durationMs: z.number().int().min(500).max(60_000).default(10_000),
@@ -222,6 +231,39 @@ const tools = [
222
231
  },
223
232
  },
224
233
  },
234
+ {
235
+ name: "token_get_price",
236
+ description: "Fetch token price via Dritan (same as market_get_snapshot mode=price).",
237
+ inputSchema: {
238
+ type: "object",
239
+ required: ["mint"],
240
+ properties: {
241
+ mint: { type: "string" },
242
+ },
243
+ },
244
+ },
245
+ {
246
+ name: "token_get_risk",
247
+ description: "Fetch token risk via Dritan (same as market_get_snapshot mode=risk).",
248
+ inputSchema: {
249
+ type: "object",
250
+ required: ["mint"],
251
+ properties: {
252
+ mint: { type: "string" },
253
+ },
254
+ },
255
+ },
256
+ {
257
+ name: "token_get_aggregated",
258
+ description: "Fetch aggregated token data via Dritan (same as market_get_snapshot mode=aggregated).",
259
+ inputSchema: {
260
+ type: "object",
261
+ required: ["mint"],
262
+ properties: {
263
+ mint: { type: "string" },
264
+ },
265
+ },
266
+ },
225
267
  {
226
268
  name: "market_stream_sample",
227
269
  description: "Open a DEX websocket stream and collect events for a short duration.",
@@ -297,12 +339,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
297
339
  switch (request.params.name) {
298
340
  case "system_check_prereqs": {
299
341
  const solanaCli = checkSolanaCli();
342
+ const apiKeySet = !!process.env.DRITAN_API_KEY;
300
343
  return ok({
301
- ready: solanaCli.ok,
302
- checks: [solanaCli],
303
- nextAction: solanaCli.ok
304
- ? "Environment ready."
305
- : "Install Solana CLI using installHint, then retry wallet_create_local.",
344
+ ready: solanaCli.ok && apiKeySet,
345
+ checks: [
346
+ solanaCli,
347
+ {
348
+ ok: apiKeySet,
349
+ name: "DRITAN_API_KEY",
350
+ hint: apiKeySet
351
+ ? "API key is configured."
352
+ : "Missing DRITAN_API_KEY. Get your key at https://dritan.dev and set it as an environment variable.",
353
+ },
354
+ ],
355
+ nextAction: !apiKeySet
356
+ ? "Set DRITAN_API_KEY environment variable. Get your key at https://dritan.dev"
357
+ : !solanaCli.ok
358
+ ? "Install Solana CLI using installHint, then retry wallet_create_local."
359
+ : "Environment ready.",
306
360
  });
307
361
  }
308
362
  case "wallet_create_local": {
@@ -343,6 +397,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
343
397
  return ok(await client.getFirstBuyers(input.mint));
344
398
  return ok(await client.getTokenAggregated(input.mint));
345
399
  }
400
+ case "token_get_price": {
401
+ const input = tokenMintSchema.parse(args);
402
+ const client = getDritanClient();
403
+ return ok(await client.getTokenPrice(input.mint));
404
+ }
405
+ case "token_get_risk": {
406
+ const input = tokenMintSchema.parse(args);
407
+ const client = getDritanClient();
408
+ return ok(await client.getTokenRisk(input.mint));
409
+ }
410
+ case "token_get_aggregated": {
411
+ const input = tokenMintSchema.parse(args);
412
+ const client = getDritanClient();
413
+ return ok(await client.getTokenAggregated(input.mint));
414
+ }
346
415
  case "market_stream_sample": {
347
416
  const input = marketStreamSampleSchema.parse(args);
348
417
  const client = getDritanClient();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dritan/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "MCP server for Dritan SDK market data and local Solana wallet swap execution",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/dritan/dritan"
9
+ "url": "https://github.com/amirdauti/dritan-mcp"
10
10
  },
11
11
  "homepage": "https://dritan.dev",
12
12
  "bugs": {
@@ -25,7 +25,8 @@
25
25
  "build": "tsc -p tsconfig.json",
26
26
  "dev": "tsx src/index.ts",
27
27
  "start": "node dist/index.js",
28
- "lint": "tsc -p tsconfig.json --noEmit"
28
+ "lint": "tsc -p tsconfig.json --noEmit",
29
+ "release": "semantic-release"
29
30
  },
30
31
  "publishConfig": {
31
32
  "access": "public"
@@ -33,11 +34,20 @@
33
34
  "dependencies": {
34
35
  "@modelcontextprotocol/sdk": "^1.17.4",
35
36
  "@solana/web3.js": "^1.98.4",
36
- "dritan-sdk": "^0.1.1",
37
+ "dritan-sdk": "^0.1.3",
37
38
  "zod": "^3.24.1"
38
39
  },
39
40
  "devDependencies": {
41
+ "@semantic-release/changelog": "^6.0.3",
42
+ "@semantic-release/commit-analyzer": "^13.0.1",
43
+ "@semantic-release/exec": "^7.1.0",
44
+ "@semantic-release/git": "^10.0.1",
45
+ "@semantic-release/github": "^11.0.6",
46
+ "@semantic-release/npm": "^12.0.2",
47
+ "@semantic-release/release-notes-generator": "^14.1.0",
40
48
  "@types/node": "^22.14.0",
49
+ "conventional-changelog-conventionalcommits": "^9.1.0",
50
+ "semantic-release": "^24.2.9",
41
51
  "tsx": "^4.19.2",
42
52
  "typescript": "^5.8.2"
43
53
  }