@nordsym/apiclaw 1.0.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/.github/ISSUE_TEMPLATE/add-api.yml +123 -0
- package/BRIEFING.md +30 -0
- package/CONCEPT.md +494 -0
- package/README.md +272 -0
- package/backend/convex/README.md +90 -0
- package/backend/convex/_generated/api.d.ts +55 -0
- package/backend/convex/_generated/api.js +23 -0
- package/backend/convex/_generated/dataModel.d.ts +60 -0
- package/backend/convex/_generated/server.d.ts +143 -0
- package/backend/convex/_generated/server.js +93 -0
- package/backend/convex/apiKeys.ts +75 -0
- package/backend/convex/purchases.ts +74 -0
- package/backend/convex/schema.ts +45 -0
- package/backend/convex/transactions.ts +57 -0
- package/backend/convex/tsconfig.json +25 -0
- package/backend/convex/users.ts +94 -0
- package/backend/package-lock.json +521 -0
- package/backend/package.json +15 -0
- package/dist/credits.d.ts +54 -0
- package/dist/credits.d.ts.map +1 -0
- package/dist/credits.js +209 -0
- package/dist/credits.js.map +1 -0
- package/dist/discovery.d.ts +37 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +109 -0
- package/dist/discovery.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +355 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/apis.json +20894 -0
- package/dist/registry/parse_apis.py +146 -0
- package/dist/revenuecat.d.ts +61 -0
- package/dist/revenuecat.d.ts.map +1 -0
- package/dist/revenuecat.js +166 -0
- package/dist/revenuecat.js.map +1 -0
- package/dist/test.d.ts +6 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +81 -0
- package/dist/test.js.map +1 -0
- package/dist/types.d.ts +96 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/webhooks/revenuecat.d.ts +48 -0
- package/dist/webhooks/revenuecat.d.ts.map +1 -0
- package/dist/webhooks/revenuecat.js +119 -0
- package/dist/webhooks/revenuecat.js.map +1 -0
- package/docs/revenuecat-setup.md +89 -0
- package/landing/next-env.d.ts +5 -0
- package/landing/next.config.mjs +6 -0
- package/landing/package-lock.json +1666 -0
- package/landing/package.json +27 -0
- package/landing/postcss.config.js +6 -0
- package/landing/src/app/api/keys/route.ts +71 -0
- package/landing/src/app/api/log/route.ts +37 -0
- package/landing/src/app/api/stats/route.ts +37 -0
- package/landing/src/app/globals.css +261 -0
- package/landing/src/app/layout.tsx +37 -0
- package/landing/src/app/page.tsx +753 -0
- package/landing/src/app/page.tsx.bak +567 -0
- package/landing/src/components/AddKeyModal.tsx +159 -0
- package/landing/tailwind.config.ts +34 -0
- package/landing/tsconfig.json +20 -0
- package/newsletter-template.html +71 -0
- package/outreach/OUTREACH-SYSTEM.md +211 -0
- package/outreach/email-template.html +179 -0
- package/outreach/targets.md +133 -0
- package/package.json +39 -0
- package/src/credits.ts +261 -0
- package/src/discovery.ts +147 -0
- package/src/index.ts +396 -0
- package/src/registry/apis.json +20894 -0
- package/src/registry/parse_apis.py +146 -0
- package/src/revenuecat.ts +239 -0
- package/src/test.ts +97 -0
- package/src/types.ts +110 -0
- package/src/webhooks/revenuecat.ts +187 -0
- package/tsconfig.json +20 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* APIvault - Agent-Native API Discovery MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Tools:
|
|
6
|
+
* - discover_apis: Search for APIs by capability
|
|
7
|
+
* - get_api_details: Get full info about an API
|
|
8
|
+
* - purchase_access: Buy API access with credits
|
|
9
|
+
* - check_balance: Check credits and active purchases
|
|
10
|
+
* - add_credits: Add credits to account (for testing)
|
|
11
|
+
*/
|
|
12
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
13
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
14
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
15
|
+
import { discoverAPIs, getAPIDetails, getCategories, getAllAPIs, getAPICount } from './discovery.js';
|
|
16
|
+
import { addCredits, purchaseAPIAccess, getBalanceSummary } from './credits.js';
|
|
17
|
+
// Default agent ID for MVP (in production, this would come from auth)
|
|
18
|
+
const DEFAULT_AGENT_ID = 'agent_default';
|
|
19
|
+
// Tool definitions
|
|
20
|
+
const tools = [
|
|
21
|
+
{
|
|
22
|
+
name: 'discover_apis',
|
|
23
|
+
description: 'Search 1400+ APIs based on what you need to do. Describe your use case naturally.',
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
query: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Natural language query describing what you need (e.g., "send SMS", "weather data", "payment processing", "text to speech")'
|
|
30
|
+
},
|
|
31
|
+
category: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Filter by category (use list_categories to see all)'
|
|
34
|
+
},
|
|
35
|
+
max_results: {
|
|
36
|
+
type: 'number',
|
|
37
|
+
description: 'Maximum number of results to return (default: 10)',
|
|
38
|
+
default: 10
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
required: ['query']
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'get_api_details',
|
|
46
|
+
description: 'Get detailed information about a specific API provider, including endpoints, pricing, and features.',
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
api_id: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The API provider ID (e.g., "46elks", "resend", "openrouter")'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
required: ['api_id']
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'purchase_access',
|
|
60
|
+
description: 'Purchase access to an API using your credit balance. Returns API credentials on success.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
api_id: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'The API provider ID to purchase access to'
|
|
67
|
+
},
|
|
68
|
+
amount_usd: {
|
|
69
|
+
type: 'number',
|
|
70
|
+
description: 'Amount in USD to spend on this API'
|
|
71
|
+
},
|
|
72
|
+
agent_id: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Your agent identifier (optional, uses default if not provided)'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
required: ['api_id', 'amount_usd']
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'check_balance',
|
|
82
|
+
description: 'Check your credit balance and list active API purchases.',
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
agent_id: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'Your agent identifier (optional, uses default if not provided)'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'add_credits',
|
|
95
|
+
description: 'Add credits to your account. (For testing/demo purposes)',
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: {
|
|
99
|
+
amount_usd: {
|
|
100
|
+
type: 'number',
|
|
101
|
+
description: 'Amount in USD to add to your balance'
|
|
102
|
+
},
|
|
103
|
+
agent_id: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'Your agent identifier (optional, uses default if not provided)'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
required: ['amount_usd']
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'list_categories',
|
|
113
|
+
description: 'List all available API categories.',
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
// Create server
|
|
121
|
+
const server = new Server({
|
|
122
|
+
name: 'apivault',
|
|
123
|
+
version: '0.1.0',
|
|
124
|
+
}, {
|
|
125
|
+
capabilities: {
|
|
126
|
+
tools: {},
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
// Handle list tools
|
|
130
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
131
|
+
return { tools };
|
|
132
|
+
});
|
|
133
|
+
// Handle tool calls
|
|
134
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
135
|
+
const { name, arguments: args } = request.params;
|
|
136
|
+
try {
|
|
137
|
+
switch (name) {
|
|
138
|
+
case 'discover_apis': {
|
|
139
|
+
const query = args?.query;
|
|
140
|
+
const category = args?.category;
|
|
141
|
+
const maxResults = args?.max_results || 10;
|
|
142
|
+
const results = discoverAPIs(query, { category, maxResults });
|
|
143
|
+
if (results.length === 0) {
|
|
144
|
+
return {
|
|
145
|
+
content: [
|
|
146
|
+
{
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: JSON.stringify({
|
|
149
|
+
status: 'no_results',
|
|
150
|
+
message: `No APIs found matching "${query}". Try broader terms or check available categories with list_categories.`,
|
|
151
|
+
total_apis: getAPICount(),
|
|
152
|
+
available_categories: getCategories().slice(0, 20)
|
|
153
|
+
}, null, 2)
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
content: [
|
|
160
|
+
{
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: JSON.stringify({
|
|
163
|
+
status: 'success',
|
|
164
|
+
query,
|
|
165
|
+
results_count: results.length,
|
|
166
|
+
total_apis: getAPICount(),
|
|
167
|
+
results: results.map(r => ({
|
|
168
|
+
id: r.api.id,
|
|
169
|
+
name: r.api.name,
|
|
170
|
+
description: r.api.description,
|
|
171
|
+
category: r.api.category,
|
|
172
|
+
auth: r.api.auth,
|
|
173
|
+
https: r.api.https,
|
|
174
|
+
link: r.api.link,
|
|
175
|
+
pricing: r.api.pricing,
|
|
176
|
+
keywords: r.api.keywords,
|
|
177
|
+
relevance_score: r.relevance_score,
|
|
178
|
+
match_reasons: r.match_reasons
|
|
179
|
+
}))
|
|
180
|
+
}, null, 2)
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
case 'get_api_details': {
|
|
186
|
+
const apiId = args?.api_id;
|
|
187
|
+
const api = getAPIDetails(apiId);
|
|
188
|
+
if (!api) {
|
|
189
|
+
return {
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
text: JSON.stringify({
|
|
194
|
+
status: 'error',
|
|
195
|
+
message: `API not found: ${apiId}`,
|
|
196
|
+
available_apis: getAllAPIs().map(a => a.id)
|
|
197
|
+
}, null, 2)
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
content: [
|
|
204
|
+
{
|
|
205
|
+
type: 'text',
|
|
206
|
+
text: JSON.stringify({
|
|
207
|
+
status: 'success',
|
|
208
|
+
api
|
|
209
|
+
}, null, 2)
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
case 'purchase_access': {
|
|
215
|
+
const apiId = args?.api_id;
|
|
216
|
+
const amountUsd = args?.amount_usd;
|
|
217
|
+
const agentId = args?.agent_id || DEFAULT_AGENT_ID;
|
|
218
|
+
const result = purchaseAPIAccess(agentId, apiId, amountUsd);
|
|
219
|
+
if (!result.success) {
|
|
220
|
+
return {
|
|
221
|
+
content: [
|
|
222
|
+
{
|
|
223
|
+
type: 'text',
|
|
224
|
+
text: JSON.stringify({
|
|
225
|
+
status: 'error',
|
|
226
|
+
message: result.error
|
|
227
|
+
}, null, 2)
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
const api = getAPIDetails(apiId);
|
|
233
|
+
return {
|
|
234
|
+
content: [
|
|
235
|
+
{
|
|
236
|
+
type: 'text',
|
|
237
|
+
text: JSON.stringify({
|
|
238
|
+
status: 'success',
|
|
239
|
+
message: `Successfully purchased access to ${apiId}`,
|
|
240
|
+
purchase: {
|
|
241
|
+
id: result.purchase.id,
|
|
242
|
+
provider: apiId,
|
|
243
|
+
amount_paid_usd: amountUsd,
|
|
244
|
+
credits_received: result.purchase.credits_purchased,
|
|
245
|
+
status: result.purchase.status
|
|
246
|
+
},
|
|
247
|
+
credentials: result.purchase.credentials,
|
|
248
|
+
access: {
|
|
249
|
+
link: api?.link,
|
|
250
|
+
auth: api?.auth
|
|
251
|
+
}
|
|
252
|
+
}, null, 2)
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
case 'check_balance': {
|
|
258
|
+
const agentId = args?.agent_id || DEFAULT_AGENT_ID;
|
|
259
|
+
const summary = getBalanceSummary(agentId);
|
|
260
|
+
return {
|
|
261
|
+
content: [
|
|
262
|
+
{
|
|
263
|
+
type: 'text',
|
|
264
|
+
text: JSON.stringify({
|
|
265
|
+
status: 'success',
|
|
266
|
+
agent_id: agentId,
|
|
267
|
+
balance_usd: summary.credits.balance_usd,
|
|
268
|
+
currency: summary.credits.currency,
|
|
269
|
+
total_spent_usd: summary.total_spent_usd,
|
|
270
|
+
active_purchases: summary.active_purchases.map(p => ({
|
|
271
|
+
id: p.id,
|
|
272
|
+
provider: p.provider_id,
|
|
273
|
+
credits_remaining: p.credits_purchased, // Would track actual usage in production
|
|
274
|
+
status: p.status
|
|
275
|
+
}))
|
|
276
|
+
}, null, 2)
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
case 'add_credits': {
|
|
282
|
+
const amountUsd = args?.amount_usd;
|
|
283
|
+
const agentId = args?.agent_id || DEFAULT_AGENT_ID;
|
|
284
|
+
const credits = addCredits(agentId, amountUsd);
|
|
285
|
+
return {
|
|
286
|
+
content: [
|
|
287
|
+
{
|
|
288
|
+
type: 'text',
|
|
289
|
+
text: JSON.stringify({
|
|
290
|
+
status: 'success',
|
|
291
|
+
message: `Added $${amountUsd.toFixed(2)} to your account`,
|
|
292
|
+
new_balance_usd: credits.balance_usd
|
|
293
|
+
}, null, 2)
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
case 'list_categories': {
|
|
299
|
+
const categories = getCategories();
|
|
300
|
+
const categoryCounts = {};
|
|
301
|
+
for (const cat of categories) {
|
|
302
|
+
categoryCounts[cat] = getAllAPIs().filter(a => a.category === cat).length;
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
content: [
|
|
306
|
+
{
|
|
307
|
+
type: 'text',
|
|
308
|
+
text: JSON.stringify({
|
|
309
|
+
status: 'success',
|
|
310
|
+
total_apis: getAPICount(),
|
|
311
|
+
category_count: categories.length,
|
|
312
|
+
categories: categoryCounts
|
|
313
|
+
}, null, 2)
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
default:
|
|
319
|
+
return {
|
|
320
|
+
content: [
|
|
321
|
+
{
|
|
322
|
+
type: 'text',
|
|
323
|
+
text: JSON.stringify({
|
|
324
|
+
status: 'error',
|
|
325
|
+
message: `Unknown tool: ${name}`
|
|
326
|
+
}, null, 2)
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
isError: true
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
return {
|
|
335
|
+
content: [
|
|
336
|
+
{
|
|
337
|
+
type: 'text',
|
|
338
|
+
text: JSON.stringify({
|
|
339
|
+
status: 'error',
|
|
340
|
+
message: error instanceof Error ? error.message : 'Unknown error'
|
|
341
|
+
}, null, 2)
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
isError: true
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
// Start server
|
|
349
|
+
async function main() {
|
|
350
|
+
const transport = new StdioServerTransport();
|
|
351
|
+
await server.connect(transport);
|
|
352
|
+
console.error('APIvault MCP server running on stdio');
|
|
353
|
+
}
|
|
354
|
+
main().catch(console.error);
|
|
355
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAEL,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EAElB,MAAM,cAAc,CAAC;AAEtB,sEAAsE;AACtE,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,mBAAmB;AACnB,MAAM,KAAK,GAAW;IACpB;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,mFAAmF;QAChG,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,4HAA4H;iBAC1I;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qDAAqD;iBACnE;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mDAAmD;oBAChE,OAAO,EAAE,EAAE;iBACZ;aACF;YACD,QAAQ,EAAE,CAAC,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