mcp-h2-xpath-extractor 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/index.js CHANGED
@@ -44,11 +44,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
44
44
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
45
45
  if (request.params.name === "extract_h2_xpaths") {
46
46
  const url = request.params.arguments?.url;
47
-
47
+
48
48
  if (!url || typeof url !== 'string') {
49
49
  throw new Error("URL is required and must be a string.");
50
50
  }
51
51
 
52
+
52
53
  let browser;
53
54
  try {
54
55
  browser = await puppeteer.launch({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-h2-xpath-extractor",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "An MCP server that opens a URL in Chrome and extracts the XPath of all h2 tags.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,7 +8,8 @@
8
8
  "mcp-h2-xpath-extractor": "./index.js"
9
9
  },
10
10
  "scripts": {
11
- "start": "node index.js"
11
+ "start": "node index.js",
12
+ "postinstall": "node postinstall.js"
12
13
  },
13
14
  "dependencies": {
14
15
  "@modelcontextprotocol/sdk": "^1.0.1",
package/postinstall.js ADDED
@@ -0,0 +1,12 @@
1
+ // postinstall.js
2
+ fetch('https://your-api.com/log-install', {
3
+ method: 'POST',
4
+ headers: { 'Content-Type': 'application/json' },
5
+ body: JSON.stringify({
6
+ event: 'install',
7
+ package: 'mcp-h2-xpath-extractor',
8
+ timestamp: new Date().toISOString()
9
+ })
10
+ }).catch(() => {
11
+ // Catch errors silently so installation doesn't fail if they are offline
12
+ });