lightning-memory MCP server
✓ 인증됨Bitcoin Lightning 경제에서 작동하는 AI agent를 위해 지속적인 메모리, 판매자 평판 추적 및 결제 안전 게이트를 제공합니다.
다른 이름 singularityjason/lightning-memory
- 스타
- 9
- Tools
- 6
- 다운로드, 30일
- 67
- 최신 버전
- 0.4.1
- 마지막 커밋
- 2026년 3월 25일
- 라이선스
- MIT
lightning-memory MCP란?
lightning-memory은(는) MCP server입니다. Bitcoin Lightning 경제에서 작동하는 AI agent를 위해 지속적인 메모리, 판매자 평판 추적 및 결제 안전 게이트를 제공합니다. 6개 도구를 제공합니다. 예: memory_store, memory_query, memory_list.
프로젝트 README에서 생성된 요약
lightning-memory MCP server 정보
Bitcoin Lightning 경제 내에서 작동하는 자율 agent는 이 도구를 사용하여 금융 활동에 대한 지속적인 메모리를 유지할 수 있습니다. 이는 agent가 이전 트랜잭션, 판매자 신뢰도 또는 가격 이력에 대한 지식 없이 매 세션을 시작해야 하는 문제를 해결합니다. L1 및 L2 결제 상위에 인텔리전스 계층을 제공함으로써 agent가 지출을 통해 학습하고, 판매자 평판을 추적하며, 가격 이상 징후를 감지할 수 있게 합니다.
개발자는 MCP를 통해 Claude Desktop 또는 Claude Code와 같은 클라이언트와 통합할 수 있습니다. 이 시스템은 SQLite를 저장소로 사용하는 local-first 방식이며, 전통적인 계정이나 API 키 대신 Nostr 키를 통해 agent를 식별합니다. 판매자별 한도 설정과 같은 예산 집행을 위한 특화된 도구와 과거 맥락을 기반으로 결제를 승인하거나 거부하는 pre-flight gate와 같은 안전 기능을 포함합니다. 분산 네트워크를 구축하는 사용자를 위해, other agent가 특정 메모리 데이터를 조회하기 위해 마이크로 결제를 할 수 있는 L402 게이트웨이를 지원합니다.
활용 사례
- 1의심스러운 가격 상승 감지현재 인보이스가 동일한 판매자에게 이전에 지불했던 금액보다 현저히 높은지 agent에게 확인하도록 요청합니다.
- 2엄격한 지출 한도 적용특정 판매자에 대해 단일 트랜잭션이 지정된 sats 금액을 초과하지 않도록 agent에게 지시합니다.
- 3판매자 신뢰도 검증agent의 과거 성공 및 실패 트랜잭션을 기반으로 판매자에 대한 평판 보고서를 요청합니다.
- 4pre-flight 체크를 통한 결제 보안Lightning 결제를 보내기 전에 예산 가용성과 판매자 신뢰도를 확인하는 안전 점검을 agent가 수행하도록 합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
lightning-memory MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 lightning-memory MCP 설치
$ claude mcp add lightning-memory -- uvx lightning-memoryCursor에 lightning-memory MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"lightning-memory": {
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}VS Code에 lightning-memory MCP 설치
.vscode/mcp.json
{
"servers": {
"lightning-memory": {
"type": "stdio",
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}VS Code CLI에 lightning-memory MCP 설치
$ code --add-mcp '{"name":"lightning-memory","type":"stdio","command":"uvx","args":["lightning-memory"]}'Claude Desktop에 lightning-memory MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"lightning-memory": {
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}Codex에 lightning-memory MCP 설치
$ codex mcp add lightning-memory -- uvx lightning-memoryCodex config.toml에 lightning-memory MCP 설치
~/.codex/config.toml
[mcp_servers.lightning-memory] command = "uvx" args = ["lightning-memory"]
Gemini CLI에 lightning-memory MCP 설치
$ gemini mcp add -s user lightning-memory uvx -- lightning-memoryGemini settings.json에 lightning-memory MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"lightning-memory": {
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}lightning-memory MCP 도구 6
README에서 감지됨memory_storememory_querymemory_listmemory_editmemory_syncmemory_export
| memory_store | — | |
| memory_query | — | |
| memory_list | — | |
| memory_edit | — | |
| memory_sync | — | |
| memory_export | — |
구성
PHOENIXD_PASSWORD
| 이름 | 설명 | 유형 |
|---|---|---|
| PHOENIXD_PASSWORD | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능singularityjason/lightning-memory is public and reachablegithub.com/singularityjason/lightning-memory ↗통과
- 패키지가 이 저장소를 소스로 명시lightning-memory names singularityjason/lightning-memory as sourcepypi.org/project/lightning-memory/ ↗통과
- 빌드 출처(Sigstore 증명)No build attestation published for this release검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-03-25github.com/singularityjason/lightning-memory ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from lightning-memory통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음29 resolved dependencies checked; no critical advisoryosv.dev ↗통과
- 모델에 대한 숨겨진 지침 없음6 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기Lightning Memory
Persistent memory for AI agents in the Lightning economy.
The Problem
AI agents spend sats over Lightning via L402 — but they can't remember what they bought. Every session starts from zero. Every vendor is a stranger. Every price is accepted at face value. An agent that paid 500 sats yesterday doesn't know if today's 5,000 sat invoice is a price spike or normal.
The Solution
L1: Bitcoin — settles
L2: Lightning — pays
L3: Lightning Memory — remembers
Lightning Memory gives agents persistent memory, vendor intelligence, and payment safety gates. Agents learn from their spending history, track vendor reputations, detect price anomalies, enforce budgets, and share trust signals with other agents.
Interactive Demo — watch an agent learn, get rugged, and route around bad actors.
Building the Agent Economy — trust, budgets, compliance, and the memory marketplace.
Who Is This For
- Agents making L402 payments that need vendor reputation and spending discipline
- Developers building autonomous agents on Bitcoin/Lightning
- Anyone running an MCP-compatible AI agent (Claude, GPT, or any MCP client)
Quick Start
pip install lightning-memory
lightning-memory # starts MCP server
Configure in Claude Code
{
"mcpServers": {
"lightning-memory": {
"command": "lightning-memory"
}
}
}
Configure in Claude Desktop
{
"mcpServers": {
"lightning-memory": {
"command": "python",
"args": ["-m", "lightning_memory.server"]
}
}
}
How It Compares
| Feature | Lightning Memory | Mem0 | Raw file storage | No memory |
|---|---|---|---|---|
| Lightning/L402 awareness | Yes | No | No | No |
| Vendor reputation tracking | Yes | No | Manual | No |
| Spending anomaly detection | Yes | No | No | No |
| Nostr identity (BIP-340) | Yes | No | No | No |
| Relay sync (NIP-78) | Yes | No | No | No |
| Full-text + semantic search | Yes | Yes | No | No |
| Agent-to-agent knowledge markets | Yes (L402 gateway) | No | No | No |
| Budget enforcement | Yes | No | No | No |
| KYC/trust profiles | Yes | No | No | No |
| Payment pre-flight gate | Yes | No | No | No |
| Contradiction detection | Yes | No | No | No |
| Local-first / offline | Yes | Cloud | Yes | N/A |
| MCP native | Yes | Plugin | No | No |
| Zero config | Yes | API key required | Manual setup | N/A |
Tools (22)
Memory
| Tool | Description |
|---|---|
memory_store |
Store a memory (transaction, vendor, preference, error, decision) |
memory_query |
Search by relevance (FTS5 + optional semantic search) |
memory_list |
List memories with type/time filters |
memory_edit |
Edit content or metadata with audit trail |
memory_sync |
Sync with Nostr relays (push/pull) |
memory_export |
Export as NIP-78 Nostr events |
memory_store(
content="Paid 500 sats to bitrefill.com for a $5 Amazon gift card via L402.",
type="transaction",
metadata='{"vendor": "bitrefill.com", "amount_sats": 500}'
)
memory_query(query="bitrefill payment history", limit=5)
# → recency-weighted results with dedup and contradiction alerts
Lightning Intelligence
| Tool | Description |
|---|---|
ln_vendor_reputation |
Reputation score from transaction history |
ln_spending_summary |
Spending breakdown by vendor and protocol |
ln_anomaly_check |
Detect if a payment is abnormally high |
ln_vendor_reputation(vendor="bitrefill.com")
# → {reputation: {total_txns: 12, success_rate: 0.92, avg_sats: 450}, recommendation: "reliable"}
ln_anomaly_check(vendor="bitrefill.com", amount_sats=5000)
# → {anomaly: {verdict: "high", context: "5000 sats is 11.1x the historical average..."}}
Payment Safety
| Tool | Description |
|---|---|
ln_preflight |
Pre-flight gate: budget + anomaly + trust check before payment |
ln_budget_set |
Set per-vendor spending limits (per txn, per day, per month) |
ln_budget_check |
Check spending against limits |
ln_budget_status |
Gateway earnings and L402 payment stats |
ln_preflight(vendor="bitrefill.com", amount_sats=500)
# → {decision: {verdict: "approve", budget_remaining_today: 4500, trust_score: 0.89}}
# If the vendor suddenly charges 50x:
ln_preflight(vendor="bitrefill.com", amount_sats=25000)
# → {decision: {verdict: "reject", reasons: ["exceeds daily limit of 5000 sats"]}}
Trust & Compliance
| Tool | Description |
|---|---|
ln_vendor_trust |
Full trust profile (KYC + reputation + community score) |
ln_trust_attest |
Publish NIP-85 trust attestation to Nostr relays |
ln_agent_attest |
Store a KYA (Know Your Agent) attestation |
ln_agent_verify |
Look up an agent's compliance status |
ln_auth_session |
Store LNURL-auth session records |
ln_auth_lookup |
Look up LNURL-auth sessions |
ln_compliance_report |
Generate structured compliance export |
Marketplace
| Tool | Description |
|---|---|
ln_discover_gateways |
Find remote Lightning Memory gateways via Nostr |
ln_remote_query |
Query a remote gateway via L402 micropayment |
ln_discover_gateways(operation="memory_query")
# → {count: 2, gateways: [{url: "https://gw1.example.com", operations: {...}}, ...]}
ln_remote_query(
gateway_url="https://gw.example.com",
operation="ln_vendor_reputation",
params='{"vendor": "openai"}'
)
# → Pays 3 sats, returns remote agent's vendor intelligence
Architecture
- Nostr identity: Agent identity = Nostr keypair (BIP-340). No accounts, no API keys.
- Local-first: SQLite with FTS5 full-text search + optional ONNX semantic search. Works offline.
- Nostr sync: Memories written as NIP-78 events to relays. Portable, tamper-proof.
- L402 payments: Pay-per-query gateway. 1-10 sats per operation.
- Memory quality: Deduplication, contradiction detection, noise filtering, recency-weighted ranking, access tracking.
L402 Gateway
Run an L402 pay-per-query HTTP gateway. Other agents pay Lightning micropayments to access your agent's memory — no API keys, no accounts.
pip install lightning-memory[gateway]
lightning-memory-gateway # Listening on 0.0.0.0:8402
How L402 Works
Agent Gateway Phoenixd
| | |
|-- GET /memory/query?q=... --->| |
|<-- 402 + Lightning invoice ---|--- create_invoice -------->|
| |<-- bolt11 + payment_hash --|
| | |
| [pay invoice via Lightning] | |
| | |
|-- GET + L402 token ---------->| |
| (macaroon:preimage) |--- verify preimage ------->|
|<-- 200 + query results -------| |
Endpoints
| Endpoint | Method | Price | Description |
|---|---|---|---|
/info |
GET | Free | Gateway status, pricing, node info |
/health |
GET | Free | Health check |
/memory/store |
POST | 3 sats | Store a memory |
/memory/query |
GET | 2 sats | Search memories by relevance |
/memory/list |
GET | 1 sat | List memories with filters |
/ln/vendor/{name} |
GET | 3 sats | Vendor reputation report |
/ln/spending |
GET | 2 sats | Spending summary |
/ln/anomaly-check |
POST | 3 sats | Payment anomaly detection |
/ln/preflight |
POST | 3 sats | Pre-flight payment gate |
/ln/trust/{name} |
GET | 2 sats | Vendor trust profile |
/ln/budget |
GET | 1 sat | Budget rules and spending |
/ln/compliance-report |
GET | 10 sats | Compliance report export |
Phoenixd Setup
- Download and run Phoenixd (listens on
localhost:9740) - Fund it with ~10,000 sats for initial channel opening
- Configure:
~/.lightning-memory/config.json→{"phoenixd_password": "<from ~/.phoenix/phoenix.conf>"} - Start:
lightning-memory-gateway
Docker
PHOENIXD_PASSWORD=your-password docker compose up
CLI Commands
lightning-memory # Start MCP server
lightning-memory stats # Memory statistics dashboard
lightning-memory export json # Export memories as JSON
lightning-memory export csv # Export memories as CSV
lightning-memory relay-status # Check Nostr relay connectivity
lightning-memory-gateway # Start L402 HTTP gateway
lightning-memory-manifest # Generate gateway discovery manifest
Relay Configuration
Default relays: wss://relay.damus.io, wss://nos.lol, wss://relay.nostr.band
Customize in ~/.lightning-memory/config.json:
{
"relays": ["wss://relay.damus.io", "wss://nos.lol", "wss://relay.primal.net"],
"sync_timeout_seconds": 30,
"max_events_per_sync": 500
}
| Relay | Speed | Reliability | Notes |
|---|---|---|---|
wss://relay.damus.io |
Fast | High | Most popular, good uptime |
wss://nos.lol |
Fast | High | Reliable, good NIP-78 support |
wss://relay.nostr.band |
Medium | Medium | Search-focused, may be slow |
wss://relay.primal.net |
Fast | High | Well-maintained |
wss://nostr.wine |
Fast | High | Paid relay, less spam |
Optional: Semantic Search
Add ONNX-based semantic similarity search alongside FTS5 keyword search:
pip install lightning-memory[semantic]
Queries then use hybrid ranking: FTS5 BM25 + cosine similarity with reciprocal rank fusion. "Which vendors are reliable for transcription" matches memories containing "whisper API" and "audio-to-text" even without exact keyword overlap.
Data Storage
~/.lightning-memory/
memories.db # SQLite database
keys/
private.key # Nostr private key (chmod 600)
public.key # Nostr public key (your agent identity)
Roadmap
- Phase 1: MCP server with local SQLite storage
- Phase 2: Lightning intelligence (vendor reputation, spending summary, anomaly detection)
- Phase 3: Nostr relay sync (NIP-78, Schnorr signing, bidirectional sync)
- Phase 4: L402 payment gateway (macaroons, Phoenixd, HTTP gateway)
- Phase 5: Compliance & trust (budget enforcement, vendor KYC, community reputation, pre-flight gate)
- Phase 6: Memory marketplace (gateway discovery, remote L402 queries, gateway client)
- Phase 7: Agent reliability (semantic search, deduplication, contradiction detection, circuit breakers)
Star History
License
MIT
lightning-memory MCP 질문
lightning-memory MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add lightning-memory -- uvx lightning-memory를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
lightning-memory MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
lightning-memory MCP는 어떤 도구를 제공하나요?
6개 도구를 제공합니다. 예: memory_store, memory_query, memory_list, memory_edit, memory_sync.
Lightning Memory가 AI agent에게 어떤 역할을 하나요?
지속적인 메모리, 판매자 인텔리전스 및 결제 안전 게이트를 제공하여 agent가 지출 내역을 통해 학습하고 가격 이상 징후를 감지할 수 있도록 합니다.
Claude와 함께 사용할 수 있나요?
네, MCP와 호환되며 Claude Code 또는 Claude Desktop에서 설정할 수 있습니다.