@dritan/mcp 0.8.0 → 0.9.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.
- package/dist/index.js +12 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66,12 +66,13 @@ const server = new Server({
|
|
|
66
66
|
tools: {},
|
|
67
67
|
},
|
|
68
68
|
instructions: [
|
|
69
|
-
"
|
|
70
|
-
"
|
|
69
|
+
"API-key onboarding policy when DRITAN_API_KEY is missing:",
|
|
70
|
+
"Default path is x402-first. Do not ask user for an API key first.",
|
|
71
|
+
"1) x402 pay-per-use key flow (default):",
|
|
71
72
|
" a) Create a local agent wallet with wallet_create_local (saved in current working directory by default).",
|
|
72
73
|
" b) Ask user how much SOL they want to allocate and provide both wallet address and backup file path.",
|
|
73
74
|
" c) If no active key exists, create quote -> pay from agent wallet -> claim key.",
|
|
74
|
-
"2)
|
|
75
|
+
"2) Fallback only: if user explicitly declines funding or x402 cannot proceed, then offer free key flow at https://dritan.dev.",
|
|
75
76
|
"After key is obtained, set it with auth_set_api_key (no restart needed), or restart with DRITAN_API_KEY configured.",
|
|
76
77
|
"Suggested setup command:",
|
|
77
78
|
" claude mcp add dritan-mcp -e DRITAN_API_KEY=<your-key> -- npx @dritan/mcp@latest",
|
|
@@ -83,9 +84,9 @@ function getControlBaseUrl() {
|
|
|
83
84
|
function missingApiKeyError() {
|
|
84
85
|
return new Error([
|
|
85
86
|
"Missing DRITAN_API_KEY in environment.",
|
|
86
|
-
"
|
|
87
|
+
"Onboarding is x402-first by default: use wallet and x402 tools before asking user for an API key.",
|
|
87
88
|
"Paid flow order: create wallet in current directory -> tell user funding amount + backup file path -> if no key exists then create/claim x402 key.",
|
|
88
|
-
"
|
|
89
|
+
"Fallback only if user declines funding or x402 is not possible: user can create a free key at https://dritan.dev and set DRITAN_API_KEY.",
|
|
89
90
|
"You can activate a key immediately with auth_set_api_key without restarting MCP.",
|
|
90
91
|
].join(" "));
|
|
91
92
|
}
|
|
@@ -1115,11 +1116,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1115
1116
|
preview: apiKeyPreview(activeApiKey),
|
|
1116
1117
|
hint: apiKeySet
|
|
1117
1118
|
? "API key is configured."
|
|
1118
|
-
: "Missing DRITAN_API_KEY.
|
|
1119
|
+
: "Missing DRITAN_API_KEY. Start x402 flow first (wallet_create_local -> fund wallet -> quote/claim). Use free key only as fallback.",
|
|
1119
1120
|
},
|
|
1120
1121
|
],
|
|
1121
1122
|
nextAction: !apiKeySet
|
|
1122
|
-
? "
|
|
1123
|
+
? "Run x402-first onboarding now: wallet_create_local -> share wallet + backup file path -> ask funding amount -> x402_create_api_key_quote -> wallet_transfer_sol -> x402_create_api_key. Offer free key only if user declines or x402 cannot proceed."
|
|
1123
1124
|
: !solanaCli.ok
|
|
1124
1125
|
? "Install Solana CLI using installHint, then retry wallet_create_local."
|
|
1125
1126
|
: "Environment ready.",
|
|
@@ -1133,8 +1134,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1133
1134
|
preview: apiKeyPreview(activeApiKey),
|
|
1134
1135
|
controlBaseUrl: getControlBaseUrl(),
|
|
1135
1136
|
onboardingOptions: [
|
|
1136
|
-
"
|
|
1137
|
-
"
|
|
1137
|
+
"Default (x402-first): create wallet in current directory -> share wallet + backup file path -> user funds wallet -> if no key exists, quote/transfer/claim key.",
|
|
1138
|
+
"Fallback only: if user declines funding or x402 cannot proceed, user can create key at https://dritan.dev and set it with auth_set_api_key.",
|
|
1138
1139
|
],
|
|
1139
1140
|
...(activeApiKey ? buildPostAuthGuidance() : {}),
|
|
1140
1141
|
});
|
|
@@ -1231,8 +1232,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1231
1232
|
return ok({
|
|
1232
1233
|
...(pricing ?? {}),
|
|
1233
1234
|
onboardingOptions: [
|
|
1234
|
-
"
|
|
1235
|
-
"
|
|
1235
|
+
"Default (x402-first): create wallet in current directory -> share wallet + backup path -> user funds wallet -> if no key exists, quote/payment/claim.",
|
|
1236
|
+
"Fallback only: user gets API key at https://dritan.dev and provides it as DRITAN_API_KEY if x402 cannot proceed.",
|
|
1236
1237
|
],
|
|
1237
1238
|
});
|
|
1238
1239
|
}
|