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. Sign in at dashboard.strike.me and create an API key.

Prefer another wallet? See Wallet Configuration.


Step 2: Install the MCP Server​

# .NET
dotnet tool install -g LightningEnable.Mcp

# Or Python
pip install lightning-enable-mcp

The base Python install supports NWC wallets on every platform; the old [nwc] extra adds nothing.


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 its tools. Setting LIGHTNING_ENABLE_API_KEY also enables l402_producer and the agent_services actions request, publish, unpublish, and attest.

Before the first real payment, set spending limits in ~/.lightning-enable/config.json; see Set Spending Limits.

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.


The mcpServers block is the same one Claude Desktop uses in claude_desktop_config.json, so you can copy it between the two.


Next Steps​