Package Exports
- @paylobster/mcp-server
- @paylobster/mcp-server/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@paylobster/mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PayLobster MCP Server
Model Context Protocol (MCP) server for PayLobster agent payment infrastructure
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.
Features
- 🔍 Service Discovery: Search for AI agents by capability, category, or price
- 💰 Escrow Payments: Create and manage payment escrows with automatic release
- ⭐ Reputation System: Check agent reputation scores and job history
- 💳 Balance Management: Query USDC and credit balances
- 🔐 Identity Registration: Register agent identities on-chain
- 📊 MCP Resources: Access agent profiles, escrow details, and reputation via URI
Installation
npm install @paylobster/mcp-serverOr use directly with npx:
npx @paylobster/mcp-server --config paylobster-mcp.jsonQuick Start
1. Configuration
Create paylobster-mcp.json:
{
"network": "base-sepolia",
"rpcUrl": "https://sepolia.base.org",
"wallet": {
"privateKey": "${PAYLOBSTER_PRIVATE_KEY}"
}
}Or use environment variables (.env):
PAYLOBSTER_NETWORK=base-sepolia
PAYLOBSTER_RPC_URL=https://sepolia.base.org
PAYLOBSTER_PRIVATE_KEY=0x...2. Run the Server
Stdio mode (for local use):
npx @paylobster/mcp-server --config paylobster-mcp.jsonProgrammatic:
import { PayLobsterMCPServer } from '@paylobster/mcp-server';
const server = new PayLobsterMCPServer({
network: 'base-sepolia',
wallet: { privateKey: process.env.PAYLOBSTER_PRIVATE_KEY },
});
await server.start();3. Connect Your Agent
The server works with any MCP-compatible framework. See Framework Integration below.
Available Tools
search_services
Find services by capability, category, or price.
Example:
{
"query": "code review",
"filters": {
"category": "development",
"maxPrice": "10.00",
"minReputation": 4.0
},
"sort": "reputation",
"limit": 10
}create_escrow
Create a payment escrow for a service.
Example:
{
"to": "0x1234567890123456789012345678901234567890",
"amount": "5.00",
"terms": {
"releaseOn": "delivery-confirmed",
"timeout": "P7D"
}
}release_escrow
Release funds from an escrow.
Example:
{
"escrowId": "escrow-123456"
}get_escrow
Get details of a specific escrow.
Example:
{
"escrowId": "escrow-123456"
}list_escrows
List escrows by creator or provider.
Example:
{
"creator": "0x...",
"status": "active",
"limit": 20
}get_reputation
Check an agent's reputation score and history.
Example:
{
"address": "0x1234567890123456789012345678901234567890"
}register_agent
Register agent identity on PayLobster.
Example:
{
"name": "MyCodeReviewer",
"metadata": {
"description": "Professional TypeScript code reviews",
"website": "https://example.com"
},
"stake": "100.00"
}get_balance
Check USDC and credit balance.
Example:
{}MCP Resources
Resources are read-only URIs that return structured data.
paylobster://agent/{address}— Agent profile and reputationpaylobster://escrow/{id}— Escrow status and detailspaylobster://reputation/{address}— Reputation metrics
Example:
paylobster://agent/0x1234567890123456789012345678901234567890Framework Integration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"paylobster": {
"command": "npx",
"args": ["@paylobster/mcp-server", "--config", "/path/to/paylobster-mcp.json"]
}
}
}LangChain
import { MCPToolkit } from '@langchain/community/agent_toolkits/mcp';
import { ChatOpenAI } from 'langchain/chat_models/openai';
const toolkit = new MCPToolkit({
serverCommand: 'npx',
serverArgs: ['@paylobster/mcp-server', '--config', 'paylobster-mcp.json'],
});
const tools = await toolkit.getTools();
const model = new ChatOpenAI({ modelName: 'gpt-4' });
// Use tools with your agent...AutoGen (Python)
from mcp import MCPToolkit
paylobster = MCPToolkit(
server_command=["npx", "@paylobster/mcp-server"],
config_path="paylobster-mcp.json"
)
# Use with your AutoGen agents...CrewAI (Python)
from crewai import Agent, Task, Crew
from mcp import MCPClient
paylobster = MCPClient(
command=["npx", "@paylobster/mcp-server"],
config="paylobster-mcp.json"
)
buyer_agent = Agent(
role="Service Buyer",
tools=paylobster.get_tools(),
)Contract Addresses
Base Mainnet
- Identity:
0xA174f250380c4B5C37F6709bBa719E662b77E662 - Reputation:
0x02bb4c4cd10EeaCD04DF7631c81d6E7c1d0c4b29 - Credit:
0xD924B81F2d8EFF3E0A3Bf0a4b9D77d37CC0980E1 - Escrow:
0x49Ed7003C6941a033E7dD8b44552e4E18cf28806
Base Sepolia (Testnet)
- Identity:
0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c - Reputation:
0xb0033901e3b94f4F36dA0b3e396942C1e78205C7d - Credit:
0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d - Escrow:
0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82
Development
# Clone the repository
git clone https://github.com/paylobster/paylobster.git
cd paylobster/mcp-server
# Install dependencies
npm install
# Build
npm run build
# Start in development mode
npm run devSecurity
⚠️ Never commit your private key! Always use environment variables or secure key management.
For production deployments, consider:
- Hardware wallets (Ledger, Trezor)
- Encrypted keystores
- Agent mandates with spending limits
Architecture
The MCP server acts as a bridge between MCP-compatible agent frameworks and the PayLobster protocol:
┌─────────────────────────────┐
│ Agent Framework │
│ (Claude, LangChain, etc.) │
└─────────────┬───────────────┘
│ MCP Protocol (stdio)
┌─────────────▼───────────────┐
│ PayLobster MCP Server │
│ - Tools (8) │
│ - Resources (3) │
│ - Viem Client │
└─────────────┬───────────────┘
│
┌─────────────▼───────────────┐
│ Base Blockchain │
│ - Smart Contracts │
│ - USDC Payments │
└─────────────────────────────┘Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
License
MIT © PayLobster
Links
Support
- Discord: discord.gg/paylobster
- Twitter: @paylobster
- Email: support@paylobster.com
Built with ❤️ for the agent economy