Skip to main content

Add Lightning Payments to Cursor

Set up the Lightning Enable MCP server in Cursor so your AI agent can pay Lightning invoices and access L402-protected APIs.


Step 1: Get a Strike API Key​

  1. Create a Strike account
  2. Go to developer.strike.me
  3. Generate an API key

See the Claude Code guide for detailed steps.


Step 2: Install the MCP Server​

# .NET
dotnet tool install -g LightningEnable.Mcp

# Or Python
pip install lightning-enable-mcp
NWC wallets (Python)

The base Python install covers every wallet type, including Nostr Wallet Connect (NWC), on every platform (including Windows) with no build toolchain. Older instructions that say pip install lightning-enable-mcp[nwc] still work: the [nwc] extra installs, but it adds nothing. (.NET is unaffected.)


Step 3: Configure Cursor​

You can configure via the UI or by editing the config file directly.

Option A: Cursor Settings UI​

  1. Open Cursor Settings (gear icon)
  2. Go to Tools & MCP
  3. Click New MCP Server
  4. Paste the JSON config below

Option B: Config File​

Create or edit .cursor/mcp.json in your project root (project-specific) or ~/.cursor/mcp.json (global):

.NET:

{
"mcpServers": {
"lightning-enable": {
"command": "lightning-enable-mcp",
"env": {
"STRIKE_API_KEY": "your-strike-api-key"
}
}
}
}

Python:

{
"mcpServers": {
"lightning-enable": {
"command": "uvx",
"args": ["lightning-enable-mcp"],
"env": {
"STRIKE_API_KEY": "your-strike-api-key"
}
}
}
}
warning

Don't commit API keys. Use the global config (~/.cursor/mcp.json) for credentials, or use environment variables set in your shell profile.

Fully restart Cursor after saving (not just close the window).


Step 4: Verify​

Open Cursor Settings > Tools & MCP. You should see lightning-enable listed with a green status indicator and the out-of-the-box tools available. Setting LIGHTNING_ENABLE_API_KEY additionally unlocks the producer tools and the ASA request/publish/unpublish tools (ASA discovery, settlement, and reputation reads work without a key).

Or ask in Cursor's Agent mode:

What MCP tools do you have available?

Test a Payment​

Check my Lightning wallet balance

Access an L402 API​

Get weather data for New York from agent-commerce.store

Project vs Global Config​

LocationScopeBest For
.cursor/mcp.jsonThis project onlySharing tool config with team (no secrets!)
~/.cursor/mcp.jsonAll projectsAPI keys, personal tools

When both exist, project-level takes priority.


Differences from Claude Desktop​

The config format is nearly identical. The only differences:

CursorClaude Desktop
Config file.cursor/mcp.json or ~/.cursor/mcp.jsonclaude_desktop_config.json
Root key"mcpServers" (same)"mcpServers" (same)
UI configSettings > Tools & MCPFile edit only
Remote serversSupported (SSE + HTTP)stdio only

Next Steps​