@jarib/pxweb-mcp 1.0.3 → 2.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 CHANGED
@@ -6,7 +6,7 @@ MCP server for accessing statistical data via the PxWeb API v2.
6
6
 
7
7
  ```bash
8
8
  npx -y @jarib/pxweb-mcp
9
- npx -y @jarib/pxweb-mcp --transport http --port 3000
9
+ npx -y @jarib/pxweb-mcp --transport streamable-http --port 3000
10
10
  ```
11
11
 
12
12
 
package/build/index.js CHANGED
@@ -24,8 +24,8 @@ const argv = yargs(hideBin(process.argv))
24
24
  })
25
25
  .option("transport", {
26
26
  type: "string",
27
- description: "Transport method (http or stdio)",
28
- choices: ["http", "stdio"],
27
+ description: "Transport method (streamable-http or stdio)",
28
+ choices: ["streamable-http", "stdio"],
29
29
  default: "stdio",
30
30
  })
31
31
  .help()
@@ -317,13 +317,7 @@ Use this to find newly published statistics.`,
317
317
  async function main() {
318
318
  const { url, port, transport: transportType } = argv;
319
319
  const mcpServer = createMcpServer(url);
320
- if (transportType === "stdio") {
321
- const transport = new StdioServerTransport();
322
- await mcpServer.connect(transport);
323
- console.error(`PxWeb MCP Server running on stdio`);
324
- console.error(`Using API: ${url}`);
325
- }
326
- else {
320
+ if (transportType === "streamable-http") {
327
321
  const transport = new StreamableHTTPServerTransport({
328
322
  sessionIdGenerator: () => crypto.randomUUID(),
329
323
  });
@@ -359,6 +353,12 @@ async function main() {
359
353
  console.error(`Using API: ${url}`);
360
354
  });
361
355
  }
356
+ else {
357
+ const transport = new StdioServerTransport();
358
+ await mcpServer.connect(transport);
359
+ console.error(`PxWeb MCP Server running on stdio`);
360
+ console.error(`Using API: ${url}`);
361
+ }
362
362
  }
363
363
  main().catch((error) => {
364
364
  console.error("Fatal error:", error);
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@jarib/pxweb-mcp",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "description": "MCP server for accessing statistical data via the PxWeb API v2",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "bin": {
8
- "@jarib/pxweb-mcp": "build/index.js",
9
8
  "pxweb-mcp": "build/index.js"
10
9
  },
11
10
  "scripts": {