The Lightning Network MCP Server enables AI models to interact with the Lightning Network, allowing them to pay invoices through a Model Context Protocol (MCP) compliant API. This integration allows AI systems to initiate payments directly on the Lightning Network.
If you're using Claude Desktop, you can install the Lightning Network MCP Server automatically:
npx -y @smithery/cli install @AbdelStark/lightning-mcp --client claude
To install manually:
git clone https://github.com/AbdelStark/lightning-mcp
cd lightning-mcp
npm install
Then create a .env
file with your Lightning Network configuration:
# Bitcoin Lightning Network
## lnbits information
BITCOIN_LNBITS_NODE_URL="https://demo.lnbits.com"
BITCOIN_LNBITS_ADMIN_KEY="..."
BITCOIN_LNBITS_READ_KEY="..."
You can copy the .env.example
file and modify it with your own LNbits credentials.
To run the server in development mode with hot reload:
npm run dev
For production:
npm start
This tool allows you to pay Lightning Network invoices. Here's an example of the input format:
{
"content": "lnbc20n1pneh8papp5x0syxmdqffcltfk8mqp00qc6j4kf5elkmr5pws9gm242mw9n0ejsdqqcqzzsxqyz5vqrzjqvueefmrckfdwyyu39m0lf24sqzcr9vcrmxrvgfn6empxz7phrjxvrttncqq0lcqqyqqqqlgqqqqqqgq2qsp563lg29qthfwgynluv7fvaq5d6y2hfdl383elgc6q68lccfzvpvfs9qxpqysgq2n6yhvs8aeugvrkcx8yjzdrqqmvp237500gxkrk0fe6d6crwpvlp96uvq9z2dfeetv5n23xpjlavgf0fgy4ch980mpv2rcsjasg2hqqpalykyc"
}
The content
field should contain a valid Lightning Network invoice in BOLT11 format. When you send this request to the MCP server, it will process the payment using the configured LNbits account.
For more information about the technologies used in this project:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "lightning-mcp" '{"command":"npx","args":["-y","@smithery/cli","run","@AbdelStark/lightning-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"lightning-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"run",
"@AbdelStark/lightning-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"lightning-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"run",
"@AbdelStark/lightning-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect