@paylobster/mcp-server 1.6.0 → 1.7.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/README.md +147 -228
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +86 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +159 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts +3 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1455 -114
- package/dist/server.js.map +1 -1
- package/dist/tools/balance.d.ts +5 -16
- package/dist/tools/balance.d.ts.map +1 -1
- package/dist/tools/balance.js +26 -44
- package/dist/tools/balance.js.map +1 -1
- package/dist/tools/bridge.d.ts +142 -0
- package/dist/tools/bridge.d.ts.map +1 -0
- package/dist/tools/bridge.js +121 -0
- package/dist/tools/bridge.js.map +1 -0
- package/dist/tools/cascade.d.ts +59 -0
- package/dist/tools/cascade.d.ts.map +1 -0
- package/dist/tools/cascade.js +119 -0
- package/dist/tools/cascade.js.map +1 -0
- package/dist/tools/compliance.d.ts +36 -0
- package/dist/tools/compliance.d.ts.map +1 -0
- package/dist/tools/compliance.js +57 -0
- package/dist/tools/compliance.js.map +1 -0
- package/dist/tools/convenience.d.ts +121 -0
- package/dist/tools/convenience.d.ts.map +1 -0
- package/dist/tools/convenience.js +331 -0
- package/dist/tools/convenience.js.map +1 -0
- package/dist/tools/credit.d.ts +46 -0
- package/dist/tools/credit.d.ts.map +1 -0
- package/dist/tools/credit.js +102 -0
- package/dist/tools/credit.js.map +1 -0
- package/dist/tools/disputes.d.ts +71 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +121 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/escrow.d.ts +90 -31
- package/dist/tools/escrow.d.ts.map +1 -1
- package/dist/tools/escrow.js +215 -98
- package/dist/tools/escrow.js.map +1 -1
- package/dist/tools/intent.d.ts +78 -0
- package/dist/tools/intent.d.ts.map +1 -0
- package/dist/tools/intent.js +192 -0
- package/dist/tools/intent.js.map +1 -0
- package/dist/tools/investment.d.ts +196 -0
- package/dist/tools/investment.d.ts.map +1 -0
- package/dist/tools/investment.js +415 -0
- package/dist/tools/investment.js.map +1 -0
- package/dist/tools/links.d.ts +41 -0
- package/dist/tools/links.d.ts.map +1 -0
- package/dist/tools/links.js +78 -0
- package/dist/tools/links.js.map +1 -0
- package/dist/tools/portfolio.d.ts +44 -0
- package/dist/tools/portfolio.d.ts.map +1 -0
- package/dist/tools/portfolio.js +166 -0
- package/dist/tools/portfolio.js.map +1 -0
- package/dist/tools/price-alerts.d.ts +52 -0
- package/dist/tools/price-alerts.d.ts.map +1 -0
- package/dist/tools/price-alerts.js +78 -0
- package/dist/tools/price-alerts.js.map +1 -0
- package/dist/tools/refunds.d.ts +32 -0
- package/dist/tools/refunds.d.ts.map +1 -0
- package/dist/tools/refunds.js +75 -0
- package/dist/tools/refunds.js.map +1 -0
- package/dist/tools/reputation.d.ts +49 -15
- package/dist/tools/reputation.d.ts.map +1 -1
- package/dist/tools/reputation.js +107 -45
- package/dist/tools/reputation.js.map +1 -1
- package/dist/tools/revenue.d.ts +42 -0
- package/dist/tools/revenue.d.ts.map +1 -0
- package/dist/tools/revenue.js +67 -0
- package/dist/tools/revenue.js.map +1 -0
- package/dist/tools/search.d.ts +54 -30
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +85 -122
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/streaming.d.ts +60 -0
- package/dist/tools/streaming.d.ts.map +1 -0
- package/dist/tools/streaming.js +163 -0
- package/dist/tools/streaming.js.map +1 -0
- package/dist/tools/swap-smart.d.ts +30 -0
- package/dist/tools/swap-smart.d.ts.map +1 -0
- package/dist/tools/swap-smart.js +135 -0
- package/dist/tools/swap-smart.js.map +1 -0
- package/dist/tools/swap.d.ts +93 -0
- package/dist/tools/swap.d.ts.map +1 -0
- package/dist/tools/swap.js +150 -0
- package/dist/tools/swap.js.map +1 -0
- package/dist/tools/treasury.d.ts +267 -0
- package/dist/tools/treasury.d.ts.map +1 -0
- package/dist/tools/treasury.js +722 -0
- package/dist/tools/treasury.js.map +1 -0
- package/dist/tools/trust-graph.d.ts +105 -0
- package/dist/tools/trust-graph.d.ts.map +1 -0
- package/dist/tools/trust-graph.js +232 -0
- package/dist/tools/trust-graph.js.map +1 -0
- package/dist/tools/webhooks.d.ts +60 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +133 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/{lib/types.js → types/index.js} +1 -1
- package/dist/types/index.js.map +1 -0
- package/dist/utils/contracts.d.ts +553 -0
- package/dist/utils/contracts.d.ts.map +1 -0
- package/dist/utils/contracts.js +403 -0
- package/dist/utils/contracts.js.map +1 -0
- package/package.json +11 -20
- package/BUILD_SUMMARY.md +0 -294
- package/CHANGELOG.md +0 -77
- package/COMPLETION_REPORT.md +0 -284
- package/INTEGRATION.md +0 -286
- package/QUICKSTART.md +0 -226
- package/dist/lib/config.d.ts +0 -7
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -16
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/contracts.d.ts +0 -15
- package/dist/lib/contracts.d.ts.map +0 -1
- package/dist/lib/contracts.js +0 -148
- package/dist/lib/contracts.js.map +0 -1
- package/dist/lib/types.d.ts +0 -39
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/resources/agent.d.ts +0 -3
- package/dist/resources/agent.d.ts.map +0 -1
- package/dist/resources/agent.js +0 -36
- package/dist/resources/agent.js.map +0 -1
- package/dist/resources/escrow.d.ts +0 -3
- package/dist/resources/escrow.d.ts.map +0 -1
- package/dist/resources/escrow.js +0 -33
- package/dist/resources/escrow.js.map +0 -1
- package/dist/resources/services.d.ts +0 -2
- package/dist/resources/services.d.ts.map +0 -1
- package/dist/resources/services.js +0 -55
- package/dist/resources/services.js.map +0 -1
- package/dist/tools/agent.d.ts +0 -17
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -51
- package/dist/tools/agent.js.map +0 -1
- package/examples/test-server.ts +0 -36
- package/examples/test-tools.ts +0 -64
- package/src/__tests__/server.test.ts +0 -24
- package/src/index.ts +0 -24
- package/src/lib/config.ts +0 -22
- package/src/lib/contracts.ts +0 -164
- package/src/lib/types.ts +0 -44
- package/src/resources/agent.ts +0 -40
- package/src/resources/escrow.ts +0 -35
- package/src/resources/services.ts +0 -53
- package/src/server.ts +0 -190
- package/src/tools/agent.ts +0 -56
- package/src/tools/balance.ts +0 -61
- package/src/tools/escrow.ts +0 -142
- package/src/tools/reputation.ts +0 -69
- package/src/tools/search.ts +0 -148
- package/tsconfig.json +0 -20
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PayLobster MCP Server
|
|
2
2
|
|
|
3
|
-
Model Context Protocol (MCP) server for PayLobster
|
|
3
|
+
> Model Context Protocol (MCP) server for PayLobster agent payment infrastructure
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@paylobster/mcp-server)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
- 💰 **Payment Management** - Check balances and manage escrows
|
|
9
|
-
- ⭐ **Reputation System** - Query agent reputation scores and trust metrics
|
|
10
|
-
- 🔗 **Blockchain Integration** - Direct interaction with Base mainnet and Sepolia contracts
|
|
11
|
-
- 🛠️ **MCP Compliance** - Standard protocol compatible with all major agent frameworks
|
|
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.
|
|
12
9
|
|
|
13
10
|
## Installation
|
|
14
11
|
|
|
@@ -16,41 +13,39 @@ Model Context Protocol (MCP) server for PayLobster's agent payment infrastructur
|
|
|
16
13
|
npm install @paylobster/mcp-server
|
|
17
14
|
```
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Running the Server
|
|
22
|
-
|
|
23
|
-
The server runs in stdio mode (standard MCP transport):
|
|
16
|
+
Or run directly:
|
|
24
17
|
|
|
25
18
|
```bash
|
|
26
|
-
# Using mainnet (default)
|
|
27
19
|
npx @paylobster/mcp-server
|
|
28
|
-
|
|
29
|
-
# Using Sepolia testnet
|
|
30
|
-
PAYLOBSTER_NETWORK=sepolia npx @paylobster/mcp-server
|
|
31
|
-
|
|
32
|
-
# With custom RPC URL
|
|
33
|
-
PAYLOBSTER_RPC_URL=https://your-rpc.url npx @paylobster/mcp-server
|
|
34
20
|
```
|
|
35
21
|
|
|
36
|
-
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### 1. Configure
|
|
37
25
|
|
|
38
|
-
|
|
26
|
+
Set environment variables:
|
|
39
27
|
|
|
40
28
|
```bash
|
|
41
|
-
|
|
42
|
-
PAYLOBSTER_NETWORK=mainnet
|
|
29
|
+
export PAYLOBSTER_PRIVATE_KEY=0x...
|
|
30
|
+
export PAYLOBSTER_NETWORK=mainnet
|
|
31
|
+
export PAYLOBSTER_RPC_URL=https://base-rpc.publicnode.com
|
|
32
|
+
```
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
PAYLOBSTER_RPC_URL=https://mainnet.base.org
|
|
34
|
+
Or create `paylobster-mcp.json`:
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"network": "mainnet",
|
|
39
|
+
"rpcUrl": "https://base-rpc.publicnode.com",
|
|
40
|
+
"wallet": {
|
|
41
|
+
"privateKey": "${PAYLOBSTER_PRIVATE_KEY}"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
49
44
|
```
|
|
50
45
|
|
|
51
|
-
###
|
|
46
|
+
### 2. Connect to Claude Desktop
|
|
52
47
|
|
|
53
|
-
Add to
|
|
48
|
+
Add to `claude_desktop_config.json`:
|
|
54
49
|
|
|
55
50
|
```json
|
|
56
51
|
{
|
|
@@ -59,6 +54,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
59
54
|
"command": "npx",
|
|
60
55
|
"args": ["@paylobster/mcp-server"],
|
|
61
56
|
"env": {
|
|
57
|
+
"PAYLOBSTER_PRIVATE_KEY": "0x...",
|
|
62
58
|
"PAYLOBSTER_NETWORK": "mainnet"
|
|
63
59
|
}
|
|
64
60
|
}
|
|
@@ -66,263 +62,186 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
66
62
|
}
|
|
67
63
|
```
|
|
68
64
|
|
|
69
|
-
###
|
|
65
|
+
### 3. Connect to LangChain
|
|
70
66
|
|
|
71
67
|
```typescript
|
|
72
|
-
import {
|
|
68
|
+
import { MCPToolkit } from '@langchain/community/agent_toolkits/mcp';
|
|
73
69
|
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const toolkit = new MCPToolkit({
|
|
71
|
+
serverCommand: 'npx',
|
|
72
|
+
serverArgs: ['@paylobster/mcp-server'],
|
|
77
73
|
});
|
|
78
74
|
|
|
79
|
-
await
|
|
75
|
+
const tools = await toolkit.getTools();
|
|
80
76
|
```
|
|
81
77
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
### `paylobster_get_reputation`
|
|
78
|
+
### 4. Connect to CrewAI
|
|
85
79
|
|
|
86
|
-
|
|
80
|
+
```python
|
|
81
|
+
from crewai import Agent
|
|
82
|
+
from mcp import MCPClient
|
|
87
83
|
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
"address": "0x..."
|
|
91
|
-
}
|
|
92
|
-
```
|
|
84
|
+
paylobster = MCPClient(command=["npx", "@paylobster/mcp-server"])
|
|
93
85
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"reputation": {
|
|
99
|
-
"score": 4.5,
|
|
100
|
-
"trustVector": "12345",
|
|
101
|
-
"verified": true
|
|
102
|
-
},
|
|
103
|
-
"agentInfo": {
|
|
104
|
-
"name": "MyAgent",
|
|
105
|
-
"tokenId": "1",
|
|
106
|
-
"registered": true
|
|
107
|
-
}
|
|
108
|
-
}
|
|
86
|
+
agent = Agent(
|
|
87
|
+
role="Service Buyer",
|
|
88
|
+
tools=paylobster.get_tools(),
|
|
89
|
+
)
|
|
109
90
|
```
|
|
110
91
|
|
|
111
|
-
|
|
92
|
+
## Available Tools (55)
|
|
112
93
|
|
|
113
|
-
|
|
94
|
+
PayLobster MCP Server provides comprehensive tools covering identity, payments, reputation, credit, trust networks, and more.
|
|
114
95
|
|
|
115
|
-
|
|
116
|
-
{
|
|
117
|
-
"address": "0x..."
|
|
118
|
-
}
|
|
119
|
-
```
|
|
96
|
+
### Core Tools
|
|
120
97
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### `paylobster_get_agent`
|
|
133
|
-
|
|
134
|
-
Get agent identity information.
|
|
98
|
+
| Tool | Description |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| `register_agent` | Register agent identity on-chain |
|
|
101
|
+
| `search_services` | Find services by capability, category, or price |
|
|
102
|
+
| `create_escrow` | Create a payment escrow |
|
|
103
|
+
| `release_escrow` | Release funds from an escrow |
|
|
104
|
+
| `get_escrow` | Get escrow details |
|
|
105
|
+
| `list_escrows` | List escrows by creator or provider |
|
|
106
|
+
| `get_reputation` | Check agent reputation score |
|
|
107
|
+
| `get_balance` | Query USDC and credit balance |
|
|
135
108
|
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
"address": "0x..."
|
|
139
|
-
}
|
|
140
|
-
```
|
|
109
|
+
### TrustGraph Tools (V4.4)
|
|
141
110
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `trust_endorse` | Endorse another agent with a trust level (1-100) |
|
|
114
|
+
| `trust_revoke` | Revoke an endorsement |
|
|
115
|
+
| `trust_check_direct` | Get direct trust level between two agents |
|
|
116
|
+
| `trust_check_inferred` | Calculate inferred trust through network (BFS with decay) |
|
|
117
|
+
| `trust_endorsements` | List all agents endorsed by an address |
|
|
118
|
+
| `trust_endorsers` | List all agents who endorse an address |
|
|
119
|
+
| `trust_aggregate` | Get aggregate trust score (reputation-weighted) |
|
|
151
120
|
|
|
152
|
-
|
|
121
|
+
**Additional categories:** Streaming payments, disputes, credit scoring, cascading escrow, intents, revenue sharing, compliance, swaps, bridges, treasury management, investments, and more. See full tool list with `listTools` request.
|
|
153
122
|
|
|
154
|
-
|
|
123
|
+
### Tool Examples
|
|
155
124
|
|
|
125
|
+
**Register an agent:**
|
|
156
126
|
```json
|
|
157
127
|
{
|
|
158
|
-
"
|
|
128
|
+
"name": "MyCodeReviewer",
|
|
129
|
+
"capabilities": ["typescript", "react", "security"]
|
|
159
130
|
}
|
|
160
131
|
```
|
|
161
132
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Get details for a specific escrow.
|
|
165
|
-
|
|
133
|
+
**Create an escrow:**
|
|
166
134
|
```json
|
|
167
135
|
{
|
|
168
|
-
"
|
|
136
|
+
"to": "0x1234...5678",
|
|
137
|
+
"amount": "5.00",
|
|
138
|
+
"terms": {
|
|
139
|
+
"releaseOn": "delivery-confirmed",
|
|
140
|
+
"timeout": "P7D"
|
|
141
|
+
}
|
|
169
142
|
}
|
|
170
143
|
```
|
|
171
144
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
Search for AI agent services (currently returns mock data).
|
|
175
|
-
|
|
145
|
+
**Search services:**
|
|
176
146
|
```json
|
|
177
147
|
{
|
|
178
148
|
"query": "code review",
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
149
|
+
"filters": {
|
|
150
|
+
"category": "development",
|
|
151
|
+
"maxPrice": "10.00",
|
|
152
|
+
"minReputation": 4.0
|
|
153
|
+
}
|
|
183
154
|
}
|
|
184
155
|
```
|
|
185
156
|
|
|
186
|
-
##
|
|
187
|
-
|
|
188
|
-
### `paylobster://services`
|
|
157
|
+
## MCP Resources (3)
|
|
189
158
|
|
|
190
|
-
|
|
159
|
+
| URI | Description |
|
|
160
|
+
|-----|-------------|
|
|
161
|
+
| `paylobster://agent/{address}` | Agent profile and reputation |
|
|
162
|
+
| `paylobster://escrow/{id}` | Escrow status and details |
|
|
163
|
+
| `paylobster://reputation/{address}` | Reputation metrics |
|
|
191
164
|
|
|
192
|
-
|
|
165
|
+
## Programmatic Usage
|
|
193
166
|
|
|
194
|
-
|
|
167
|
+
```typescript
|
|
168
|
+
import { PayLobsterMCPServer } from '@paylobster/mcp-server';
|
|
195
169
|
|
|
196
|
-
|
|
170
|
+
const server = new PayLobsterMCPServer({
|
|
171
|
+
network: 'mainnet',
|
|
172
|
+
rpcUrl: 'https://base-rpc.publicnode.com',
|
|
173
|
+
wallet: { privateKey: process.env.PAYLOBSTER_PRIVATE_KEY },
|
|
174
|
+
});
|
|
197
175
|
|
|
198
|
-
|
|
176
|
+
await server.start();
|
|
177
|
+
```
|
|
199
178
|
|
|
200
179
|
## Contract Addresses
|
|
201
180
|
|
|
202
181
|
### Base Mainnet
|
|
203
|
-
- Identity: `0xA174f250380c4B5C37F6709bBa719E662b77E662`
|
|
204
|
-
- Reputation: `0x02bb4c4cd10EeaCD04DF7631c81d6E7c1d0c4b29`
|
|
205
|
-
- Credit: `0xD924B81F2d8EFF3E0A3Bf0a4b9D77d37CC0980E1`
|
|
206
|
-
- Escrow: `0x49Ed7003C6941a033E7dD8b44552e4E18cf28806`
|
|
207
|
-
- USDC: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
|
|
208
182
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
## Development
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
# Install dependencies
|
|
220
|
-
npm install
|
|
221
|
-
|
|
222
|
-
# Build
|
|
223
|
-
npm run build
|
|
224
|
-
|
|
225
|
-
# Run in development mode with auto-reload
|
|
226
|
-
npm run dev
|
|
183
|
+
| Contract | Address |
|
|
184
|
+
|----------|---------|
|
|
185
|
+
| Identity | `0xA174ee274F870631B3c330a85EBCad74120BE662` |
|
|
186
|
+
| Reputation | `0x02bb4132a86134684976E2a52E43D59D89E64b29` |
|
|
187
|
+
| Credit | `0xD9241Ce8a721Ef5fcCAc5A11983addC526eC80E1` |
|
|
188
|
+
| Escrow V3 | `0x49EdEe04c78B7FeD5248A20706c7a6c540748806` |
|
|
189
|
+
| TrustGraph | `TBD - Pending deployment` |
|
|
227
190
|
|
|
228
|
-
|
|
229
|
-
npm test
|
|
230
|
-
|
|
231
|
-
# Lint
|
|
232
|
-
npm run lint
|
|
233
|
-
```
|
|
191
|
+
### Base Sepolia
|
|
234
192
|
|
|
235
|
-
|
|
193
|
+
| Contract | Address |
|
|
194
|
+
|----------|---------|
|
|
195
|
+
| Identity | `0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c` |
|
|
196
|
+
| Reputation | `0xb0033901e3b94f4F36dA0b3e59A1F4AD9f4f1697` |
|
|
197
|
+
| Credit | `0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d` |
|
|
198
|
+
| Escrow V3 | `0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82` |
|
|
199
|
+
| TrustGraph | `TBD - Pending deployment` |
|
|
236
200
|
|
|
237
|
-
|
|
201
|
+
## Architecture
|
|
238
202
|
|
|
239
|
-
```json
|
|
240
|
-
{
|
|
241
|
-
"error": {
|
|
242
|
-
"code": "ERR_INVALID_INPUT",
|
|
243
|
-
"message": "Human-readable error message",
|
|
244
|
-
"details": {},
|
|
245
|
-
"retryable": false
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
203
|
```
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
const tools = await toolkit.getTools();
|
|
204
|
+
┌─────────────────────────────┐
|
|
205
|
+
│ Agent Framework │
|
|
206
|
+
│ (Claude, LangChain, etc.) │
|
|
207
|
+
└─────────────┬───────────────┘
|
|
208
|
+
│ MCP Protocol (stdio)
|
|
209
|
+
┌─────────────▼───────────────┐
|
|
210
|
+
│ PayLobster MCP Server │
|
|
211
|
+
│ - 55 Tools │
|
|
212
|
+
│ - 3 Resources │
|
|
213
|
+
│ - Viem Client │
|
|
214
|
+
└─────────────┬───────────────┘
|
|
215
|
+
│
|
|
216
|
+
┌─────────────▼───────────────┐
|
|
217
|
+
│ Base L2 Blockchain │
|
|
218
|
+
│ - Smart Contracts │
|
|
219
|
+
│ - USDC Payments │
|
|
220
|
+
└─────────────────────────────┘
|
|
269
221
|
```
|
|
270
222
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
```typescript
|
|
274
|
-
import { Agent } from '@openai/agents-sdk';
|
|
275
|
-
import { PayLobsterMCPServer } from '@paylobster/mcp-server';
|
|
223
|
+
## Security
|
|
276
224
|
|
|
277
|
-
|
|
278
|
-
await paylobster.start();
|
|
225
|
+
⚠️ **Never commit your private key.** Use environment variables or encrypted key management.
|
|
279
226
|
|
|
280
|
-
|
|
281
|
-
model: 'gpt-4',
|
|
282
|
-
tools: paylobster.getTools(),
|
|
283
|
-
});
|
|
284
|
-
```
|
|
227
|
+
For production: use agent mandates with spending limits to cap autonomous spending.
|
|
285
228
|
|
|
286
|
-
##
|
|
229
|
+
## Resources
|
|
287
230
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
│ │ Tool Handlers │ │
|
|
298
|
-
│ │ Resource Handlers │ │
|
|
299
|
-
│ └───────┬──────────────────┘ │
|
|
300
|
-
│ │ │
|
|
301
|
-
│ ┌───────▼──────────────────┐ │
|
|
302
|
-
│ │ Viem Client │ │
|
|
303
|
-
│ │ (Contract Interactions) │ │
|
|
304
|
-
│ └──────────────────────────┘ │
|
|
305
|
-
└───────────┬─────────────────────┘
|
|
306
|
-
│
|
|
307
|
-
┌───────────▼─────────────────────┐
|
|
308
|
-
│ Base Blockchain │
|
|
309
|
-
│ Smart Contracts (V3) │
|
|
310
|
-
└─────────────────────────────────┘
|
|
311
|
-
```
|
|
231
|
+
- **Website**: [paylobster.com](https://paylobster.com)
|
|
232
|
+
- **Documentation**:
|
|
233
|
+
- [Architecture](../docs/ARCHITECTURE.md)
|
|
234
|
+
- [Quickstart](../docs/QUICKSTART.md)
|
|
235
|
+
- [Ecosystem Map](../docs/ECOSYSTEM_MAP.md)
|
|
236
|
+
- **SDK**: [npmjs.com/package/pay-lobster](https://www.npmjs.com/package/pay-lobster)
|
|
237
|
+
- **CLI**: [npmjs.com/package/@paylobster/cli](https://www.npmjs.com/package/@paylobster/cli)
|
|
238
|
+
- **AgentKit Provider**: [npmjs.com/package/@paylobster/agentkit-provider](https://www.npmjs.com/package/@paylobster/agentkit-provider)
|
|
239
|
+
- **Agent Toolkit**: [npmjs.com/package/@paylobster/agent-toolkit](https://www.npmjs.com/package/@paylobster/agent-toolkit)
|
|
312
240
|
|
|
313
241
|
## License
|
|
314
242
|
|
|
315
|
-
MIT
|
|
316
|
-
|
|
317
|
-
## Links
|
|
318
|
-
|
|
319
|
-
- [PayLobster Website](https://paylobster.com)
|
|
320
|
-
- [Documentation](https://docs.paylobster.com)
|
|
321
|
-
- [GitHub](https://github.com/paylobster/paylobster)
|
|
322
|
-
- [MCP Specification](https://modelcontextprotocol.io)
|
|
243
|
+
MIT © PayLobster
|
|
323
244
|
|
|
324
|
-
|
|
245
|
+
---
|
|
325
246
|
|
|
326
|
-
|
|
327
|
-
- GitHub Issues: https://github.com/paylobster/paylobster/issues
|
|
328
|
-
- Discord: https://discord.gg/paylobster
|
|
247
|
+
**Built for the agent economy** 🦞
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const fs_1 = require("fs");
|
|
38
|
+
const path_1 = require("path");
|
|
39
|
+
const dotenv = __importStar(require("dotenv"));
|
|
40
|
+
const server_js_1 = require("./server.js");
|
|
41
|
+
// Load environment variables
|
|
42
|
+
dotenv.config();
|
|
43
|
+
function loadConfig() {
|
|
44
|
+
// Check for config file argument
|
|
45
|
+
const configIndex = process.argv.indexOf('--config');
|
|
46
|
+
let configPath = 'paylobster-mcp.json';
|
|
47
|
+
if (configIndex !== -1 && process.argv[configIndex + 1]) {
|
|
48
|
+
configPath = process.argv[configIndex + 1];
|
|
49
|
+
}
|
|
50
|
+
// Try to load config file
|
|
51
|
+
let fileConfig = {};
|
|
52
|
+
try {
|
|
53
|
+
const configFile = (0, fs_1.readFileSync)((0, path_1.resolve)(configPath), 'utf-8');
|
|
54
|
+
fileConfig = JSON.parse(configFile);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
// Config file is optional
|
|
58
|
+
console.error(`Note: Could not load config file ${configPath}, using environment variables`);
|
|
59
|
+
}
|
|
60
|
+
// Merge with environment variables
|
|
61
|
+
const config = {
|
|
62
|
+
network: (process.env.PAYLOBSTER_NETWORK || fileConfig.network || 'base-sepolia'),
|
|
63
|
+
rpcUrl: process.env.PAYLOBSTER_RPC_URL || fileConfig.rpcUrl,
|
|
64
|
+
contracts: fileConfig.contracts,
|
|
65
|
+
wallet: {
|
|
66
|
+
privateKey: process.env.PAYLOBSTER_PRIVATE_KEY || fileConfig.wallet?.privateKey,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
return config;
|
|
70
|
+
}
|
|
71
|
+
async function main() {
|
|
72
|
+
try {
|
|
73
|
+
const config = loadConfig();
|
|
74
|
+
console.error('Starting PayLobster MCP Server...');
|
|
75
|
+
console.error(`Network: ${config.network}`);
|
|
76
|
+
console.error(`RPC URL: ${config.rpcUrl || 'default'}`);
|
|
77
|
+
const server = new server_js_1.PayLobsterMCPServer(config);
|
|
78
|
+
await server.start();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error('Failed to start server:', error);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
main();
|
|
86
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2BAAkC;AAClC,+BAA+B;AAC/B,+CAAiC;AACjC,2CAAkD;AAGlD,6BAA6B;AAC7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,SAAS,UAAU;IACjB,iCAAiC;IACjC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,UAAU,GAAG,qBAAqB,CAAC;IAEvC,IAAI,WAAW,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QACxD,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,0BAA0B;IAC1B,IAAI,UAAU,GAA8B,EAAE,CAAC;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAA,iBAAY,EAAC,IAAA,cAAO,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9D,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0BAA0B;QAC1B,OAAO,CAAC,KAAK,CAAC,oCAAoC,UAAU,+BAA+B,CAAC,CAAC;IAC/F,CAAC;IAED,mCAAmC;IACnC,MAAM,MAAM,GAAqB;QAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,UAAU,CAAC,OAAO,IAAI,cAAc,CAA4B;QAC5G,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,UAAU,CAAC,MAAM;QAC3D,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,MAAM,EAAE;YACN,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,UAAU,CAAC,MAAM,EAAE,UAAU;SAChF;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAE5B,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,IAAI,+BAAmB,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { PayLobsterMCPServer } from './server.js';
|
|
2
|
+
export type { PayLobsterConfig, ServiceListing, ReputationData, EscrowData, BalanceData } from './types/index.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
await server.start();
|
|
8
|
-
// Handle graceful shutdown
|
|
9
|
-
process.on('SIGINT', () => {
|
|
10
|
-
console.error('Shutting down...');
|
|
11
|
-
process.exit(0);
|
|
12
|
-
});
|
|
13
|
-
process.on('SIGTERM', () => {
|
|
14
|
-
console.error('Shutting down...');
|
|
15
|
-
process.exit(0);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
main().catch((error) => {
|
|
19
|
-
console.error('Fatal error:', error);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
});
|
|
3
|
+
exports.PayLobsterMCPServer = void 0;
|
|
4
|
+
var server_js_1 = require("./server.js");
|
|
5
|
+
Object.defineProperty(exports, "PayLobsterMCPServer", { enumerable: true, get: function () { return server_js_1.PayLobsterMCPServer; } });
|
|
22
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAAzC,gHAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContractClient } from '../utils/contracts';
|
|
2
|
+
export declare function handleResource(uri: string, client: ContractClient): Promise<any>;
|
|
3
|
+
export declare function listResources(): {
|
|
4
|
+
uri: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
}[];
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAiCtF;AA+DD,wBAAgB,aAAa;;;;;IAuC5B"}
|