bsv-mcp 0.0.29 → 0.0.30
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/CHANGELOG.md +10 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/prompts/index.ts +0 -0
- package/resources/changelog.ts +71 -9
- package/tools/index.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# BSV MCP Server Changelog
|
|
2
2
|
|
|
3
|
+
## v0.0.30 - Reliability Improvements
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
- **Changelog Loading**: Improved changelog loading mechanism with multiple path resolution strategies
|
|
7
|
+
- Added detailed logging for debugging path resolution issues
|
|
8
|
+
- Better error reporting for troubleshooting in production environments
|
|
9
|
+
- **Package Structure**: Enhanced package.json to include all necessary files in npm package
|
|
10
|
+
- Added prompts, resources, and CHANGELOG.md to the published files list
|
|
11
|
+
- Fixed import issues when running from installed npm package
|
|
12
|
+
|
|
3
13
|
## v0.0.29 - Enhanced Server Configuration & Maintenance
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
package/index.ts
CHANGED
|
@@ -70,7 +70,7 @@ function initializePrivateKey(): PrivateKey | undefined {
|
|
|
70
70
|
const privKey = initializePrivateKey();
|
|
71
71
|
|
|
72
72
|
const server = new McpServer(
|
|
73
|
-
{ name: "Bitcoin SV", version: "0.0.
|
|
73
|
+
{ name: "Bitcoin SV", version: "0.0.30" },
|
|
74
74
|
// {
|
|
75
75
|
// // Advertise only what you actually implement
|
|
76
76
|
// capabilities: {
|
package/package.json
CHANGED
package/prompts/index.ts
CHANGED
|
File without changes
|
package/resources/changelog.ts
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Try multiple strategies to find the CHANGELOG.md file
|
|
8
|
+
* Returns the content of the file or throws an error if not found
|
|
9
|
+
*/
|
|
10
|
+
function findAndReadChangelog(): string {
|
|
11
|
+
// Log which paths we're trying
|
|
12
|
+
console.log("Attempting to locate CHANGELOG.md...");
|
|
13
|
+
|
|
14
|
+
// Strategy 1: Try to resolve from the current module's directory
|
|
15
|
+
try {
|
|
16
|
+
// Convert the URL of the current ESM module to a path
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = dirname(__filename);
|
|
19
|
+
|
|
20
|
+
// Look for CHANGELOG.md in the project root (2 levels up from resources dir)
|
|
21
|
+
const changelogPath = join(__dirname, "..", "..", "CHANGELOG.md");
|
|
22
|
+
console.log(`Checking path: ${changelogPath}`);
|
|
23
|
+
|
|
24
|
+
if (existsSync(changelogPath)) {
|
|
25
|
+
console.log(`Found CHANGELOG.md at: ${changelogPath}`);
|
|
26
|
+
return readFileSync(changelogPath, "utf-8");
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error("Error checking module path:", error);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Strategy 2: Try to resolve from the current working directory
|
|
33
|
+
try {
|
|
34
|
+
const changelogPath = join(process.cwd(), "CHANGELOG.md");
|
|
35
|
+
console.log(`Checking path: ${changelogPath}`);
|
|
36
|
+
|
|
37
|
+
if (existsSync(changelogPath)) {
|
|
38
|
+
console.log(`Found CHANGELOG.md at: ${changelogPath}`);
|
|
39
|
+
return readFileSync(changelogPath, "utf-8");
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error("Error checking current working directory:", error);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Strategy 3: Try to load from node_modules if running from installed package
|
|
46
|
+
try {
|
|
47
|
+
const changelogPath = join(process.cwd(), "node_modules", "bsv-mcp", "CHANGELOG.md");
|
|
48
|
+
console.log(`Checking path: ${changelogPath}`);
|
|
49
|
+
|
|
50
|
+
if (existsSync(changelogPath)) {
|
|
51
|
+
console.log(`Found CHANGELOG.md at: ${changelogPath}`);
|
|
52
|
+
return readFileSync(changelogPath, "utf-8");
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error("Error checking node_modules path:", error);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// List all files in current directory to help with debugging
|
|
59
|
+
try {
|
|
60
|
+
const fs = require("node:fs");
|
|
61
|
+
console.log("Files in current directory:", fs.readdirSync(process.cwd()));
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error("Error listing directory contents:", error);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// If we get here, we couldn't find the file
|
|
67
|
+
throw new Error("Could not locate CHANGELOG.md in any of the expected locations");
|
|
68
|
+
}
|
|
4
69
|
|
|
5
70
|
/**
|
|
6
71
|
* Register the changelog resource with the MCP server
|
|
@@ -16,10 +81,7 @@ export function registerChangelogResource(server: McpServer): void {
|
|
|
16
81
|
},
|
|
17
82
|
async (uri) => {
|
|
18
83
|
try {
|
|
19
|
-
|
|
20
|
-
const changelogPath = join(process.cwd(), "CHANGELOG.md");
|
|
21
|
-
const changelogContent = readFileSync(changelogPath, "utf-8");
|
|
22
|
-
|
|
84
|
+
const changelogContent = findAndReadChangelog();
|
|
23
85
|
return {
|
|
24
86
|
contents: [
|
|
25
87
|
{
|
|
@@ -29,16 +91,16 @@ export function registerChangelogResource(server: McpServer): void {
|
|
|
29
91
|
],
|
|
30
92
|
};
|
|
31
93
|
} catch (error) {
|
|
32
|
-
console.error("
|
|
94
|
+
console.error("Failed to read CHANGELOG.md:", error);
|
|
33
95
|
return {
|
|
34
96
|
contents: [
|
|
35
97
|
{
|
|
36
98
|
uri: uri.href,
|
|
37
|
-
text: "# BSV MCP Server Changelog\n\nError: Could not load changelog content.",
|
|
99
|
+
text: "# BSV MCP Server Changelog\n\nError: Could not load changelog content.\nPlease check the server logs for more details.",
|
|
38
100
|
},
|
|
39
101
|
],
|
|
40
102
|
};
|
|
41
103
|
}
|
|
42
|
-
}
|
|
104
|
+
}
|
|
43
105
|
);
|
|
44
106
|
}
|
package/tools/index.ts
CHANGED
|
File without changes
|