bsv-mcp 0.0.22 → 0.0.23
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 +2 -0
- package/index.ts +28 -28
- package/package.json +1 -1
- package/tools/bsv/explore.ts +331 -261
- package/tools/bsv/getPrice.ts +19 -10
- package/tools/bsv/index.ts +1 -1
- package/tools/index.ts +10 -10
- package/tools/mnee/getBalance.ts +53 -43
- package/tools/mnee/index.ts +7 -7
- package/tools/mnee/parseTx.ts +31 -27
- package/tools/mnee/sendMnee.ts +70 -66
- package/tools/ordinals/getTokenByIdOrTicker.ts +14 -7
- package/tools/ordinals/marketListings.ts +26 -13
- package/tools/ordinals/marketSales.ts +11 -17
- package/tools/utils/index.ts +19 -15
- package/tools/wallet/createOrdinals.ts +27 -13
- package/tools/wallet/getAddress.ts +6 -1
- package/tools/wallet/purchaseListing.ts +18 -16
- package/tools/wallet/schemas.ts +55 -32
- package/tools/wallet/sendOrdinals.ts +106 -92
- package/tools/wallet/sendToAddress.ts +1 -1
- package/tools/wallet/tools.test.ts +3 -3
- package/tools/wallet/tools.ts +51 -38
- package/tools/wallet/transferOrdToken.ts +119 -84
- package/tools/wallet/wallet.ts +3 -9
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ A collection of Bitcoin SV (BSV) tools for the Model Context Protocol (MCP) fram
|
|
|
12
12
|
|
|
13
13
|
This server implements the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP), allowing AI assistants to utilize Bitcoin SV functionalities. You can connect this server to various MCP-compatible clients.
|
|
14
14
|
|
|
15
|
+

|
|
16
|
+
|
|
15
17
|
### Cursor
|
|
16
18
|
|
|
17
19
|
To use the BSV MCP server with [Cursor](https://cursor.sh/):
|
package/index.ts
CHANGED
|
@@ -11,33 +11,33 @@ import { Wallet } from "./tools/wallet/wallet";
|
|
|
11
11
|
* Exits the process with an error message if validation fails
|
|
12
12
|
*/
|
|
13
13
|
function validatePrivateKey(): PrivateKey {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
const privateKeyWif = process.env.PRIVATE_KEY_WIF;
|
|
15
|
+
|
|
16
|
+
// Check if private key is set
|
|
17
|
+
if (!privateKeyWif) {
|
|
18
|
+
console.error(
|
|
19
|
+
"\x1b[31mError: PRIVATE_KEY_WIF environment variable is not set\x1b[0m",
|
|
20
|
+
);
|
|
21
|
+
console.error(
|
|
22
|
+
"Please set this variable with a valid Bitcoin SV private key in WIF format",
|
|
23
|
+
);
|
|
24
|
+
console.error(
|
|
25
|
+
"Example: PRIVATE_KEY_WIF=your_private_key_wif bun run index.ts",
|
|
26
|
+
);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Validate the private key format
|
|
31
|
+
try {
|
|
32
|
+
return PrivateKey.fromWif(privateKeyWif);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("\x1b[31mError: Invalid private key format\x1b[0m");
|
|
35
|
+
console.error(
|
|
36
|
+
"The PRIVATE_KEY_WIF provided is not a valid Bitcoin SV private key in WIF format",
|
|
37
|
+
);
|
|
38
|
+
console.error("Please check your key and try again");
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Validate private key early before starting the server
|
|
@@ -45,7 +45,7 @@ const privKey = validatePrivateKey();
|
|
|
45
45
|
|
|
46
46
|
const server = new McpServer({
|
|
47
47
|
name: "Bitcoin SV MCP Server",
|
|
48
|
-
version: "0.0.
|
|
48
|
+
version: "0.0.23",
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
// Initialize wallet with the validated private key
|
package/package.json
CHANGED