stock-scanner-mcp 1.16.1 → 1.16.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 CHANGED
@@ -393,11 +393,17 @@ Any MCP client that supports stdio servers can run this package. Use the same JS
393
393
 
394
394
  ## HTTP Sidecar
395
395
 
396
- An optional HTTP server exposing all tools as REST endpoints for non-MCP integrations (trading bots, chat UIs, LLM pipelines).
396
+ An optional HTTP server exposing all tools as REST endpoints for non-MCP integrations (GPT Actions, chat UIs, LLM pipelines). It includes an **OpenAPI 3.1** specification for automated tool discovery.
397
397
 
398
398
  ```bash
399
399
  npx stock-scanner-sidecar # Start on port 3200
400
400
  npx stock-scanner-sidecar --port 8080 # Custom port
401
+
402
+ # Access the OpenAPI spec
403
+ curl http://localhost:3200/openapi.json
404
+ ```
405
+
406
+ See [Sidecar HTTP API](wiki-repo/Sidecar-HTTP-API.md) for endpoint details.
401
407
  ```
402
408
 
403
409
  55 endpoints including `/tradingview/quote`, `/options/chain`, `/frankfurter/convert`, and more. See [wiki](https://github.com/yyordanov-tradu/stock-scanner-mcp/wiki/Sidecar-HTTP-API) for the full route table.
@@ -43,6 +43,11 @@ import {
43
43
 
44
44
  // src/sidecar/server.ts
45
45
  import * as http from "http";
46
+ import { readFileSync } from "fs";
47
+ import { join, dirname } from "path";
48
+ import { fileURLToPath } from "url";
49
+ var __filename = fileURLToPath(import.meta.url);
50
+ var __dirname = dirname(__filename);
46
51
  var SYMBOL_RE = /^[A-Z][A-Z0-9._-]{0,19}$/i;
47
52
  var MAX_BODY_BYTES = 1024 * 1024;
48
53
  var LOCALHOST_ORIGINS = /* @__PURE__ */ new Set(["http://localhost", "http://127.0.0.1"]);
@@ -128,6 +133,16 @@ function createServer2(config) {
128
133
  json(res, req, 200, { status: "ok" });
129
134
  return;
130
135
  }
136
+ if (path === "/openapi.json" && req.method === "GET") {
137
+ try {
138
+ const specPath = join(__dirname, "../../docs/sidecar-openapi.json");
139
+ const spec = JSON.parse(readFileSync(specPath, "utf-8"));
140
+ json(res, req, 200, spec);
141
+ } catch (e) {
142
+ json(res, req, 404, { error: "OpenAPI specification not found" });
143
+ }
144
+ return;
145
+ }
131
146
  if (path === "/tradingview/scan" && req.method === "POST") {
132
147
  const body = await parseBody(req);
133
148
  if (typeof body !== "object" || body === null || Array.isArray(body)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stock-scanner-mcp",
3
3
  "mcpName": "io.github.yyordanov-tradu/stock-scanner-mcp",
4
- "version": "1.16.1",
4
+ "version": "1.16.2",
5
5
  "description": "MCP server providing Claude Code with real-time stock and crypto market data, SEC filings, insider trades, and technical analysis",
6
6
  "type": "module",
7
7
  "bin": {
@@ -10,11 +10,12 @@
10
10
  "stock-scanner-sidecar": "./dist/sidecar/index.js"
11
11
  },
12
12
  "scripts": {
13
- "build": "tsup src/index.ts src/install-skills.ts src/sidecar/index.ts --format esm --dts --clean",
13
+ "build": "npm run generate-openapi && tsup src/index.ts src/install-skills.ts src/sidecar/index.ts --format esm --dts --clean",
14
14
  "dev": "tsup src/index.ts --format esm --watch",
15
15
  "test": "vitest run",
16
16
  "test:watch": "vitest",
17
17
  "lint": "tsc --noEmit",
18
+ "generate-openapi": "tsx src/scripts/generate-sidecar-openapi.ts",
18
19
  "validate-tools": "tsx src/scripts/validate-tools.ts",
19
20
  "validate-structure": "tsx src/scripts/validate-structure.ts",
20
21
  "prepublishOnly": "npm run build && npm test"