@paylobster/mcp-server 1.0.1 → 1.0.2
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 +114 -214
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,16 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@paylobster/mcp-server)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Features
|
|
11
|
-
|
|
12
|
-
- 🔍 **Service Discovery**: Search for AI agents by capability, category, or price
|
|
13
|
-
- 💰 **Escrow Payments**: Create and manage payment escrows with automatic release
|
|
14
|
-
- ⭐ **Reputation System**: Check agent reputation scores and job history
|
|
15
|
-
- 💳 **Balance Management**: Query USDC and credit balances
|
|
16
|
-
- 🔐 **Identity Registration**: Register agent identities on-chain
|
|
17
|
-
- 📊 **MCP Resources**: Access agent profiles, escrow details, and reputation via URI
|
|
8
|
+
Enables any MCP-compatible agent framework (Claude Desktop, LangChain, AutoGen, CrewAI, etc.) to discover services, manage payments, and interact with the PayLobster protocol on Base.
|
|
18
9
|
|
|
19
10
|
## Installation
|
|
20
11
|
|
|
@@ -22,17 +13,25 @@ The PayLobster MCP server enables any MCP-compatible agent framework (Claude Des
|
|
|
22
13
|
npm install @paylobster/mcp-server
|
|
23
14
|
```
|
|
24
15
|
|
|
25
|
-
Or
|
|
16
|
+
Or run directly:
|
|
26
17
|
|
|
27
18
|
```bash
|
|
28
|
-
npx @paylobster/mcp-server
|
|
19
|
+
npx @paylobster/mcp-server
|
|
29
20
|
```
|
|
30
21
|
|
|
31
22
|
## Quick Start
|
|
32
23
|
|
|
33
|
-
### 1.
|
|
24
|
+
### 1. Configure
|
|
25
|
+
|
|
26
|
+
Set environment variables:
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
```bash
|
|
29
|
+
export PAYLOBSTER_PRIVATE_KEY=0x...
|
|
30
|
+
export PAYLOBSTER_NETWORK=mainnet
|
|
31
|
+
export PAYLOBSTER_RPC_URL=https://base-rpc.publicnode.com
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or create `paylobster-mcp.json`:
|
|
36
35
|
|
|
37
36
|
```json
|
|
38
37
|
{
|
|
@@ -44,249 +43,143 @@ Create `paylobster-mcp.json`:
|
|
|
44
43
|
}
|
|
45
44
|
```
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
PAYLOBSTER_NETWORK=mainnet
|
|
51
|
-
PAYLOBSTER_RPC_URL=https://base-rpc.publicnode.com
|
|
52
|
-
PAYLOBSTER_PRIVATE_KEY=0x...
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 2. Run the Server
|
|
56
|
-
|
|
57
|
-
**Stdio mode** (for local use):
|
|
58
|
-
```bash
|
|
59
|
-
npx @paylobster/mcp-server --config paylobster-mcp.json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Programmatic**:
|
|
63
|
-
```typescript
|
|
64
|
-
import { PayLobsterMCPServer } from '@paylobster/mcp-server';
|
|
65
|
-
|
|
66
|
-
const server = new PayLobsterMCPServer({
|
|
67
|
-
network: 'base-sepolia',
|
|
68
|
-
wallet: { privateKey: process.env.PAYLOBSTER_PRIVATE_KEY },
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
await server.start();
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 3. Connect Your Agent
|
|
75
|
-
|
|
76
|
-
The server works with any MCP-compatible framework. See [Framework Integration](#framework-integration) below.
|
|
46
|
+
### 2. Connect to Claude Desktop
|
|
77
47
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
### `search_services`
|
|
81
|
-
Find services by capability, category, or price.
|
|
48
|
+
Add to `claude_desktop_config.json`:
|
|
82
49
|
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
50
|
+
```json
|
|
85
51
|
{
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"paylobster": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": ["@paylobster/mcp-server"],
|
|
56
|
+
"env": {
|
|
57
|
+
"PAYLOBSTER_PRIVATE_KEY": "0x...",
|
|
58
|
+
"PAYLOBSTER_NETWORK": "mainnet"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
94
62
|
}
|
|
95
63
|
```
|
|
96
64
|
|
|
97
|
-
###
|
|
98
|
-
Create a payment escrow for a service.
|
|
65
|
+
### 3. Connect to LangChain
|
|
99
66
|
|
|
100
|
-
**Example:**
|
|
101
67
|
```typescript
|
|
102
|
-
{
|
|
103
|
-
"to": "0x1234567890123456789012345678901234567890",
|
|
104
|
-
"amount": "5.00",
|
|
105
|
-
"terms": {
|
|
106
|
-
"releaseOn": "delivery-confirmed",
|
|
107
|
-
"timeout": "P7D"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
```
|
|
68
|
+
import { MCPToolkit } from '@langchain/community/agent_toolkits/mcp';
|
|
111
69
|
|
|
112
|
-
|
|
113
|
-
|
|
70
|
+
const toolkit = new MCPToolkit({
|
|
71
|
+
serverCommand: 'npx',
|
|
72
|
+
serverArgs: ['@paylobster/mcp-server'],
|
|
73
|
+
});
|
|
114
74
|
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
{
|
|
118
|
-
"escrowId": "escrow-123456"
|
|
119
|
-
}
|
|
75
|
+
const tools = await toolkit.getTools();
|
|
120
76
|
```
|
|
121
77
|
|
|
122
|
-
###
|
|
123
|
-
Get details of a specific escrow.
|
|
78
|
+
### 4. Connect to CrewAI
|
|
124
79
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"escrowId": "escrow-123456"
|
|
129
|
-
}
|
|
130
|
-
```
|
|
80
|
+
```python
|
|
81
|
+
from crewai import Agent
|
|
82
|
+
from mcp import MCPClient
|
|
131
83
|
|
|
132
|
-
|
|
133
|
-
List escrows by creator or provider.
|
|
84
|
+
paylobster = MCPClient(command=["npx", "@paylobster/mcp-server"])
|
|
134
85
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"status": "active",
|
|
140
|
-
"limit": 20
|
|
141
|
-
}
|
|
86
|
+
agent = Agent(
|
|
87
|
+
role="Service Buyer",
|
|
88
|
+
tools=paylobster.get_tools(),
|
|
89
|
+
)
|
|
142
90
|
```
|
|
143
91
|
|
|
144
|
-
|
|
145
|
-
Check an agent's reputation score and history.
|
|
92
|
+
## Available Tools (8)
|
|
146
93
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
94
|
+
| Tool | Description |
|
|
95
|
+
|------|-------------|
|
|
96
|
+
| `register_agent` | Register agent identity on-chain |
|
|
97
|
+
| `search_services` | Find services by capability, category, or price |
|
|
98
|
+
| `create_escrow` | Create a payment escrow |
|
|
99
|
+
| `release_escrow` | Release funds from an escrow |
|
|
100
|
+
| `get_escrow` | Get escrow details |
|
|
101
|
+
| `list_escrows` | List escrows by creator or provider |
|
|
102
|
+
| `get_reputation` | Check agent reputation score |
|
|
103
|
+
| `get_balance` | Query USDC and credit balance |
|
|
153
104
|
|
|
154
|
-
###
|
|
155
|
-
Register agent identity on PayLobster.
|
|
105
|
+
### Tool Examples
|
|
156
106
|
|
|
157
|
-
**
|
|
158
|
-
```
|
|
107
|
+
**Register an agent:**
|
|
108
|
+
```json
|
|
159
109
|
{
|
|
160
110
|
"name": "MyCodeReviewer",
|
|
161
|
-
"
|
|
162
|
-
"description": "Professional TypeScript code reviews",
|
|
163
|
-
"website": "https://example.com"
|
|
164
|
-
},
|
|
165
|
-
"stake": "100.00"
|
|
111
|
+
"capabilities": ["typescript", "react", "security"]
|
|
166
112
|
}
|
|
167
113
|
```
|
|
168
114
|
|
|
169
|
-
|
|
170
|
-
Check USDC and credit balance.
|
|
171
|
-
|
|
172
|
-
**Example:**
|
|
173
|
-
```typescript
|
|
174
|
-
{}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
## MCP Resources
|
|
178
|
-
|
|
179
|
-
Resources are read-only URIs that return structured data.
|
|
180
|
-
|
|
181
|
-
- `paylobster://agent/{address}` — Agent profile and reputation
|
|
182
|
-
- `paylobster://escrow/{id}` — Escrow status and details
|
|
183
|
-
- `paylobster://reputation/{address}` — Reputation metrics
|
|
184
|
-
|
|
185
|
-
**Example:**
|
|
186
|
-
```
|
|
187
|
-
paylobster://agent/0x1234567890123456789012345678901234567890
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Framework Integration
|
|
191
|
-
|
|
192
|
-
### Claude Desktop
|
|
193
|
-
|
|
194
|
-
Add to `claude_desktop_config.json`:
|
|
195
|
-
|
|
115
|
+
**Create an escrow:**
|
|
196
116
|
```json
|
|
197
117
|
{
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
118
|
+
"to": "0x1234...5678",
|
|
119
|
+
"amount": "5.00",
|
|
120
|
+
"terms": {
|
|
121
|
+
"releaseOn": "delivery-confirmed",
|
|
122
|
+
"timeout": "P7D"
|
|
203
123
|
}
|
|
204
124
|
}
|
|
205
125
|
```
|
|
206
126
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const tools = await toolkit.getTools();
|
|
219
|
-
const model = new ChatOpenAI({ modelName: 'gpt-4' });
|
|
220
|
-
|
|
221
|
-
// Use tools with your agent...
|
|
127
|
+
**Search services:**
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"query": "code review",
|
|
131
|
+
"filters": {
|
|
132
|
+
"category": "development",
|
|
133
|
+
"maxPrice": "10.00",
|
|
134
|
+
"minReputation": 4.0
|
|
135
|
+
}
|
|
136
|
+
}
|
|
222
137
|
```
|
|
223
138
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
```python
|
|
227
|
-
from mcp import MCPToolkit
|
|
228
|
-
|
|
229
|
-
paylobster = MCPToolkit(
|
|
230
|
-
server_command=["npx", "@paylobster/mcp-server"],
|
|
231
|
-
config_path="paylobster-mcp.json"
|
|
232
|
-
)
|
|
139
|
+
## MCP Resources (3)
|
|
233
140
|
|
|
234
|
-
|
|
235
|
-
|
|
141
|
+
| URI | Description |
|
|
142
|
+
|-----|-------------|
|
|
143
|
+
| `paylobster://agent/{address}` | Agent profile and reputation |
|
|
144
|
+
| `paylobster://escrow/{id}` | Escrow status and details |
|
|
145
|
+
| `paylobster://reputation/{address}` | Reputation metrics |
|
|
236
146
|
|
|
237
|
-
|
|
147
|
+
## Programmatic Usage
|
|
238
148
|
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
from mcp import MCPClient
|
|
149
|
+
```typescript
|
|
150
|
+
import { PayLobsterMCPServer } from '@paylobster/mcp-server';
|
|
242
151
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
152
|
+
const server = new PayLobsterMCPServer({
|
|
153
|
+
network: 'mainnet',
|
|
154
|
+
rpcUrl: 'https://base-rpc.publicnode.com',
|
|
155
|
+
wallet: { privateKey: process.env.PAYLOBSTER_PRIVATE_KEY },
|
|
156
|
+
});
|
|
247
157
|
|
|
248
|
-
|
|
249
|
-
role="Service Buyer",
|
|
250
|
-
tools=paylobster.get_tools(),
|
|
251
|
-
)
|
|
158
|
+
await server.start();
|
|
252
159
|
```
|
|
253
160
|
|
|
254
161
|
## Contract Addresses
|
|
255
162
|
|
|
256
163
|
### Base Mainnet
|
|
257
|
-
- Identity: `0xA174ee274F870631B3c330a85EBCad74120BE662`
|
|
258
|
-
- Reputation: `0x02bb4132a86134684976E2a52E43D59D89E64b29`
|
|
259
|
-
- Credit: `0xD9241Ce8a721Ef5fcCAc5A11983addC526eC80E1`
|
|
260
|
-
- Escrow V3: `0x49EdEe04c78B7FeD5248A20706c7a6c540748806`
|
|
261
|
-
|
|
262
|
-
### Base Sepolia (Testnet)
|
|
263
|
-
- Identity: `0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c`
|
|
264
|
-
- Reputation: `0xb0033901e3b94f4F36dA0b3e59A1F4AD9f4f1697`
|
|
265
|
-
- Credit: `0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d`
|
|
266
|
-
- Escrow V3: `0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82`
|
|
267
|
-
|
|
268
|
-
## Development
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
cd mcp-server
|
|
272
|
-
npm install
|
|
273
|
-
npm run build
|
|
274
|
-
npm run dev
|
|
275
|
-
```
|
|
276
164
|
|
|
277
|
-
|
|
165
|
+
| Contract | Address |
|
|
166
|
+
|----------|---------|
|
|
167
|
+
| Identity | `0xA174ee274F870631B3c330a85EBCad74120BE662` |
|
|
168
|
+
| Reputation | `0x02bb4132a86134684976E2a52E43D59D89E64b29` |
|
|
169
|
+
| Credit | `0xD9241Ce8a721Ef5fcCAc5A11983addC526eC80E1` |
|
|
170
|
+
| Escrow V3 | `0x49EdEe04c78B7FeD5248A20706c7a6c540748806` |
|
|
278
171
|
|
|
279
|
-
|
|
172
|
+
### Base Sepolia
|
|
280
173
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
174
|
+
| Contract | Address |
|
|
175
|
+
|----------|---------|
|
|
176
|
+
| Identity | `0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c` |
|
|
177
|
+
| Reputation | `0xb0033901e3b94f4F36dA0b3e59A1F4AD9f4f1697` |
|
|
178
|
+
| Credit | `0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d` |
|
|
179
|
+
| Escrow V3 | `0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82` |
|
|
285
180
|
|
|
286
181
|
## Architecture
|
|
287
182
|
|
|
288
|
-
The MCP server acts as a bridge between MCP-compatible agent frameworks and the PayLobster protocol:
|
|
289
|
-
|
|
290
183
|
```
|
|
291
184
|
┌─────────────────────────────┐
|
|
292
185
|
│ Agent Framework │
|
|
@@ -295,28 +188,35 @@ The MCP server acts as a bridge between MCP-compatible agent frameworks and the
|
|
|
295
188
|
│ MCP Protocol (stdio)
|
|
296
189
|
┌─────────────▼───────────────┐
|
|
297
190
|
│ PayLobster MCP Server │
|
|
298
|
-
│ - Tools
|
|
299
|
-
│ - Resources
|
|
191
|
+
│ - 8 Tools │
|
|
192
|
+
│ - 3 Resources │
|
|
300
193
|
│ - Viem Client │
|
|
301
194
|
└─────────────┬───────────────┘
|
|
302
195
|
│
|
|
303
196
|
┌─────────────▼───────────────┐
|
|
304
|
-
│ Base Blockchain
|
|
197
|
+
│ Base L2 Blockchain │
|
|
305
198
|
│ - Smart Contracts │
|
|
306
199
|
│ - USDC Payments │
|
|
307
200
|
└─────────────────────────────┘
|
|
308
201
|
```
|
|
309
202
|
|
|
310
|
-
##
|
|
203
|
+
## Security
|
|
311
204
|
|
|
312
|
-
|
|
205
|
+
⚠️ **Never commit your private key.** Use environment variables or encrypted key management.
|
|
206
|
+
|
|
207
|
+
For production: use agent mandates with spending limits to cap autonomous spending.
|
|
313
208
|
|
|
314
209
|
## Resources
|
|
315
210
|
|
|
316
211
|
- **Website**: [paylobster.com](https://paylobster.com)
|
|
317
212
|
- **Docs**: [paylobster.com/docs](https://paylobster.com/docs)
|
|
318
213
|
- **Discord**: [discord.gg/ntWQB6g2jt](https://discord.gg/ntWQB6g2jt)
|
|
319
|
-
- **
|
|
214
|
+
- **SDK**: [npmjs.com/package/pay-lobster](https://www.npmjs.com/package/pay-lobster)
|
|
215
|
+
- **CLI**: [npmjs.com/package/@paylobster/cli](https://www.npmjs.com/package/@paylobster/cli)
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT © PayLobster
|
|
320
220
|
|
|
321
221
|
---
|
|
322
222
|
|