ugarapi-mcp-server
v1.1.0
Published
MCP server for UgarAPI - exposes AI services with Bitcoin Lightning payments
Maintainers
Readme
UgarAPI MCP Server
Model Context Protocol (MCP) server for UgarAPI - enables AI agents to discover and use UgarAPI services with Bitcoin Lightning payments.
What This Does
Exposes UgarAPI's services as MCP tools that AI systems (Claude, ChatGPT, etc.) can discover and use automatically:
- extract_web_data - Extract structured data from websites using CSS selectors
- timestamp_document - Create blockchain timestamp proofs for documents
- aggregate_api_call - Route requests through external APIs with failover
All payments are handled automatically via Bitcoin Lightning micropayments.
Installation
For End Users (Claude Desktop, etc.)
- Install via npm:
npm install -g ugarapi-mcp-server- Add to your MCP settings file:
Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ugarapi": {
"command": "ugarapi-mcp",
"env": {
"UGARAPI_BASE_URL": "https://ugarapi.com"
}
}
}
}Restart Claude Desktop
Claude can now use UgarAPI services automatically!
For Developers
git clone https://github.com/yourusername/ugarapi-mcp-server
cd ugarapi-mcp-server
npm install
node ugarapi-mcp-server.jsUsage Examples
Once installed, AI agents can use your services naturally:
Example 1: Web Scraping
User: "Extract the title and price from https://example.com/product"
Claude: [calls extract_web_data tool]
- Creates Lightning invoice (1000 sats)
- Pays automatically
- Returns extracted dataExample 2: Document Timestamping
User: "Timestamp this document hash: abc123..."
Claude: [calls timestamp_document tool]
- Creates Lightning invoice (5000 sats)
- Pays automatically
- Returns blockchain proofExample 3: API Aggregation
User: "What's the weather in Tokyo?"
Claude: [calls aggregate_api_call tool]
- Creates Lightning invoice (200 sats)
- Pays automatically
- Returns weather dataHow Payments Work
- First Call: MCP server creates a Lightning invoice for the service
- Payment: Invoice is paid automatically (in production, you'd configure a Lightning wallet)
- Service Call: Once paid, the service executes
- Idempotency: Same requests won't be charged twice (cached for 24 hours)
Configuration
Environment variables:
UGARAPI_BASE_URL- UgarAPI API endpoint (default: https://ugarapi.com)
Payment Setup (Production)
For production use with real payments, you need:
- Lightning Wallet - Set up a wallet that can pay invoices programmatically
- Auto-Payment Logic - Configure the MCP server to pay invoices automatically
- Spending Limits - Set maximum spend per hour/day to prevent runaway costs
See docs/payment-setup.md for detailed instructions.
Features
✅ Idempotency - Safe retries, no double charges
✅ Rate Limiting - Respects UgarAPI rate limits
✅ Error Handling - Clear error messages for agents
✅ Receipts - Full transaction history
✅ Audit Trail - All calls are logged
Development
Run in development mode:
npm startTest with MCP Inspector:
npx @modelcontextprotocol/inspector node ugarapi-mcp-server.jsPublishing to MCP Registry
Once tested:
- Publish to npm:
npm publish- Submit to MCP registry:
# Follow instructions at https://github.com/modelcontextprotocol/servers- AI systems can now discover UgarAPI automatically!
Roadmap
- [ ] Automatic Lightning payment integration
- [ ] Spending limit controls
- [ ] Multi-agent usage tracking
- [ ] Advanced caching strategies
- [ ] Support for more UgarAPI services as they launch
Support
- UgarAPI Docs: https://ugarapi.com/docs
- Issues: https://github.com/yourusername/ugarapi-mcp-server/issues
- Email: [email protected]
License
MIT License - see LICENSE file for details
