@entroute/mcp-server 0.1.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.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +451 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* EntRoute MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Model Context Protocol server for agent integration.
|
|
6
|
+
* Provides tools for discovering and calling pay-per-request APIs.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - discover_paid_api: Find endpoints for a capability
|
|
10
|
+
* - list_capabilities: Browse available capability types
|
|
11
|
+
* - call_paid_api: Execute a discovered endpoint (with x402 v2 payment handling)
|
|
12
|
+
*
|
|
13
|
+
* Environment variables:
|
|
14
|
+
* - ENTROUTE_API_URL: API base URL (default: http://localhost:8787)
|
|
15
|
+
* - EVM_PRIVATE_KEY: Hex private key (0x...) for automatic x402 payments
|
|
16
|
+
* - MAX_PAYMENT_PER_REQUEST: Max USD per request (default: 0.05)
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* EntRoute MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Model Context Protocol server for agent integration.
|
|
6
|
+
* Provides tools for discovering and calling pay-per-request APIs.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - discover_paid_api: Find endpoints for a capability
|
|
10
|
+
* - list_capabilities: Browse available capability types
|
|
11
|
+
* - call_paid_api: Execute a discovered endpoint (with x402 v2 payment handling)
|
|
12
|
+
*
|
|
13
|
+
* Environment variables:
|
|
14
|
+
* - ENTROUTE_API_URL: API base URL (default: http://localhost:8787)
|
|
15
|
+
* - EVM_PRIVATE_KEY: Hex private key (0x...) for automatic x402 payments
|
|
16
|
+
* - MAX_PAYMENT_PER_REQUEST: Max USD per request (default: 0.05)
|
|
17
|
+
*/
|
|
18
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
19
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
20
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
21
|
+
import { EntRouteClient, PaymentRequiredError, PaymentExceedsLimitError, } from '@entroute/sdk-agent-ts';
|
|
22
|
+
// Payment configuration from environment
|
|
23
|
+
const evmPrivateKey = process.env.EVM_PRIVATE_KEY;
|
|
24
|
+
const maxPaymentPerRequest = process.env.MAX_PAYMENT_PER_REQUEST
|
|
25
|
+
? parseFloat(process.env.MAX_PAYMENT_PER_REQUEST)
|
|
26
|
+
: 0.05;
|
|
27
|
+
const paymentConfigured = !!evmPrivateKey;
|
|
28
|
+
// Initialize client with optional payment support
|
|
29
|
+
const client = new EntRouteClient({
|
|
30
|
+
baseUrl: process.env.ENTROUTE_API_URL || 'http://localhost:8787',
|
|
31
|
+
clientId: 'mcp-server',
|
|
32
|
+
autoReportOutcomes: true,
|
|
33
|
+
evmPrivateKey: evmPrivateKey,
|
|
34
|
+
maxPaymentPerRequest,
|
|
35
|
+
});
|
|
36
|
+
if (paymentConfigured) {
|
|
37
|
+
console.error(`Payment enabled: wallet ${client.walletAddress}, max $${maxPaymentPerRequest}/request`);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.error('Payment not configured. Set EVM_PRIVATE_KEY to enable automatic x402 payments.');
|
|
41
|
+
}
|
|
42
|
+
// Store discovered endpoints for call_paid_api
|
|
43
|
+
const endpointCache = new Map();
|
|
44
|
+
const server = new Server({
|
|
45
|
+
name: 'entroute',
|
|
46
|
+
version: '0.1.0',
|
|
47
|
+
}, {
|
|
48
|
+
capabilities: {
|
|
49
|
+
tools: {},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
// Build dynamic tool description for call_paid_api based on payment config
|
|
53
|
+
const callApiDescription = paymentConfigured
|
|
54
|
+
? `Call a previously discovered API endpoint.
|
|
55
|
+
|
|
56
|
+
Use this after discover_paid_api to execute the request.
|
|
57
|
+
Automatically handles x402 payments up to $${maxPaymentPerRequest.toFixed(2)} per request using the configured wallet.
|
|
58
|
+
|
|
59
|
+
IMPORTANT: You must first use discover_paid_api to find an endpoint.
|
|
60
|
+
Then use the endpoint_id from the discovery result.`
|
|
61
|
+
: `Call a previously discovered API endpoint.
|
|
62
|
+
|
|
63
|
+
Use this after discover_paid_api to execute the request.
|
|
64
|
+
Payment-required endpoints (402) will return an error with payment details since no wallet is configured.
|
|
65
|
+
|
|
66
|
+
IMPORTANT: You must first use discover_paid_api to find an endpoint.
|
|
67
|
+
Then use the endpoint_id from the discovery result.`;
|
|
68
|
+
// List available tools
|
|
69
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
70
|
+
return {
|
|
71
|
+
tools: [
|
|
72
|
+
{
|
|
73
|
+
name: 'discover_paid_api',
|
|
74
|
+
description: `Discover pay-per-request API endpoints for a given capability.
|
|
75
|
+
|
|
76
|
+
Returns ranked, verified endpoints with pricing and reliability metrics.
|
|
77
|
+
Use this to find APIs before calling them. The results include:
|
|
78
|
+
- Endpoint URL and method
|
|
79
|
+
- Price per call and payment network
|
|
80
|
+
- Success rate and latency metrics
|
|
81
|
+
- Provider information
|
|
82
|
+
|
|
83
|
+
After discovering, you can use call_paid_api to execute the endpoint.`,
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
intent: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'Natural language description of what you want to do (e.g., "get current weather for London", "translate text to Spanish")',
|
|
90
|
+
},
|
|
91
|
+
capability_id: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'Explicit capability ID if known (e.g., "weather.current", "translate.text"). Use this for precise matching.',
|
|
94
|
+
},
|
|
95
|
+
max_price: {
|
|
96
|
+
type: 'number',
|
|
97
|
+
description: 'Maximum price per request in USD (e.g., 0.01 for 1 cent)',
|
|
98
|
+
},
|
|
99
|
+
network: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
description: 'Required blockchain network for payment',
|
|
102
|
+
enum: ['base', 'ethereum', 'solana', 'polygon', 'arbitrum'],
|
|
103
|
+
},
|
|
104
|
+
ranking_preset: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
description: 'Ranking preference preset',
|
|
107
|
+
enum: ['default', 'reliability', 'speed', 'budget', 'balanced'],
|
|
108
|
+
},
|
|
109
|
+
limit: {
|
|
110
|
+
type: 'number',
|
|
111
|
+
description: 'Maximum number of endpoints to return (default: 5)',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
oneOf: [{ required: ['intent'] }, { required: ['capability_id'] }],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'list_capabilities',
|
|
119
|
+
description: `List available API capability types.
|
|
120
|
+
|
|
121
|
+
Use this to explore what kinds of APIs are available in the registry.
|
|
122
|
+
You can filter by tag (e.g., "weather", "translation") or search by keyword.`,
|
|
123
|
+
inputSchema: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
tag: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
description: 'Filter by tag (e.g., "weather", "translation", "finance")',
|
|
129
|
+
},
|
|
130
|
+
search: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'Search capabilities by keyword',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'call_paid_api',
|
|
139
|
+
description: callApiDescription,
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: 'object',
|
|
142
|
+
properties: {
|
|
143
|
+
endpoint_id: {
|
|
144
|
+
type: 'string',
|
|
145
|
+
description: 'The endpoint_id from a previous discover_paid_api result',
|
|
146
|
+
},
|
|
147
|
+
method: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
description: 'HTTP method (defaults to endpoint method)',
|
|
150
|
+
enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
|
|
151
|
+
},
|
|
152
|
+
headers: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
description: 'Additional headers to include in the request',
|
|
155
|
+
additionalProperties: { type: 'string' },
|
|
156
|
+
},
|
|
157
|
+
body: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
description: 'Request body (for POST/PUT/PATCH)',
|
|
160
|
+
additionalProperties: true,
|
|
161
|
+
},
|
|
162
|
+
query_params: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
description: 'Query parameters to append to URL',
|
|
165
|
+
additionalProperties: { type: 'string' },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
required: ['endpoint_id'],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
// Handle tool calls
|
|
175
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
176
|
+
const { name, arguments: args } = request.params;
|
|
177
|
+
switch (name) {
|
|
178
|
+
case 'discover_paid_api':
|
|
179
|
+
return handleDiscover(args);
|
|
180
|
+
case 'list_capabilities':
|
|
181
|
+
return handleListCapabilities(args);
|
|
182
|
+
case 'call_paid_api':
|
|
183
|
+
return handleCallApi(args);
|
|
184
|
+
default:
|
|
185
|
+
return {
|
|
186
|
+
content: [{ type: 'text', text: JSON.stringify({ error: `Unknown tool: ${name}` }) }],
|
|
187
|
+
isError: true,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
async function handleDiscover(args) {
|
|
192
|
+
try {
|
|
193
|
+
const result = args.intent
|
|
194
|
+
? await client.discoverByIntent(args.intent, {
|
|
195
|
+
constraints: {
|
|
196
|
+
max_price: args.max_price,
|
|
197
|
+
network: args.network,
|
|
198
|
+
},
|
|
199
|
+
preferences: {
|
|
200
|
+
ranking_preset: args.ranking_preset,
|
|
201
|
+
limit: args.limit,
|
|
202
|
+
include_fallbacks: true,
|
|
203
|
+
},
|
|
204
|
+
})
|
|
205
|
+
: await client.discoverByCapability(args.capability_id, undefined, {
|
|
206
|
+
constraints: {
|
|
207
|
+
max_price: args.max_price,
|
|
208
|
+
network: args.network,
|
|
209
|
+
},
|
|
210
|
+
preferences: {
|
|
211
|
+
ranking_preset: args.ranking_preset,
|
|
212
|
+
limit: args.limit,
|
|
213
|
+
include_fallbacks: true,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
// Cache endpoints for later use with call_paid_api
|
|
217
|
+
for (const ep of result.ranked_endpoints) {
|
|
218
|
+
endpointCache.set(ep.endpoint_id, ep);
|
|
219
|
+
}
|
|
220
|
+
if (result.fallback_endpoints) {
|
|
221
|
+
for (const ep of result.fallback_endpoints) {
|
|
222
|
+
endpointCache.set(ep.endpoint_id, ep);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Format response for the model
|
|
226
|
+
const endpoints = result.ranked_endpoints.map((ep) => formatEndpoint(ep));
|
|
227
|
+
const fallbacks = result.fallback_endpoints?.map((ep) => ({
|
|
228
|
+
...formatEndpoint(ep),
|
|
229
|
+
exclusion_reasons: ep.exclusion_reasons,
|
|
230
|
+
}));
|
|
231
|
+
const response = {
|
|
232
|
+
capability: result.resolved.capability_id,
|
|
233
|
+
confidence: result.resolved.confidence,
|
|
234
|
+
candidates: result.resolved.candidates,
|
|
235
|
+
endpoints,
|
|
236
|
+
fallbacks: fallbacks?.length ? fallbacks : undefined,
|
|
237
|
+
ranking: result.ranking_info,
|
|
238
|
+
ttl_seconds: result.ttl_seconds,
|
|
239
|
+
payment_enabled: paymentConfigured,
|
|
240
|
+
usage_hint: endpoints.length > 0
|
|
241
|
+
? `Use call_paid_api with endpoint_id "${endpoints[0].endpoint_id}" to call the top result.`
|
|
242
|
+
: 'No endpoints found. Try broadening your search or using a fallback.',
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
const message = error instanceof Error ? error.message : 'Discovery failed';
|
|
250
|
+
return {
|
|
251
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
252
|
+
isError: true,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
async function handleListCapabilities(args) {
|
|
257
|
+
try {
|
|
258
|
+
const result = await client.listCapabilities({
|
|
259
|
+
tag: args.tag,
|
|
260
|
+
search: args.search,
|
|
261
|
+
});
|
|
262
|
+
const capabilities = result.capabilities.map((cap) => ({
|
|
263
|
+
id: cap.id,
|
|
264
|
+
title: cap.title,
|
|
265
|
+
description: cap.description,
|
|
266
|
+
tags: cap.tags,
|
|
267
|
+
}));
|
|
268
|
+
return {
|
|
269
|
+
content: [
|
|
270
|
+
{
|
|
271
|
+
type: 'text',
|
|
272
|
+
text: JSON.stringify({
|
|
273
|
+
version: result.version,
|
|
274
|
+
count: capabilities.length,
|
|
275
|
+
capabilities,
|
|
276
|
+
usage_hint: 'Use discover_paid_api with a capability_id to find endpoints.',
|
|
277
|
+
}, null, 2),
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
const message = error instanceof Error ? error.message : 'Failed to list capabilities';
|
|
284
|
+
return {
|
|
285
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
286
|
+
isError: true,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async function handleCallApi(args) {
|
|
291
|
+
const endpoint = endpointCache.get(args.endpoint_id);
|
|
292
|
+
if (!endpoint) {
|
|
293
|
+
return {
|
|
294
|
+
content: [
|
|
295
|
+
{
|
|
296
|
+
type: 'text',
|
|
297
|
+
text: JSON.stringify({
|
|
298
|
+
error: 'Endpoint not found in cache. Use discover_paid_api first to find endpoints.',
|
|
299
|
+
hint: 'The endpoint_id must come from a recent discover_paid_api result.',
|
|
300
|
+
}),
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
isError: true,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
// Build query params into body for GET requests if needed
|
|
308
|
+
let requestBody = args.body;
|
|
309
|
+
if (args.query_params && Object.keys(args.query_params).length > 0) {
|
|
310
|
+
if (endpoint.method === 'GET' || args.method === 'GET') {
|
|
311
|
+
// For GET, merge query_params into body so buildRequestUrl handles them
|
|
312
|
+
requestBody = { ...requestBody, ...args.query_params };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// Use SDK's callEndpoint which handles x402 v2 payments automatically
|
|
316
|
+
const result = await client.callEndpoint(endpoint, {
|
|
317
|
+
buildRequest: (ep) => {
|
|
318
|
+
let url = ep.url;
|
|
319
|
+
// Append query params for non-GET methods
|
|
320
|
+
if (args.query_params && Object.keys(args.query_params).length > 0 && ep.method !== 'GET') {
|
|
321
|
+
const params = new URLSearchParams(args.query_params);
|
|
322
|
+
url += (url.includes('?') ? '&' : '?') + params.toString();
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
method: args.method || ep.method,
|
|
326
|
+
headers: {
|
|
327
|
+
'Content-Type': 'application/json',
|
|
328
|
+
'Accept': 'application/json',
|
|
329
|
+
...args.headers,
|
|
330
|
+
},
|
|
331
|
+
body: args.body ? JSON.stringify(args.body) : undefined,
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
body: requestBody,
|
|
335
|
+
timeout: 30000,
|
|
336
|
+
autoPay: paymentConfigured,
|
|
337
|
+
});
|
|
338
|
+
const response = {
|
|
339
|
+
status: result.status,
|
|
340
|
+
data: result.data,
|
|
341
|
+
latency_ms: result.latencyMs,
|
|
342
|
+
endpoint: {
|
|
343
|
+
url: endpoint.url,
|
|
344
|
+
provider: endpoint.provider_name,
|
|
345
|
+
},
|
|
346
|
+
};
|
|
347
|
+
// Include payment receipt if payment was made
|
|
348
|
+
if (result.payment) {
|
|
349
|
+
response.payment = {
|
|
350
|
+
amount: result.payment.amount,
|
|
351
|
+
asset: result.payment.asset,
|
|
352
|
+
network: result.payment.network,
|
|
353
|
+
recipient: result.payment.recipient,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
content: [
|
|
358
|
+
{
|
|
359
|
+
type: 'text',
|
|
360
|
+
text: JSON.stringify(response, null, 2),
|
|
361
|
+
},
|
|
362
|
+
],
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
// Handle payment-specific errors with helpful messages
|
|
367
|
+
if (error instanceof PaymentRequiredError) {
|
|
368
|
+
return {
|
|
369
|
+
content: [
|
|
370
|
+
{
|
|
371
|
+
type: 'text',
|
|
372
|
+
text: JSON.stringify({
|
|
373
|
+
status: 402,
|
|
374
|
+
message: 'Payment required but no wallet configured',
|
|
375
|
+
payment_info: {
|
|
376
|
+
payTo: error.paymentChallenge.payTo,
|
|
377
|
+
amount: error.paymentChallenge.maxAmountRequired,
|
|
378
|
+
network: error.paymentChallenge.network,
|
|
379
|
+
asset: error.paymentChallenge.asset,
|
|
380
|
+
endpoint_price: endpoint.payment.price_per_call,
|
|
381
|
+
},
|
|
382
|
+
hint: 'Set EVM_PRIVATE_KEY environment variable to enable automatic payments.',
|
|
383
|
+
}),
|
|
384
|
+
},
|
|
385
|
+
],
|
|
386
|
+
isError: true,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
if (error instanceof PaymentExceedsLimitError) {
|
|
390
|
+
return {
|
|
391
|
+
content: [
|
|
392
|
+
{
|
|
393
|
+
type: 'text',
|
|
394
|
+
text: JSON.stringify({
|
|
395
|
+
status: 402,
|
|
396
|
+
message: `Payment of $${error.requestedAmount.toFixed(4)} exceeds limit of $${error.maxAllowed.toFixed(2)}`,
|
|
397
|
+
hint: 'Increase MAX_PAYMENT_PER_REQUEST or choose a cheaper endpoint.',
|
|
398
|
+
}),
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
isError: true,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const message = error instanceof Error ? error.message : 'API call failed';
|
|
405
|
+
// Report failure
|
|
406
|
+
client.reportOutcome({
|
|
407
|
+
endpoint_id: endpoint.endpoint_id,
|
|
408
|
+
success: false,
|
|
409
|
+
error_code: 'call_failed',
|
|
410
|
+
}).catch(() => { });
|
|
411
|
+
return {
|
|
412
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
413
|
+
isError: true,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function formatEndpoint(ep) {
|
|
418
|
+
return {
|
|
419
|
+
endpoint_id: ep.endpoint_id,
|
|
420
|
+
url: ep.url,
|
|
421
|
+
method: ep.method,
|
|
422
|
+
provider: ep.provider_name,
|
|
423
|
+
price: `$${ep.payment.price_per_call}`,
|
|
424
|
+
payment: {
|
|
425
|
+
assets: ep.payment.accepted_assets,
|
|
426
|
+
network: ep.payment.network,
|
|
427
|
+
},
|
|
428
|
+
metrics: {
|
|
429
|
+
success_rate: ep.observed.success_rate_7d
|
|
430
|
+
? `${(ep.observed.success_rate_7d * 100).toFixed(1)}%`
|
|
431
|
+
: 'unknown',
|
|
432
|
+
latency: ep.observed.p95_latency_ms
|
|
433
|
+
? `${ep.observed.p95_latency_ms}ms p95`
|
|
434
|
+
: 'unknown',
|
|
435
|
+
last_verified: ep.observed.last_verified_at || 'never',
|
|
436
|
+
},
|
|
437
|
+
score: ep.score?.toFixed(3),
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
// Start server
|
|
441
|
+
async function main() {
|
|
442
|
+
const transport = new StdioServerTransport();
|
|
443
|
+
await server.connect(transport);
|
|
444
|
+
console.error('EntRoute MCP server running on stdio');
|
|
445
|
+
console.error(`API URL: ${process.env.ENTROUTE_API_URL || 'http://localhost:8787'}`);
|
|
446
|
+
}
|
|
447
|
+
main().catch((error) => {
|
|
448
|
+
console.error('Failed to start MCP server:', error);
|
|
449
|
+
process.exit(1);
|
|
450
|
+
});
|
|
451
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAEhC,yCAAyC;AACzC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAClD,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB;IAC9D,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IACjD,CAAC,CAAC,IAAI,CAAC;AACT,MAAM,iBAAiB,GAAG,CAAC,CAAC,aAAa,CAAC;AAE1C,kDAAkD;AAClD,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,uBAAuB;IAChE,QAAQ,EAAE,YAAY;IACtB,kBAAkB,EAAE,IAAI;I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ED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@entroute/mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP Server for AI agents to discover and call pay-per-request APIs via EntRoute",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"entroute-mcp": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"start": "node dist/index.js",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"prepublishOnly": "tsc"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"entroute",
|
|
29
|
+
"mcp",
|
|
30
|
+
"x402",
|
|
31
|
+
"api-discovery",
|
|
32
|
+
"pay-per-request",
|
|
33
|
+
"ai-agent"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/entroute/entroute",
|
|
39
|
+
"directory": "apps/mcp-server"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://entroute.com",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@entroute/sdk-agent-ts": "^0.2.0",
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
45
|
+
"viem": "^2.44.4"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^22.10.2",
|
|
49
|
+
"typescript": "^5.7.2"
|
|
50
|
+
}
|
|
51
|
+
}
|