@liveauth-labs/mcp-server 0.1.0 → 0.6.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/README.md +184 -46
- package/TEST_SUMMARY.md +95 -0
- package/dist/index.js +254 -64
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +372 -0
- package/dist/index.test.js.map +1 -0
- package/package.json +8 -3
- package/src/index.test.ts +437 -0
- package/src/index.ts +347 -91
- package/test/manual-test.md +78 -0
- package/test/test-server.js +125 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -4,79 +4,143 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import fetch from 'node-fetch';
|
|
6
6
|
const LIVEAUTH_API_BASE = process.env.LIVEAUTH_API_BASE || 'https://api.liveauth.app';
|
|
7
|
-
|
|
7
|
+
const LIVEAUTH_API_KEY = process.env.LIVEAUTH_API_KEY || '';
|
|
8
|
+
// Store JWT after confirm (in-memory for the session)
|
|
9
|
+
let cachedJwt = null;
|
|
10
|
+
// Helper to build auth headers (optional API key)
|
|
11
|
+
function getAuthHeaders() {
|
|
12
|
+
const headers = {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
};
|
|
15
|
+
if (LIVEAUTH_API_KEY) {
|
|
16
|
+
headers['X-LW-Public'] = LIVEAUTH_API_KEY;
|
|
17
|
+
}
|
|
18
|
+
return headers;
|
|
19
|
+
}
|
|
20
|
+
// Define MCP tools
|
|
8
21
|
const TOOLS = [
|
|
9
22
|
{
|
|
10
|
-
name: '
|
|
11
|
-
description: '
|
|
23
|
+
name: 'liveauth_mcp_start',
|
|
24
|
+
description: 'Start a new LiveAuth MCP session. Returns a PoW challenge (default) or Lightning invoice (if forceLightning=true).',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
forceLightning: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
description: 'If true, request Lightning invoice instead of PoW challenge',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: [],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'liveauth_mcp_status',
|
|
38
|
+
description: 'Check the status of an MCP session. Use to poll for Lightning payment confirmation. Also returns the invoice via lnurl compatibility.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
quoteId: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'The quoteId from the start response',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
required: ['quoteId'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'liveauth_mcp_lnurl',
|
|
52
|
+
description: 'Get the Lightning invoice for a session (lnget-compatible). Use this to retrieve the BOLT11 invoice for payment.',
|
|
12
53
|
inputSchema: {
|
|
13
54
|
type: 'object',
|
|
14
55
|
properties: {
|
|
15
|
-
|
|
56
|
+
quoteId: {
|
|
16
57
|
type: 'string',
|
|
17
|
-
description: 'The
|
|
58
|
+
description: 'The quoteId from the start response',
|
|
18
59
|
},
|
|
19
60
|
},
|
|
20
|
-
required: ['
|
|
61
|
+
required: ['quoteId'],
|
|
21
62
|
},
|
|
22
63
|
},
|
|
23
64
|
{
|
|
24
|
-
name: '
|
|
25
|
-
description: '
|
|
65
|
+
name: 'liveauth_mcp_confirm',
|
|
66
|
+
description: 'Submit the solved proof-of-work challenge (or poll for Lightning payment) to receive a JWT. For Lightning, call with just quoteId to check/poll payment status.',
|
|
26
67
|
inputSchema: {
|
|
27
68
|
type: 'object',
|
|
28
69
|
properties: {
|
|
29
|
-
|
|
70
|
+
quoteId: {
|
|
30
71
|
type: 'string',
|
|
31
|
-
description: 'The
|
|
72
|
+
description: 'The quoteId from the start response',
|
|
32
73
|
},
|
|
33
74
|
challengeHex: {
|
|
34
75
|
type: 'string',
|
|
35
|
-
description: 'The challenge hex from
|
|
76
|
+
description: 'The challenge hex from the start response (PoW only)',
|
|
36
77
|
},
|
|
37
78
|
nonce: {
|
|
38
79
|
type: 'number',
|
|
39
|
-
description: 'The nonce that solves the challenge',
|
|
80
|
+
description: 'The nonce that solves the PoW challenge (PoW only)',
|
|
40
81
|
},
|
|
41
82
|
hashHex: {
|
|
42
83
|
type: 'string',
|
|
43
|
-
description: 'The resulting hash hex',
|
|
84
|
+
description: 'The resulting hash hex (PoW only)',
|
|
44
85
|
},
|
|
45
86
|
expiresAtUnix: {
|
|
46
87
|
type: 'number',
|
|
47
|
-
description: 'Expiration timestamp from challenge',
|
|
88
|
+
description: 'Expiration timestamp from the challenge (PoW only)',
|
|
48
89
|
},
|
|
49
90
|
difficultyBits: {
|
|
50
91
|
type: 'number',
|
|
51
|
-
description: 'Difficulty bits from challenge',
|
|
92
|
+
description: 'Difficulty bits from the challenge (PoW only)',
|
|
52
93
|
},
|
|
53
|
-
|
|
94
|
+
signature: {
|
|
54
95
|
type: 'string',
|
|
55
|
-
description: 'Signature from challenge',
|
|
96
|
+
description: 'Signature from the challenge (PoW only)',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['quoteId'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'liveauth_mcp_charge',
|
|
104
|
+
description: 'Meter API usage after making an authenticated call. Call this with the cost in sats for each API request made using the JWT.',
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
callCostSats: {
|
|
109
|
+
type: 'number',
|
|
110
|
+
description: 'Cost of the API call in sats',
|
|
56
111
|
},
|
|
57
112
|
},
|
|
58
|
-
required: ['
|
|
113
|
+
required: ['callCostSats'],
|
|
59
114
|
},
|
|
60
115
|
},
|
|
61
116
|
{
|
|
62
|
-
name: '
|
|
63
|
-
description: '
|
|
117
|
+
name: 'liveauth_mcp_usage',
|
|
118
|
+
description: 'Query current usage and remaining budget for the MCP session. Use this to check how many sats and calls have been used without making a charge.',
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {},
|
|
122
|
+
required: [],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'liveauth_mcp_refresh',
|
|
127
|
+
description: 'Refresh the JWT token without re-authenticating. Use the refreshToken returned from confirm to get a new JWT.',
|
|
64
128
|
inputSchema: {
|
|
65
129
|
type: 'object',
|
|
66
130
|
properties: {
|
|
67
|
-
|
|
131
|
+
refreshToken: {
|
|
68
132
|
type: 'string',
|
|
69
|
-
description: 'The
|
|
133
|
+
description: 'The refreshToken from the confirm response',
|
|
70
134
|
},
|
|
71
135
|
},
|
|
72
|
-
required: ['
|
|
136
|
+
required: ['refreshToken'],
|
|
73
137
|
},
|
|
74
138
|
},
|
|
75
139
|
];
|
|
76
140
|
// Create MCP server
|
|
77
141
|
const server = new Server({
|
|
78
142
|
name: 'liveauth-mcp',
|
|
79
|
-
version: '0.
|
|
143
|
+
version: '0.2.0',
|
|
80
144
|
}, {
|
|
81
145
|
capabilities: {
|
|
82
146
|
tools: {},
|
|
@@ -86,96 +150,222 @@ const server = new Server({
|
|
|
86
150
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
87
151
|
return { tools: TOOLS };
|
|
88
152
|
});
|
|
153
|
+
// Helper to check for errors in response
|
|
154
|
+
function isError(response) {
|
|
155
|
+
return typeof response === 'object' && response !== null && 'error' in response;
|
|
156
|
+
}
|
|
89
157
|
// Handle tool calls
|
|
90
158
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
91
159
|
const { name, arguments: args } = request.params;
|
|
92
160
|
try {
|
|
93
161
|
switch (name) {
|
|
94
|
-
case '
|
|
95
|
-
const {
|
|
96
|
-
const response = await fetch(`${LIVEAUTH_API_BASE}/api/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
162
|
+
case 'liveauth_mcp_start': {
|
|
163
|
+
const { forceLightning } = args;
|
|
164
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/start`, {
|
|
165
|
+
method: 'POST',
|
|
166
|
+
headers: getAuthHeaders(),
|
|
167
|
+
body: JSON.stringify({
|
|
168
|
+
forceLightning: forceLightning ?? false,
|
|
169
|
+
}),
|
|
101
170
|
});
|
|
102
171
|
if (!response.ok) {
|
|
103
|
-
|
|
172
|
+
const error = await response.json();
|
|
173
|
+
throw new Error(error.error_description || `Start failed: ${response.statusText}`);
|
|
104
174
|
}
|
|
105
|
-
const
|
|
175
|
+
const result = await response.json();
|
|
106
176
|
return {
|
|
107
177
|
content: [
|
|
108
178
|
{
|
|
109
179
|
type: 'text',
|
|
110
|
-
text: JSON.stringify(
|
|
180
|
+
text: JSON.stringify(result, null, 2),
|
|
111
181
|
},
|
|
112
182
|
],
|
|
113
183
|
};
|
|
114
184
|
}
|
|
115
|
-
case '
|
|
116
|
-
const
|
|
117
|
-
const
|
|
185
|
+
case 'liveauth_mcp_confirm': {
|
|
186
|
+
const { quoteId, challengeHex, nonce, hashHex, expiresAtUnix, difficultyBits, signature } = args;
|
|
187
|
+
const body = { quoteId };
|
|
188
|
+
// Add PoW fields if provided
|
|
189
|
+
if (challengeHex)
|
|
190
|
+
body.challengeHex = challengeHex;
|
|
191
|
+
if (nonce !== undefined)
|
|
192
|
+
body.nonce = nonce;
|
|
193
|
+
if (hashHex)
|
|
194
|
+
body.hashHex = hashHex;
|
|
195
|
+
if (expiresAtUnix)
|
|
196
|
+
body.expiresAtUnix = expiresAtUnix;
|
|
197
|
+
if (difficultyBits)
|
|
198
|
+
body.difficultyBits = difficultyBits;
|
|
199
|
+
if (signature)
|
|
200
|
+
body.sig = signature;
|
|
201
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/confirm`, {
|
|
118
202
|
method: 'POST',
|
|
119
|
-
headers:
|
|
120
|
-
|
|
121
|
-
'Content-Type': 'application/json',
|
|
122
|
-
},
|
|
123
|
-
body: JSON.stringify({
|
|
124
|
-
challengeHex: verifyArgs.challengeHex,
|
|
125
|
-
nonce: verifyArgs.nonce,
|
|
126
|
-
hashHex: verifyArgs.hashHex,
|
|
127
|
-
expiresAtUnix: verifyArgs.expiresAtUnix,
|
|
128
|
-
difficultyBits: verifyArgs.difficultyBits,
|
|
129
|
-
sig: verifyArgs.sig,
|
|
130
|
-
}),
|
|
203
|
+
headers: getAuthHeaders(),
|
|
204
|
+
body: JSON.stringify(body),
|
|
131
205
|
});
|
|
132
206
|
if (!response.ok) {
|
|
133
|
-
|
|
207
|
+
const error = await response.json();
|
|
208
|
+
throw new Error(error.error_description || `Confirm failed: ${response.statusText}`);
|
|
134
209
|
}
|
|
135
210
|
const result = await response.json();
|
|
136
|
-
|
|
211
|
+
// Handle Lightning pending status
|
|
212
|
+
if (result.paymentStatus === 'pending') {
|
|
137
213
|
return {
|
|
138
214
|
content: [
|
|
139
215
|
{
|
|
140
216
|
type: 'text',
|
|
141
|
-
text: `
|
|
217
|
+
text: `Lightning payment pending. Poll with liveauth_mcp_status using quoteId: ${quoteId}`,
|
|
142
218
|
},
|
|
143
219
|
],
|
|
144
220
|
};
|
|
145
221
|
}
|
|
146
|
-
|
|
222
|
+
// Cache JWT if we got one
|
|
223
|
+
if (result.jwt) {
|
|
224
|
+
cachedJwt = result.jwt;
|
|
225
|
+
}
|
|
226
|
+
// Log refresh token for user (but don't cache it)
|
|
227
|
+
if (result.refreshToken) {
|
|
228
|
+
console.error(`Refresh token: ${result.refreshToken} (save this to refresh without re-auth)`);
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
content: [
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
text: JSON.stringify(result, null, 2),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
case 'liveauth_mcp_charge': {
|
|
240
|
+
const { callCostSats } = args;
|
|
241
|
+
const authHeaders = {
|
|
242
|
+
'Content-Type': 'application/json',
|
|
243
|
+
};
|
|
244
|
+
if (cachedJwt) {
|
|
245
|
+
authHeaders['Authorization'] = `Bearer ${cachedJwt}`;
|
|
246
|
+
}
|
|
247
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/charge`, {
|
|
248
|
+
method: 'POST',
|
|
249
|
+
headers: authHeaders,
|
|
250
|
+
body: JSON.stringify({
|
|
251
|
+
callCostSats,
|
|
252
|
+
}),
|
|
253
|
+
});
|
|
254
|
+
if (!response.ok) {
|
|
255
|
+
const error = await response.json();
|
|
256
|
+
throw new Error(error.error_description || `Charge failed: ${response.statusText}`);
|
|
257
|
+
}
|
|
258
|
+
const result = await response.json();
|
|
259
|
+
// If status is 'deny', the agent has exceeded its budget
|
|
260
|
+
if (result.status === 'deny') {
|
|
147
261
|
return {
|
|
148
262
|
content: [
|
|
149
263
|
{
|
|
150
264
|
type: 'text',
|
|
151
|
-
text:
|
|
265
|
+
text: `Budget exceeded! Calls used: ${result.callsUsed}, Sats used: ${result.satsUsed}. Stop making API calls.`,
|
|
152
266
|
},
|
|
153
267
|
],
|
|
268
|
+
isError: true,
|
|
154
269
|
};
|
|
155
270
|
}
|
|
156
|
-
|
|
157
|
-
|
|
271
|
+
return {
|
|
272
|
+
content: [
|
|
273
|
+
{
|
|
274
|
+
type: 'text',
|
|
275
|
+
text: JSON.stringify(result, null, 2),
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
case 'liveauth_mcp_usage': {
|
|
281
|
+
const authHeaders = {
|
|
282
|
+
'Content-Type': 'application/json',
|
|
283
|
+
};
|
|
284
|
+
if (cachedJwt) {
|
|
285
|
+
authHeaders['Authorization'] = `Bearer ${cachedJwt}`;
|
|
286
|
+
}
|
|
287
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/usage`, {
|
|
288
|
+
method: 'GET',
|
|
289
|
+
headers: authHeaders,
|
|
290
|
+
});
|
|
291
|
+
if (!response.ok) {
|
|
292
|
+
const error = await response.json();
|
|
293
|
+
throw new Error(error.error_description || `Usage query failed: ${response.statusText}`);
|
|
294
|
+
}
|
|
295
|
+
const result = await response.json();
|
|
296
|
+
return {
|
|
297
|
+
content: [
|
|
298
|
+
{
|
|
299
|
+
type: 'text',
|
|
300
|
+
text: JSON.stringify(result, null, 2),
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
case 'liveauth_mcp_status': {
|
|
306
|
+
const { quoteId } = args;
|
|
307
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/status/${quoteId}`, {
|
|
308
|
+
method: 'GET',
|
|
309
|
+
headers: getAuthHeaders(),
|
|
310
|
+
});
|
|
311
|
+
if (!response.ok) {
|
|
312
|
+
const error = await response.json();
|
|
313
|
+
throw new Error(error.error_description || `Status check failed: ${response.statusText}`);
|
|
314
|
+
}
|
|
315
|
+
const result = await response.json();
|
|
316
|
+
return {
|
|
317
|
+
content: [
|
|
318
|
+
{
|
|
319
|
+
type: 'text',
|
|
320
|
+
text: JSON.stringify(result, null, 2),
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
case 'liveauth_mcp_lnurl': {
|
|
326
|
+
const { quoteId } = args;
|
|
327
|
+
// Use the new lnget-compatible endpoint
|
|
328
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/lnurl/${quoteId}`, {
|
|
329
|
+
method: 'GET',
|
|
330
|
+
headers: getAuthHeaders(),
|
|
331
|
+
});
|
|
332
|
+
if (!response.ok) {
|
|
333
|
+
const error = await response.json();
|
|
334
|
+
throw new Error(error.error_description || `Lnurl fetch failed: ${response.statusText}`);
|
|
158
335
|
}
|
|
336
|
+
const result = await response.json();
|
|
337
|
+
return {
|
|
338
|
+
content: [
|
|
339
|
+
{
|
|
340
|
+
type: 'text',
|
|
341
|
+
text: JSON.stringify(result, null, 2),
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
};
|
|
159
345
|
}
|
|
160
|
-
case '
|
|
161
|
-
const {
|
|
162
|
-
const response = await fetch(`${LIVEAUTH_API_BASE}/api/
|
|
346
|
+
case 'liveauth_mcp_refresh': {
|
|
347
|
+
const { refreshToken } = args;
|
|
348
|
+
const response = await fetch(`${LIVEAUTH_API_BASE}/api/mcp/refresh`, {
|
|
163
349
|
method: 'POST',
|
|
164
350
|
headers: {
|
|
165
|
-
'X-LW-Public': projectPublicKey,
|
|
166
351
|
'Content-Type': 'application/json',
|
|
167
352
|
},
|
|
168
|
-
body: JSON.stringify({
|
|
353
|
+
body: JSON.stringify({
|
|
354
|
+
refreshToken,
|
|
355
|
+
}),
|
|
169
356
|
});
|
|
170
357
|
if (!response.ok) {
|
|
171
|
-
|
|
358
|
+
const error = await response.json();
|
|
359
|
+
throw new Error(error.error_description || `Refresh failed: ${response.statusText}`);
|
|
172
360
|
}
|
|
173
|
-
const
|
|
361
|
+
const result = await response.json();
|
|
362
|
+
// Cache the new JWT
|
|
363
|
+
cachedJwt = result.jwt;
|
|
174
364
|
return {
|
|
175
365
|
content: [
|
|
176
366
|
{
|
|
177
367
|
type: 'text',
|
|
178
|
-
text:
|
|
368
|
+
text: JSON.stringify(result, null, 2),
|
|
179
369
|
},
|
|
180
370
|
],
|
|
181
371
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBA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