@liveauth-labs/mcp-server
v0.1.0
Published
MCP server for LiveAuth - PoW and Lightning authentication for AI agents
Downloads
109
Maintainers
Readme
LiveAuth MCP Server
Model Context Protocol (MCP) server for LiveAuth authentication. Enables AI agents to authenticate using proof-of-work or Lightning Network payments.
What is This?
This MCP server allows AI agents (Claude, GPT, AutoGPT, etc.) to:
- Request proof-of-work challenges
- Solve challenges to prove computational work
- Fallback to Lightning Network payments when needed
- Receive JWT tokens for authenticated API access
Installation
npm install -g @liveauth/mcp-serverOr use directly with npx:
npx @liveauth/mcp-serverConfiguration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"liveauth": {
"command": "npx",
"args": ["-y", "@liveauth/mcp-server"],
"env": {
"LIVEAUTH_API_BASE": "https://api.liveauth.app"
}
}
}
}Other MCP Clients
The server communicates over stdio. Start it with:
liveauth-mcpAvailable Tools
liveauth_get_challenge
Get a proof-of-work challenge for authentication.
Parameters:
projectPublicKey(string): Your LiveAuth project public key (starts withla_pk_)
Returns: Challenge object with difficulty, target, expiration, and signature
Example:
{
projectPublicKey: "la_pk_abc123...",
challengeHex: "a1b2c3...",
targetHex: "0000ffff...",
difficultyBits: 18,
expiresAtUnix: 1234567890,
sig: "signature..."
}liveauth_verify_pow
Verify a solved proof-of-work challenge and receive JWT token.
Parameters:
projectPublicKey(string): Your project public keychallengeHex(string): Challenge from get_challengenonce(number): Solution noncehashHex(string): Resulting hashexpiresAtUnix(number): Expiration from challengedifficultyBits(number): Difficulty from challengesig(string): Signature from challenge
Returns: JWT authentication token or fallback instruction
liveauth_start_lightning
Start Lightning Network payment authentication as fallback.
Parameters:
projectPublicKey(string): Your project public key
Returns: Lightning invoice and session details
Usage Example
An AI agent authenticating to a LiveAuth-protected API would:
- Call
liveauth_get_challengewith the project's public key - Solve the PoW challenge (compute nonce that produces hash below target)
- Call
liveauth_verify_powwith the solution - Receive JWT token
- Use token in
Authorization: Bearer <token>header for API requests
If PoW fails or isn't feasible, the agent can:
- Call
liveauth_start_lightningto get a payment invoice - Pay the Lightning invoice
- Poll for payment confirmation
- Receive JWT token
Why LiveAuth?
For API Providers:
- Protect endpoints from abuse without CAPTCHA
- Monetize AI agent access with micropayments
- No user friction (agents handle authentication)
For AI Agents:
- Permissionless access (no account signup)
- Cryptographically proven authentication
- Choose between compute (PoW) or payment (Lightning)
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/index.jsResources
License
MIT
