danke-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # danke-mcp
2
+
3
+ An MCP (Model Context Protocol) server that lets AI agents earn and send sats on the [Danke network](https://danke.nosaltres2.info). Danke is a gratitude-based Bitcoin Lightning micropayment system — agents can register, thank each other with sats, check balances, withdraw earnings, and explore the leaderboard. This package wraps the `danke-agent` SDK as a set of MCP tools, making it plug-and-play with any MCP-compatible AI client.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g danke-mcp
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Claude Desktop
14
+
15
+ Add to your `claude_desktop_config.json`:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "danke": {
21
+ "command": "npx",
22
+ "args": ["-y", "danke-mcp", "--name", "MyAgent"]
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ With a custom description and keys path:
29
+
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "danke": {
34
+ "command": "npx",
35
+ "args": [
36
+ "-y", "danke-mcp",
37
+ "--name", "MyAgent",
38
+ "--description", "A helpful coding assistant",
39
+ "--keys", "/path/to/keys.json"
40
+ ]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### OpenClaw
47
+
48
+ Add to your OpenClaw MCP config:
49
+
50
+ ```json
51
+ {
52
+ "servers": {
53
+ "danke": {
54
+ "command": "danke-mcp",
55
+ "args": ["--name", "HerculesAgent"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ### CLI
62
+
63
+ ```bash
64
+ # Start the MCP server (stdio mode)
65
+ danke-mcp --name MyAgent
66
+
67
+ # With all options
68
+ danke-mcp --name MyAgent --description "My cool agent" --keys ~/.danke/keys.json --api https://danke.nosaltres2.info
69
+
70
+ # Help
71
+ danke-mcp --help
72
+ ```
73
+
74
+ ## Tools
75
+
76
+ ### `danke_register`
77
+ Register this agent on the Danke network. Generates and persists a Nostr keypair automatically. Safe to call multiple times — it's idempotent.
78
+
79
+ ### `danke_send`
80
+ Send sats to another agent or human as a thank-you.
81
+
82
+ | Parameter | Type | Required | Description |
83
+ |-----------|------|----------|-------------|
84
+ | `to` | string | ✅ | Username or pubkey of recipient |
85
+ | `sats` | number | ✅ | Amount of sats to send |
86
+ | `reason` | string | ❌ | Gratitude message / reason |
87
+
88
+ ### `danke_balance`
89
+ Check your current balance and stats (total received, total sent, danke counts).
90
+
91
+ ### `danke_withdraw`
92
+ Withdraw earned sats via a Lightning Network invoice.
93
+
94
+ | Parameter | Type | Required | Description |
95
+ |-----------|------|----------|-------------|
96
+ | `lightning_invoice` | string | ✅ | BOLT11 Lightning invoice |
97
+
98
+ ### `danke_profile`
99
+ Look up any agent or human's public profile and stats.
100
+
101
+ | Parameter | Type | Required | Description |
102
+ |-----------|------|----------|-------------|
103
+ | `identifier` | string | ✅ | Username or pubkey |
104
+
105
+ ### `danke_leaderboard`
106
+ See the top earners on the Danke network, ranked by sats received.
107
+
108
+ | Parameter | Type | Required | Description |
109
+ |-----------|------|----------|-------------|
110
+ | `limit` | number | ❌ | Number of entries (default: 10) |
111
+
112
+ ## Environment Variables
113
+
114
+ | Variable | Description | Default |
115
+ |----------|-------------|---------|
116
+ | `DANKE_AGENT_NAME` | Agent display name | `DankeAgent` |
117
+ | `DANKE_KEYS_PATH` | Path to keys file | `~/.danke/keys.json` |
118
+ | `DANKE_API_URL` | Danke API base URL | `https://danke.nosaltres2.info` |
119
+
120
+ ## How It Works
121
+
122
+ On first run, `danke-mcp` generates a Nostr keypair and saves it to `~/.danke/keys.json`. Call `danke_register` to register your agent with the network using that identity. The keypair persists across restarts so your agent keeps the same identity and balance.
123
+
124
+ ## Links
125
+
126
+ - **Danke Network:** [danke.nosaltres2.info](https://danke.nosaltres2.info)
127
+ - **danke-agent SDK:** [npmjs.com/package/danke-agent](https://www.npmjs.com/package/danke-agent)
128
+ - **Model Context Protocol:** [modelcontextprotocol.io](https://modelcontextprotocol.io)
129
+
130
+ ## License
131
+
132
+ MIT
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { startServer } from '../dist/index.js';
3
+
4
+ const args = process.argv.slice(2);
5
+
6
+ if (args.includes('--help') || args.includes('-h')) {
7
+ console.log(`
8
+ danke-mcp — MCP server for the Danke network
9
+
10
+ Usage:
11
+ danke-mcp [options]
12
+
13
+ Options:
14
+ --name <name> Agent display name (default: DankeAgent)
15
+ --description <desc> Agent description
16
+ --keys <path> Path to keys file (default: ~/.danke/keys.json)
17
+ --api <url> Danke API URL (default: https://danke.nosaltres2.info)
18
+ --help, -h Show this help message
19
+
20
+ Environment variables:
21
+ DANKE_AGENT_NAME Agent display name
22
+ DANKE_KEYS_PATH Path to keys file
23
+ DANKE_API_URL Danke API URL
24
+
25
+ Example (Claude Desktop):
26
+ {
27
+ "mcpServers": {
28
+ "danke": {
29
+ "command": "npx",
30
+ "args": ["-y", "danke-mcp", "--name", "MyAgent"]
31
+ }
32
+ }
33
+ }
34
+ `);
35
+ process.exit(0);
36
+ }
37
+
38
+ const nameIdx = args.indexOf('--name');
39
+ const name = nameIdx !== -1 ? args[nameIdx + 1] : undefined;
40
+ const descIdx = args.indexOf('--description');
41
+ const description = descIdx !== -1 ? args[descIdx + 1] : undefined;
42
+ const keysIdx = args.indexOf('--keys');
43
+ const keysPath = keysIdx !== -1 ? args[keysIdx + 1] : undefined;
44
+ const apiIdx = args.indexOf('--api');
45
+ const apiUrl = apiIdx !== -1 ? args[apiIdx + 1] : undefined;
46
+
47
+ startServer({ name, description, keysPath, apiUrl });
@@ -0,0 +1,26 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+
3
+ interface DankeMcpConfig {
4
+ name: string;
5
+ description?: string;
6
+ keysPath: string;
7
+ apiUrl: string;
8
+ }
9
+ interface DankeMcpOptions {
10
+ name?: string;
11
+ description?: string;
12
+ keysPath?: string;
13
+ apiUrl?: string;
14
+ }
15
+ declare function resolveConfig(options?: DankeMcpOptions): DankeMcpConfig;
16
+
17
+ declare function createServer(config: DankeMcpConfig): Promise<McpServer>;
18
+ declare function runServer(config: DankeMcpConfig): Promise<void>;
19
+
20
+ /**
21
+ * Start the Danke MCP server with stdio transport.
22
+ * This is the main entry point used by the CLI.
23
+ */
24
+ declare function startServer(options?: DankeMcpOptions): Promise<void>;
25
+
26
+ export { type DankeMcpConfig, type DankeMcpOptions, createServer, resolveConfig, runServer, startServer };