Blink MCP Server

Blink MCP Server

Enables AI assistants to interact with the Blink Bitcoin and Lightning Network API for managing wallets, payments, invoices, and L402 services.

Category
访问服务器

README

Blink MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with access to the Blink Bitcoin and Lightning Network API.

Features

  • Lightning Network: Create and pay invoices, send to Lightning addresses
  • On-Chain Bitcoin: Generate addresses, send transactions, estimate fees
  • Stablesats (USD): Full support for USD-denominated wallets
  • Intraledger Transfers: Free instant transfers between Blink users
  • Webhooks: Register callbacks for payment notifications
  • Real-time Subscriptions: Monitor invoice status and account updates
  • Price Data: Get real-time and historical Bitcoin prices
  • L402 Consumer: Discover, pay for, and cache tokens for L402-gated APIs
  • L402 Producer: Create Lightning paywalls and verify payment tokens
  • L402 Discovery: Search l402.directory and 402index.io for paid APIs

Prerequisites

Installation

From Source

git clone https://github.com/yourusername/blink-mcp.git
cd blink-mcp
npm install
npm run build

Getting an API Key

  1. Log in to your Blink wallet at dashboard.blink.sv
  2. Go to Settings > API Keys
  3. Click Create API Key
  4. Select the permissions you need:
    • Read: View balances, transactions, and account info
    • Receive: Create invoices and addresses to receive payments
    • Write: Send payments and modify account settings
  5. Copy the generated API key

Configuration

Set the following environment variables:

# Required: Your Blink API key
export BLINK_API_KEY=blink_xxxxxxxxxxxxx

# Optional: Network to use (default: mainnet)
export BLINK_NETWORK=mainnet  # or 'staging' for testnet

Usage with Claude Desktop

Add to your Claude Desktop configuration (~/.config/claude/claude_desktop_config.json on Linux/Mac or %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "blink": {
      "command": "node",
      "args": ["/path/to/blink-mcp/dist/index.js"],
      "env": {
        "BLINK_API_KEY": "your_api_key_here"
      }
    }
  }
}

Or if installed globally via npm:

{
  "mcpServers": {
    "blink": {
      "command": "blink-mcp",
      "env": {
        "BLINK_API_KEY": "your_api_key_here"
      }
    }
  }
}

Usage with Other MCP Clients

The server uses stdio transport. Run it with:

BLINK_API_KEY=your_key node dist/index.js

Available Tools

Wallet & Account (17 tools)

Tool Description
get_account_info Get current user account information
get_wallets List all wallets with balances
get_wallet_balance Get balance of a specific wallet
get_transactions Get transaction history (paginated)
get_transaction_by_id Get specific transaction details
get_account_limits View withdrawal and transfer limits
set_default_wallet Set default wallet (BTC or USD)
set_display_currency Set display currency preference
get_realtime_price Get current Bitcoin price
get_price_history Get historical price data
convert_currency Convert between fiat and Bitcoin
get_supported_currencies List supported currencies
lookup_user_wallet Find wallet by Blink username
check_username_available Check username availability
set_username Set/update your username
get_authorization_scopes View API key permissions
get_network_info Get Lightning node info

Lightning Network (12 tools)

Tool Description
create_invoice Create BTC Lightning invoice
create_invoice_usd Create USD-denominated invoice
create_invoice_no_amount Create open (any amount) invoice
cancel_invoice Cancel unpaid invoice
get_invoice_status Check invoice status by hash
get_invoice_status_by_request Check status by bolt11
pay_invoice Pay a Lightning invoice
pay_invoice_with_amount Pay open invoice with amount
pay_lightning_address Send to Lightning address
pay_lnurl Pay via LNURL
estimate_lightning_fee Estimate payment fee
estimate_lightning_fee_no_amount Estimate fee for open invoice

On-Chain Bitcoin (7 tools)

Tool Description
create_onchain_address Generate new receiving address
get_current_onchain_address Get current address
send_onchain Send BTC on-chain
send_onchain_all Sweep entire balance
send_onchain_usd Send from USD wallet on-chain
estimate_onchain_fee Estimate BTC transaction fee
estimate_onchain_fee_usd Estimate USD wallet fee

Intraledger (Blink-to-Blink) (3 tools)

Tool Description
send_to_wallet Send BTC to wallet ID (free, instant)
send_to_wallet_usd Send USD to wallet ID
send_to_username Send to Blink username

Webhooks & Subscriptions (9 tools)

Tool Description
list_webhooks List registered webhooks
add_webhook Register webhook endpoint
remove_webhook Remove webhook
subscribe_invoice_status Subscribe to invoice updates
subscribe_invoice_status_by_hash Subscribe by payment hash
subscribe_account_updates Subscribe to all account events
subscribe_price_updates Subscribe to price changes
list_subscriptions List active subscriptions
cancel_subscription Cancel a subscription
cancel_all_subscriptions Cancel all subscriptions

L402 Protocol (6 tools)

Tool Description
l402_discover Probe a URL for L402 payment requirements (no payment)
l402_pay Access an L402-protected URL, paying automatically via Blink
l402_store Manage the L402 token cache (~/.blink/l402-tokens.json)
l402_challenge_create Create an L402 payment challenge (invoice + signed macaroon)
l402_payment_verify Verify an L402 payment token (preimage + HMAC signature + caveats)
l402_search Search L402 service directories (l402.directory or 402index.io)

Example Conversations

Check Balance

User: What's my Bitcoin balance?
Assistant: [Uses get_wallets tool]
Your BTC wallet has 50,000 sats and your USD wallet has $12.50.

Create Invoice

User: Create an invoice for 10,000 sats
Assistant: [Uses create_invoice tool]
Here's your Lightning invoice for 10,000 sats:
lnbc100u1p...

Send Payment

User: Send 1000 sats to user@blink.sv
Assistant: [Uses pay_lightning_address tool]
Payment of 1,000 sats sent successfully to user@blink.sv!

Monitor Invoice

User: Let me know when invoice lnbc... is paid
Assistant: [Uses subscribe_invoice_status tool]
I'm now monitoring the invoice. I'll notify you when it's paid.

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in development mode
npm run dev

# Type checking
npm run typecheck

# Linting
npm run lint

Architecture

src/
├── index.ts              # MCP server entry point
├── client.ts             # Blink GraphQL client
├── types.ts              # TypeScript type definitions
├── graphql/
│   └── operations.ts     # GraphQL queries, mutations, subscriptions
└── tools/
    ├── wallet.ts         # Wallet and account tools
    ├── lightning.ts      # Lightning Network tools
    ├── onchain.ts        # On-chain Bitcoin tools
    ├── intraledger.ts    # Blink-to-Blink transfer tools
    ├── webhooks.ts       # Webhook and subscription tools
    └── l402.ts           # L402 consumer, producer, and discovery tools

API Reference

This MCP server wraps the Blink GraphQL API. For detailed API documentation, visit:

Security Considerations

  • API Key Security: Never commit your API key to version control
  • Permission Scoping: Use the minimum required permissions for your use case
  • Write Operations: Be cautious with write permissions as they allow sending funds
  • Environment Variables: Store API keys in environment variables, not in config files

Troubleshooting

"BLINK_API_KEY environment variable is required"

Make sure you've set the BLINK_API_KEY environment variable with your API key.

"GraphQL Error: Not authorized"

Your API key may not have the required permissions. Check your key's scopes in the Blink wallet settings.

WebSocket connection issues

Real-time subscriptions require a stable connection. Check your network and firewall settings.

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Links

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选