askclaude-mcp

March 7, 2026 · View on GitHub

MCP (Model Context Protocol) server for AskClaude — pay-per-query Claude AI via x402 micropayments.

This server exposes AskClaude's paid endpoints as tools that Claude Code (or any MCP client) can call. Each tool call triggers a request to the AskClaude x402 service, where payment is handled in USDC on Base network.

Tools

ToolDescriptionCost
ask_claudeAsk Claude Haiku/Sonnet/Opus a question$0.01 / $0.03 / $0.10
summarizeSummarize text (articles, docs, whitepapers)$0.02
code_reviewReview code with quality score and suggestions$0.05
translateTranslate text between any languages$0.02
sentimentAnalyze sentiment of text$0.01
crypto_analysisAI crypto analysis with live CoinGecko data$0.03

Installation

Option 1: Add to Claude Code MCP config

Add this to your Claude Code settings (~/.claude/settings.json or project .mcp.json):

{
  "mcpServers": {
    "askclaude": {
      "command": "node",
      "args": ["/path/to/askclaude-mcp/index.js"],
      "env": {
        "ASKCLAUDE_BASE_URL": "https://askclaude.shop"
      }
    }
  }
}

Option 2: Run with npx (after publishing)

{
  "mcpServers": {
    "askclaude": {
      "command": "npx",
      "args": ["askclaude-mcp"],
      "env": {
        "ASKCLAUDE_BASE_URL": "https://askclaude.shop"
      }
    }
  }
}

Option 3: Run manually

cd askclaude-mcp
npm install
node index.js

Environment Variables

VariableDescriptionDefault
ASKCLAUDE_BASE_URLAskClaude service URLCloudflare tunnel URL
ASKCLAUDE_API_KEYOptional API key for authenticated access(none)

How x402 Payment Works

  1. You call a tool (e.g., ask_claude with prompt "What is Bitcoin?")
  2. The MCP server sends the request to the AskClaude service
  3. The service is gated by x402 — it requires USDC payment on Base network
  4. If payment is configured (via x402 client wallet), it's handled automatically
  5. The AI response is returned as the tool result

For the payment flow to work end-to-end, the AskClaude service handles x402 negotiation. Users interact with the service through this MCP layer — the x402 payment middleware on the server side validates payments before processing requests.

Usage Examples

Once configured in Claude Code, you can use natural language:

  • "Use askclaude to ask opus: what are the implications of quantum computing on cryptography?"
  • "Summarize this article using askclaude"
  • "Review this Python code with askclaude"
  • "Translate 'hello world' to Japanese using askclaude"
  • "What's the sentiment of this tweet? Use askclaude"
  • "Get crypto analysis for ethereum using askclaude"

Development

# Install dependencies
npm install

# Test locally (stdio mode)
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node index.js

# Point to local service
ASKCLAUDE_BASE_URL=http://localhost:4021 node index.js

Architecture

Claude Code  --(MCP/stdio)-->  askclaude-mcp  --(HTTP/x402)-->  AskClaude Service
   (user)                      (this package)                   (askclaude.shop)
                                                                     |
                                                              Claude API (Anthropic)
                                                              CoinGecko (prices)

License

MIT

Author

@pvega23