drain-mcp 0.2.1 → 0.2.3
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 +382 -262
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/tools/balance.d.ts.map +1 -1
- package/dist/tools/balance.js +47 -29
- package/dist/tools/balance.js.map +1 -1
- package/dist/tools/channel.js +79 -79
- package/dist/tools/chat.js +15 -15
- package/dist/tools/providers.js +27 -27
- package/package.json +50 -50
package/dist/tools/providers.js
CHANGED
|
@@ -14,21 +14,21 @@ function formatProvider(p) {
|
|
|
14
14
|
const latency = p.status.latencyMs ? `${p.status.latencyMs}ms` : 'N/A';
|
|
15
15
|
const docsUrl = p.docsUrl || `${p.apiUrl}/v1/docs`;
|
|
16
16
|
const models = p.models.map(m => ` - ${m.name} (${formatPricing(m)})`).join('\n');
|
|
17
|
-
return `
|
|
18
|
-
## ${p.name}
|
|
19
|
-
- **ID:** ${p.id}
|
|
20
|
-
- **Category:** ${p.category || 'llm'}
|
|
21
|
-
- **Status:** ${status}
|
|
22
|
-
- **Latency:** ${latency}
|
|
23
|
-
- **Address:** ${p.providerAddress}
|
|
24
|
-
- **API:** ${p.apiUrl}
|
|
25
|
-
- **Docs:** ${docsUrl}
|
|
26
|
-
- **Chain:** ${p.chainId === 137 ? 'Polygon Mainnet' : 'Polygon Amoy'}
|
|
27
|
-
|
|
28
|
-
**Description:** ${p.description}
|
|
29
|
-
|
|
30
|
-
**Models / Services:**
|
|
31
|
-
${models}
|
|
17
|
+
return `
|
|
18
|
+
## ${p.name}
|
|
19
|
+
- **ID:** ${p.id}
|
|
20
|
+
- **Category:** ${p.category || 'llm'}
|
|
21
|
+
- **Status:** ${status}
|
|
22
|
+
- **Latency:** ${latency}
|
|
23
|
+
- **Address:** ${p.providerAddress}
|
|
24
|
+
- **API:** ${p.apiUrl}
|
|
25
|
+
- **Docs:** ${docsUrl}
|
|
26
|
+
- **Chain:** ${p.chainId === 137 ? 'Polygon Mainnet' : 'Polygon Amoy'}
|
|
27
|
+
|
|
28
|
+
**Description:** ${p.description}
|
|
29
|
+
|
|
30
|
+
**Models / Services:**
|
|
31
|
+
${models}
|
|
32
32
|
`.trim();
|
|
33
33
|
}
|
|
34
34
|
export async function listProviders(providerService, args) {
|
|
@@ -76,14 +76,14 @@ export async function getProvider(providerService, args) {
|
|
|
76
76
|
export const providerTools = [
|
|
77
77
|
{
|
|
78
78
|
name: 'drain_providers',
|
|
79
|
-
description: `List available service providers on the DRAIN marketplace.
|
|
80
|
-
|
|
81
|
-
Providers offer diverse services by category: llm, image, audio, code, scraping, vpn, multi-modal, other. Each provider has a docs endpoint with usage instructions for that service.
|
|
82
|
-
|
|
83
|
-
For any provider that is not category "llm", read its docs (via drain_provider_info) before sending requests to learn the expected message format.
|
|
84
|
-
|
|
85
|
-
You can open channels to multiple providers simultaneously for multi-service workflows.
|
|
86
|
-
|
|
79
|
+
description: `List available service providers on the DRAIN marketplace.
|
|
80
|
+
|
|
81
|
+
Providers offer diverse services by category: llm, image, audio, code, scraping, vpn, multi-modal, other. Each provider has a docs endpoint with usage instructions for that service.
|
|
82
|
+
|
|
83
|
+
For any provider that is not category "llm", read its docs (via drain_provider_info) before sending requests to learn the expected message format.
|
|
84
|
+
|
|
85
|
+
You can open channels to multiple providers simultaneously for multi-service workflows.
|
|
86
|
+
|
|
87
87
|
Returns: Providers with category, models/services, pricing, docs URL, and online status.`,
|
|
88
88
|
inputSchema: {
|
|
89
89
|
type: 'object',
|
|
@@ -105,10 +105,10 @@ Returns: Providers with category, models/services, pricing, docs URL, and online
|
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
name: 'drain_provider_info',
|
|
108
|
-
description: `Get detailed information about a provider including usage instructions.
|
|
109
|
-
|
|
110
|
-
Returns provider details, available models/services, pricing, and docs content.
|
|
111
|
-
The docs explain how to format the messages parameter in drain_chat for this provider.
|
|
108
|
+
description: `Get detailed information about a provider including usage instructions.
|
|
109
|
+
|
|
110
|
+
Returns provider details, available models/services, pricing, and docs content.
|
|
111
|
+
The docs explain how to format the messages parameter in drain_chat for this provider.
|
|
112
112
|
For non-LLM providers this is essential — the docs specify the expected JSON payload.`,
|
|
113
113
|
inputSchema: {
|
|
114
114
|
type: 'object',
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "drain-mcp",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"mcpName": "io.github.kimbo128/drain-mcp",
|
|
5
|
-
"description": "MCP server for DRAIN protocol. Agents discover providers, open USDC payment channels, and call any service — LLM, scraping, image, VPN, and more.",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/kimbo128/DRAIN.git"
|
|
9
|
-
},
|
|
10
|
-
"type": "module",
|
|
11
|
-
"main": "dist/index.js",
|
|
12
|
-
"bin": {
|
|
13
|
-
"drain-mcp": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsc",
|
|
17
|
-
"dev": "tsc --watch",
|
|
18
|
-
"start": "node dist/index.js",
|
|
19
|
-
"prepublishOnly": "npm run build"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"mcp",
|
|
23
|
-
"model-context-protocol",
|
|
24
|
-
"drain",
|
|
25
|
-
"ai-agent",
|
|
26
|
-
"ai-payments",
|
|
27
|
-
"micropayments",
|
|
28
|
-
"polygon",
|
|
29
|
-
"usdc",
|
|
30
|
-
"crypto",
|
|
31
|
-
"inference"
|
|
32
|
-
],
|
|
33
|
-
"author": "Handshake58",
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
37
|
-
"viem": "^2.21.0"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/node": "^22.0.0",
|
|
41
|
-
"typescript": "^5.6.0"
|
|
42
|
-
},
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=18.0.0"
|
|
45
|
-
},
|
|
46
|
-
"files": [
|
|
47
|
-
"dist",
|
|
48
|
-
"README.md"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "drain-mcp",
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"mcpName": "io.github.kimbo128/drain-mcp",
|
|
5
|
+
"description": "MCP server for DRAIN protocol. Agents discover providers, open USDC payment channels, and call any service — LLM, scraping, image, VPN, and more.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/kimbo128/DRAIN.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"bin": {
|
|
13
|
+
"drain-mcp": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"mcp",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"drain",
|
|
25
|
+
"ai-agent",
|
|
26
|
+
"ai-payments",
|
|
27
|
+
"micropayments",
|
|
28
|
+
"polygon",
|
|
29
|
+
"usdc",
|
|
30
|
+
"crypto",
|
|
31
|
+
"inference"
|
|
32
|
+
],
|
|
33
|
+
"author": "Handshake58",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
37
|
+
"viem": "^2.21.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"typescript": "^5.6.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md"
|
|
49
|
+
]
|
|
50
|
+
}
|