Skip to main content

MCP क्या है?

Model Context Protocol Anthropic का open standard है जो LLMs को external tools तक पहुँच देता है। l402-kit दो श्रेणियों के tools के साथ एक ready-made MCP server प्रदान करता है:

Generic L402 tools

Toolविवरण
l402_fetchकोई भी URL fetch करें — अगर 402 मिले तो स्वचालित रूप से भुगतान करता है
l402_balanceशेष Lightning budget जाँचें
l402_spending_reportइस session के भुगतानों का पूरा विवरण

VERITY tools — paid services, auto-pay included

Toolमूल्यविवरण
verity_btc_price10 satsUSD, EUR, BRL में real-time BTC मूल्य
verity_worldstate80 satsUTC time + geolocation + स्थानीय मौसम
verity_search100 satsWeb search, शीर्ष 10 organic परिणाम
verity_summarize50 sats50,000 chars तक AI summarization
verity_sentiment30 satsSentiment score + keywords
verity_scrape200 satsWeb scraping से clean markdown
verity_domain_intel500 satsWHOIS + DNS + SSL certificates
verity_translate50 sats11 locales में AI translation, MDX-aware
verity_integration10,000 satsकिसी भी GitHub repo के लिए complete l402-kit integration
VERITY tools स्वायत्त रूप से भुगतान करते हैं — कोई manual invoice handling की आवश्यकता नहीं।

Claude Desktop में Setup

1. Node.js ≥ 18 इंस्टॉल करें

2. अपना wallet configure करें

Config file का स्थान:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

3. Claude Desktop पुनः प्रारंभ करें

l402_fetch, l402_balance, और l402_spending_report tools Claude की tool list में दिखाई देंगे।

Environment variables

Variableआवश्यकविवरण
BLINK_API_KEYकेवल Blinkआपकी Blink API key
BLINK_WALLET_IDकेवल Blinkआपका Blink wallet ID
ALBY_TOKENकेवल AlbyAlby access token
ALBY_HUB_URLवैकल्पिकCustom Alby Hub base URL
BUDGET_SATSवैकल्पिकप्रति session अधिकतम खर्च (default: 2000)

Tools का उपयोग

एक बार server चलने के बाद, Claude स्वायत्त रूप से VERITY और किसी भी L402-protected API को call कर सकता है:
You: What's the BTC price right now?

Claude: [calls verity_btc_price]
        [Paid 10 sats] {"bitcoin":{"usd":97500,"eur":89800,"brl":548000}}

        Bitcoin is currently $97,500 USD (Cost: 10 sats)
You: Summarize this article: <pastes 5,000 words>

Claude: [calls verity_summarize with text="..."]
        [Paid 50 sats] {"summary":"..."}
You: Search for "lightning network adoption 2026"

Claude: [calls verity_search with q="lightning network adoption 2026"]
        [Paid 100 sats] {"results":[...]}
You: How much have I spent so far?

Claude: [calls l402_spending_report]
        === L402 Spending Report ===
        Total spent:  160 sats
        Remaining:    1840 sats

        By domain:
          l402kit.com: 160 sats

HTTP MCP endpoint

stdio package के अतिरिक्त, VERITY एक live HTTP MCP server प्रदान करता है — किसी installation की आवश्यकता नहीं:
POST https://l402kit.com/api/mcp
Content-Type: application/json
कोई भी MCP client जो streamable HTTP transport को support करता है, सीधे connect कर सकता है। अपनी Blink credentials headers के रूप में दें:
X-BLINK-API-KEY: your-blink-api-key
X-BLINK-WALLET-ID: your-wallet-id
Initialize:
{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}},"id":1}
Tools की सूची:
{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}
Tool call करें:
{"jsonrpc":"2.0","method":"tools/call","params":{"name":"verity_btc_price","arguments":{}},"id":3}
यह endpoint आपकी wallet credentials का उपयोग करके Lightning invoices का स्वचालित भुगतान करता है और VERITY का परिणाम सीधे वापस करता है।

MCP registries

l402-kit सभी प्रमुख MCP registries में सूचीबद्ध है:
Registryलिंक
Anthropic MCP Registry (official)io.github.ThiagoDataEngineer/l402-kit
Glamaglama.ai/mcp/servers/@ShinyDapps/l402-kit
Smitherysmithery.ai/servers/shinydapps/l402-kit
mcp.sol402-kit खोजें
Machine-readable manifest: GET https://l402kit.com/.well-known/mcp.json

Cursor के साथ Setup

वही config block Settings → MCP Servers के अंतर्गत Cursor की MCP settings में जोड़ें।

किसी भी MCP client के साथ Setup

Server stdin से पढ़ता है / stdout पर लिखता है (stdio transport):
BLINK_API_KEY=xxx BLINK_WALLET_ID=yyy BUDGET_SATS=500 npx l402-kit-mcp
कोई भी MCP-compatible client stdio transport का उपयोग करके connect कर सकता है।

Custom MCP server बनाना

आप अपने खुद के MCP server में L402Client को सीधे embed भी कर सकते हैं:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { L402Client, BlinkWallet } from "l402-kit";
import { z } from "zod";

const client = new L402Client({
  wallet: new BlinkWallet(process.env.BLINK_API_KEY!, process.env.BLINK_WALLET_ID!),
  budgetSats: 1000,
});

const server = new McpServer({ name: "my-agent", version: "1.0.0" });

server.tool(
  "fetch_weather",
  "Get current weather for a city — pays automatically",
  { city: z.string() },
  async ({ city }) => {
    const res = await client.fetch(`https://api.weather.com/current?city=${city}`);
    const text = await res.text();
    return { content: [{ type: "text", text }] };
  },
);

const transport = new StdioServerTransport();
await server.connect(transport);

सुरक्षा संबंधी नोट्स

  • Budget cap (BUDGET_SATS) आपकी प्राथमिक सुरक्षा है — इसे सावधानीपूर्वक कम रखें
  • प्रत्येक npx l402-kit-mcp process की अपनी in-memory budget होती है; restart पर यह reset हो जाती है
  • Production agents के लिए, spending log को onSpend callback के माध्यम से किसी external store में persist करें