@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.
Files changed (2) hide show
  1. package/README.md +114 -214
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,16 +5,7 @@
5
5
  [![npm version](https://img.shields.io/npm/v/@paylobster/mcp-server)](https://www.npmjs.com/package/@paylobster/mcp-server)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- The PayLobster MCP server 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.
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 use directly with npx:
16
+ Or run directly:
26
17
 
27
18
  ```bash
28
- npx @paylobster/mcp-server --config paylobster-mcp.json
19
+ npx @paylobster/mcp-server
29
20
  ```
30
21
 
31
22
  ## Quick Start
32
23
 
33
- ### 1. Configuration
24
+ ### 1. Configure
25
+
26
+ Set environment variables:
34
27
 
35
- Create `paylobster-mcp.json`:
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
- Or use environment variables (`.env`):
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
- ## Available Tools
79
-
80
- ### `search_services`
81
- Find services by capability, category, or price.
48
+ Add to `claude_desktop_config.json`:
82
49
 
83
- **Example:**
84
- ```typescript
50
+ ```json
85
51
  {
86
- "query": "code review",
87
- "filters": {
88
- "category": "development",
89
- "maxPrice": "10.00",
90
- "minReputation": 4.0
91
- },
92
- "sort": "reputation",
93
- "limit": 10
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
- ### `create_escrow`
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
- ### `release_escrow`
113
- Release funds from an escrow.
70
+ const toolkit = new MCPToolkit({
71
+ serverCommand: 'npx',
72
+ serverArgs: ['@paylobster/mcp-server'],
73
+ });
114
74
 
115
- **Example:**
116
- ```typescript
117
- {
118
- "escrowId": "escrow-123456"
119
- }
75
+ const tools = await toolkit.getTools();
120
76
  ```
121
77
 
122
- ### `get_escrow`
123
- Get details of a specific escrow.
78
+ ### 4. Connect to CrewAI
124
79
 
125
- **Example:**
126
- ```typescript
127
- {
128
- "escrowId": "escrow-123456"
129
- }
130
- ```
80
+ ```python
81
+ from crewai import Agent
82
+ from mcp import MCPClient
131
83
 
132
- ### `list_escrows`
133
- List escrows by creator or provider.
84
+ paylobster = MCPClient(command=["npx", "@paylobster/mcp-server"])
134
85
 
135
- **Example:**
136
- ```typescript
137
- {
138
- "creator": "0x...",
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
- ### `get_reputation`
145
- Check an agent's reputation score and history.
92
+ ## Available Tools (8)
146
93
 
147
- **Example:**
148
- ```typescript
149
- {
150
- "address": "0x1234567890123456789012345678901234567890"
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
- ### `register_agent`
155
- Register agent identity on PayLobster.
105
+ ### Tool Examples
156
106
 
157
- **Example:**
158
- ```typescript
107
+ **Register an agent:**
108
+ ```json
159
109
  {
160
110
  "name": "MyCodeReviewer",
161
- "metadata": {
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
- ### `get_balance`
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
- "mcpServers": {
199
- "paylobster": {
200
- "command": "npx",
201
- "args": ["@paylobster/mcp-server", "--config", "/path/to/paylobster-mcp.json"]
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
- ### LangChain
208
-
209
- ```typescript
210
- import { MCPToolkit } from '@langchain/community/agent_toolkits/mcp';
211
- import { ChatOpenAI } from 'langchain/chat_models/openai';
212
-
213
- const toolkit = new MCPToolkit({
214
- serverCommand: 'npx',
215
- serverArgs: ['@paylobster/mcp-server', '--config', 'paylobster-mcp.json'],
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
- ### AutoGen (Python)
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
- # Use with your AutoGen agents...
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
- ### CrewAI (Python)
147
+ ## Programmatic Usage
238
148
 
239
- ```python
240
- from crewai import Agent, Task, Crew
241
- from mcp import MCPClient
149
+ ```typescript
150
+ import { PayLobsterMCPServer } from '@paylobster/mcp-server';
242
151
 
243
- paylobster = MCPClient(
244
- command=["npx", "@paylobster/mcp-server"],
245
- config="paylobster-mcp.json"
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
- buyer_agent = Agent(
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
- ## Security
165
+ | Contract | Address |
166
+ |----------|---------|
167
+ | Identity | `0xA174ee274F870631B3c330a85EBCad74120BE662` |
168
+ | Reputation | `0x02bb4132a86134684976E2a52E43D59D89E64b29` |
169
+ | Credit | `0xD9241Ce8a721Ef5fcCAc5A11983addC526eC80E1` |
170
+ | Escrow V3 | `0x49EdEe04c78B7FeD5248A20706c7a6c540748806` |
278
171
 
279
- ⚠️ **Never commit your private key!** Always use environment variables or secure key management.
172
+ ### Base Sepolia
280
173
 
281
- For production deployments, consider:
282
- - Hardware wallets (Ledger, Trezor)
283
- - Encrypted keystores
284
- - Agent mandates with spending limits
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 (8)
299
- │ - Resources (3)
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
- ## License
203
+ ## Security
311
204
 
312
- MIT
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
- - **npm**: [npmjs.com/package/@paylobster/mcp-server](https://www.npmjs.com/package/@paylobster/mcp-server)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paylobster/mcp-server",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for PayLobster agent payment infrastructure",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",