neutron-mcp 1.0.0 → 1.0.2
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 +10 -1
- package/dist/index.js +5 -4
- package/dist/neutron-client.js +9 -9
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Neutron MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/neutron-mcp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
3
6
|
Add Lightning payments, Bitcoin, USDT, and fiat transactions to your applications using AI. This MCP (Model Context Protocol) server connects Neutron's payment infrastructure to AI coding assistants like Claude, Cursor, Windsurf, and Cline.
|
|
4
7
|
|
|
5
8
|
## What is this?
|
|
@@ -39,6 +42,7 @@ Add to your config file:
|
|
|
39
42
|
"command": "npx",
|
|
40
43
|
"args": ["-y", "neutron-mcp"],
|
|
41
44
|
"env": {
|
|
45
|
+
"NEUTRON_ACCOUNT_ID": "your_account_id",
|
|
42
46
|
"NEUTRON_ACCESS_KEY": "your_access_key",
|
|
43
47
|
"NEUTRON_SECRET_KEY": "your_secret_key"
|
|
44
48
|
}
|
|
@@ -60,6 +64,7 @@ Add to `~/.claude.json` or your project's `.mcp.json`:
|
|
|
60
64
|
"command": "npx",
|
|
61
65
|
"args": ["-y", "neutron-mcp"],
|
|
62
66
|
"env": {
|
|
67
|
+
"NEUTRON_ACCOUNT_ID": "your_account_id",
|
|
63
68
|
"NEUTRON_ACCESS_KEY": "your_access_key",
|
|
64
69
|
"NEUTRON_SECRET_KEY": "your_secret_key"
|
|
65
70
|
}
|
|
@@ -81,6 +86,7 @@ Add to `.cursor/mcp.json` in your project or global config:
|
|
|
81
86
|
"command": "npx",
|
|
82
87
|
"args": ["-y", "neutron-mcp"],
|
|
83
88
|
"env": {
|
|
89
|
+
"NEUTRON_ACCOUNT_ID": "your_account_id",
|
|
84
90
|
"NEUTRON_ACCESS_KEY": "your_access_key",
|
|
85
91
|
"NEUTRON_SECRET_KEY": "your_secret_key"
|
|
86
92
|
}
|
|
@@ -102,6 +108,7 @@ Add to your Windsurf MCP configuration:
|
|
|
102
108
|
"command": "npx",
|
|
103
109
|
"args": ["-y", "neutron-mcp"],
|
|
104
110
|
"env": {
|
|
111
|
+
"NEUTRON_ACCOUNT_ID": "your_account_id",
|
|
105
112
|
"NEUTRON_ACCESS_KEY": "your_access_key",
|
|
106
113
|
"NEUTRON_SECRET_KEY": "your_secret_key"
|
|
107
114
|
}
|
|
@@ -123,6 +130,7 @@ Add to your Cline MCP settings:
|
|
|
123
130
|
"command": "npx",
|
|
124
131
|
"args": ["-y", "neutron-mcp"],
|
|
125
132
|
"env": {
|
|
133
|
+
"NEUTRON_ACCOUNT_ID": "your_account_id",
|
|
126
134
|
"NEUTRON_ACCESS_KEY": "your_access_key",
|
|
127
135
|
"NEUTRON_SECRET_KEY": "your_secret_key"
|
|
128
136
|
}
|
|
@@ -235,9 +243,10 @@ Once configured, just ask your AI assistant naturally:
|
|
|
235
243
|
|
|
236
244
|
| Variable | Required | Description |
|
|
237
245
|
|----------|----------|-------------|
|
|
246
|
+
| `NEUTRON_ACCOUNT_ID` | Yes | Your Neutron account ID |
|
|
238
247
|
| `NEUTRON_ACCESS_KEY` | Yes | Your Neutron API access key |
|
|
239
248
|
| `NEUTRON_SECRET_KEY` | Yes | Your Neutron API secret key |
|
|
240
|
-
| `NEUTRON_API_URL` | No | API URL (defaults to `https://
|
|
249
|
+
| `NEUTRON_API_URL` | No | API URL (defaults to `https://enapi.npay.live`) |
|
|
241
250
|
|
|
242
251
|
---
|
|
243
252
|
|
package/dist/index.js
CHANGED
|
@@ -97,13 +97,14 @@ const UpdateWebhookSchema = z.object({
|
|
|
97
97
|
});
|
|
98
98
|
// Initialize Neutron client
|
|
99
99
|
function createClient() {
|
|
100
|
-
const apiUrl = process.env.NEUTRON_API_URL || "https://
|
|
100
|
+
const apiUrl = process.env.NEUTRON_API_URL || "https://enapi.npay.live";
|
|
101
|
+
const accountId = process.env.NEUTRON_ACCOUNT_ID;
|
|
101
102
|
const accessKey = process.env.NEUTRON_ACCESS_KEY;
|
|
102
103
|
const secretKey = process.env.NEUTRON_SECRET_KEY;
|
|
103
|
-
if (!accessKey || !secretKey) {
|
|
104
|
-
throw new Error("NEUTRON_ACCESS_KEY and NEUTRON_SECRET_KEY environment variables are required");
|
|
104
|
+
if (!accountId || !accessKey || !secretKey) {
|
|
105
|
+
throw new Error("NEUTRON_ACCOUNT_ID, NEUTRON_ACCESS_KEY, and NEUTRON_SECRET_KEY environment variables are required");
|
|
105
106
|
}
|
|
106
|
-
return new NeutronClient({ apiUrl, accessKey, secretKey });
|
|
107
|
+
return new NeutronClient({ apiUrl, accountId, accessKey, secretKey });
|
|
107
108
|
}
|
|
108
109
|
// Create MCP server
|
|
109
110
|
const server = new Server({
|
package/dist/neutron-client.js
CHANGED
|
@@ -6,22 +6,22 @@ export class NeutronClient {
|
|
|
6
6
|
constructor(config) {
|
|
7
7
|
this.config = config;
|
|
8
8
|
}
|
|
9
|
-
generateSignature(
|
|
10
|
-
|
|
9
|
+
generateSignature(payload) {
|
|
10
|
+
// HMAC-SHA256 signature: {apiKey}&payload={payload}
|
|
11
|
+
const stringToSign = `${this.config.accessKey}&payload=${payload}`;
|
|
11
12
|
return crypto
|
|
12
13
|
.createHmac("sha256", this.config.secretKey)
|
|
13
|
-
.update(
|
|
14
|
+
.update(stringToSign)
|
|
14
15
|
.digest("hex");
|
|
15
16
|
}
|
|
16
17
|
async request(method, path, body) {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const signature = this.generateSignature(method, path, timestamp, bodyString);
|
|
18
|
+
const bodyString = body ? JSON.stringify(body) : "";
|
|
19
|
+
const signature = this.generateSignature(bodyString);
|
|
20
20
|
const headers = {
|
|
21
21
|
"Content-Type": "application/json",
|
|
22
|
-
"X-
|
|
23
|
-
"X-
|
|
24
|
-
"
|
|
22
|
+
"X-Api-Key": this.config.accessKey,
|
|
23
|
+
"X-Api-Signature": signature,
|
|
24
|
+
"account_id": this.config.accountId,
|
|
25
25
|
};
|
|
26
26
|
// Add bearer token if authenticated
|
|
27
27
|
if (this.token && Date.now() < this.tokenExpiry) {
|
package/dist/types.d.ts
CHANGED