@haruspex-guru/mcp-server-gemini 1.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 ADDED
@@ -0,0 +1,44 @@
1
+ # @haruspex-guru/mcp-server-gemini
2
+
3
+ MCP server tuned for **Gemini CLI** that exposes the [Haruspex API](https://haruspex.guru) (live 0–100 multi-dimension stock scoring) as MCP tools. Spawned via `npx` by the [Haruspex Gemini CLI extension](https://github.com/Haruspex-guru/haruspex-gemini-extension).
4
+
5
+ > Sister package: [`@haruspex-guru/mcp-server`](https://www.npmjs.com/package/@haruspex-guru/mcp-server) — same Haruspex API, optimized for Claude Code / Claude Desktop / Base44 / Cursor / Windsurf.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description | Cost |
10
+ |------|-------------|------|
11
+ | `get_stock_score` | Latest Haruspex Score (0-100) with outlook, signal, topic breakdowns, and share URL | 1 credit |
12
+ | `get_stock_score_history` | Historical daily scores over a date range | 2 credits |
13
+ | `get_batch_scores` | Scores for multiple stocks at once (up to 50) | 1 credit/symbol |
14
+ | `search_stocks` | Search for stocks by symbol or company name | 1 credit |
15
+ | `get_stock_news` | Recent news articles for a stock | 1 credit |
16
+ | `record_skill_invocation` | Telemetry ping (no PII; tagged `client: "gemini-cli"`) | 0 credits |
17
+
18
+ ## Install via the Gemini extension (recommended)
19
+
20
+ ```bash
21
+ gemini extensions install https://github.com/Haruspex-guru/haruspex-gemini-extension
22
+ ```
23
+
24
+ Gemini will prompt for your `HARUSPEX_API_KEY`. Get one at <https://haruspex.guru/haruspex-api>.
25
+
26
+ ## Or wire MCP manually
27
+
28
+ For non-Gemini hosts that still want this distribution, paste into the host's MCP config:
29
+
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "haruspex": {
34
+ "command": "npx",
35
+ "args": ["-y", "@haruspex-guru/mcp-server-gemini@^1.0.0"],
36
+ "env": { "HARUSPEX_API_KEY": "hrspx_your_api_key" }
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ ## License
43
+
44
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,298 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ const API_BASE = "https://haruspex.guru/api/v1";
6
+ const API_KEY = process.env.HARUSPEX_API_KEY || "";
7
+ const TELEMETRY_DISABLED = process.env.HARUSPEX_TELEMETRY === "0";
8
+ if (!API_KEY) {
9
+ console.error("HARUSPEX_API_KEY environment variable is required. " +
10
+ "Get your API key from https://haruspex.guru/settings");
11
+ process.exit(1);
12
+ }
13
+ // ── Haruspex API client ──────────────────────────────────────────────
14
+ async function haruspexFetch(path, init) {
15
+ const res = await fetch(`${API_BASE}${path}`, {
16
+ ...init,
17
+ headers: {
18
+ Authorization: `Bearer ${API_KEY}`,
19
+ "Content-Type": "application/json",
20
+ ...init?.headers,
21
+ },
22
+ });
23
+ const body = (await res.json());
24
+ if (!res.ok || body.status === "error") {
25
+ const msg = body.error?.message || `HTTP ${res.status}`;
26
+ throw new Error(msg);
27
+ }
28
+ return body.data;
29
+ }
30
+ // ── Tool definitions ─────────────────────────────────────────────────
31
+ const TOOLS = [
32
+ {
33
+ name: "get_stock_score",
34
+ description: "Get the latest Haruspex Score (0-100) for a stock. " +
35
+ "Returns score, outlook, trading signal, topic breakdowns, and a shareable URL. " +
36
+ "Use this to inform stock commentary on social media.",
37
+ inputSchema: {
38
+ type: "object",
39
+ properties: {
40
+ symbol: {
41
+ type: "string",
42
+ description: "Stock ticker symbol (e.g. TSLA, AAPL, NVDA)",
43
+ },
44
+ },
45
+ required: ["symbol"],
46
+ },
47
+ },
48
+ {
49
+ name: "get_stock_score_history",
50
+ description: "Get historical daily Haruspex Scores for a stock over a date range. " +
51
+ "Useful for trend analysis and identifying momentum shifts.",
52
+ inputSchema: {
53
+ type: "object",
54
+ properties: {
55
+ symbol: {
56
+ type: "string",
57
+ description: "Stock ticker symbol",
58
+ },
59
+ from: {
60
+ type: "string",
61
+ description: "Start date (YYYY-MM-DD). Defaults to 30 days ago.",
62
+ },
63
+ to: {
64
+ type: "string",
65
+ description: "End date (YYYY-MM-DD). Defaults to today.",
66
+ },
67
+ limit: {
68
+ type: "number",
69
+ description: "Max scores to return (1-90). Default 30.",
70
+ },
71
+ },
72
+ required: ["symbol"],
73
+ },
74
+ },
75
+ {
76
+ name: "get_batch_scores",
77
+ description: "Get latest Haruspex Scores for multiple stocks at once (up to 50). " +
78
+ "Great for comparing several tickers or building a watchlist overview.",
79
+ inputSchema: {
80
+ type: "object",
81
+ properties: {
82
+ symbols: {
83
+ type: "array",
84
+ items: { type: "string" },
85
+ description: "Array of stock ticker symbols (max 50)",
86
+ },
87
+ },
88
+ required: ["symbols"],
89
+ },
90
+ },
91
+ {
92
+ name: "search_stocks",
93
+ description: "Search for stocks by symbol or company name. " +
94
+ "Use this to find the correct ticker symbol before fetching a score.",
95
+ inputSchema: {
96
+ type: "object",
97
+ properties: {
98
+ query: {
99
+ type: "string",
100
+ description: "Search query (symbol or company name)",
101
+ },
102
+ limit: {
103
+ type: "number",
104
+ description: "Max results (1-20). Default 10.",
105
+ },
106
+ },
107
+ required: ["query"],
108
+ },
109
+ },
110
+ {
111
+ name: "get_stock_news",
112
+ description: "Get recent news articles for a stock. " +
113
+ "Useful for understanding what's driving score changes.",
114
+ inputSchema: {
115
+ type: "object",
116
+ properties: {
117
+ symbol: {
118
+ type: "string",
119
+ description: "Stock ticker symbol",
120
+ },
121
+ limit: {
122
+ type: "number",
123
+ description: "Max articles (1-20). Default 10.",
124
+ },
125
+ },
126
+ required: ["symbol"],
127
+ },
128
+ },
129
+ {
130
+ name: "record_skill_invocation",
131
+ description: "Record that a Haruspex skill is starting a run. Called once at the very " +
132
+ "beginning of each skill workflow for aggregate usage telemetry. " +
133
+ "Sends only the skill name, version, and client tag — no conversation " +
134
+ "content, no tickers, no user identifiers. Fails silently if telemetry " +
135
+ "is unavailable; never blocks the skill.",
136
+ inputSchema: {
137
+ type: "object",
138
+ properties: {
139
+ skill: {
140
+ type: "string",
141
+ description: "Skill name as declared in SKILL.md (e.g. 'haruspex-stock-analyst')",
142
+ },
143
+ version: {
144
+ type: "string",
145
+ description: "Skill version from SKILL.md frontmatter (optional)",
146
+ },
147
+ client: {
148
+ type: "string",
149
+ enum: [
150
+ "claude-code",
151
+ "claude-ai",
152
+ "claude-api",
153
+ "claude-desktop",
154
+ "chatgpt-apps",
155
+ "base44",
156
+ "gemini-cli",
157
+ "unknown",
158
+ ],
159
+ description: "Best-guess client surface running the skill. Use 'gemini-cli' when invoked from the Haruspex Gemini CLI extension. Defaults to 'gemini-cli' on this distribution.",
160
+ },
161
+ notes: {
162
+ type: "string",
163
+ description: "Optional free-form note (max 500 chars)",
164
+ },
165
+ },
166
+ required: ["skill"],
167
+ },
168
+ },
169
+ ];
170
+ function formatScore(data) {
171
+ const lines = [
172
+ `**${data.symbol}** — Haruspex Score: **${data.score}/100** (${data.outlook})`,
173
+ `Signal: ${data.signal.replace(/_/g, " ")} | Change: ${data.change >= 0 ? "+" : ""}${data.change}`,
174
+ "",
175
+ ];
176
+ if (data.shareUrl) {
177
+ lines.push(`Share URL: ${data.shareUrl}`);
178
+ lines.push("");
179
+ }
180
+ const topics = Object.entries(data.topicScores || {});
181
+ if (topics.length > 0) {
182
+ lines.push("Topic Scores:");
183
+ for (const [, t] of topics) {
184
+ const arrow = t.change > 0 ? "+" : t.change < 0 ? "" : "=";
185
+ lines.push(` ${t.name}: ${t.score}/100 (${arrow}${t.change})`);
186
+ }
187
+ }
188
+ return lines.join("\n");
189
+ }
190
+ async function handleTool(name, args) {
191
+ switch (name) {
192
+ case "get_stock_score": {
193
+ const data = await haruspexFetch(`/scores/${encodeURIComponent(args.symbol)}`);
194
+ return formatScore(data);
195
+ }
196
+ case "get_stock_score_history": {
197
+ const params = new URLSearchParams();
198
+ if (args.from)
199
+ params.set("from", args.from);
200
+ if (args.to)
201
+ params.set("to", args.to);
202
+ if (args.limit)
203
+ params.set("limit", String(args.limit));
204
+ const qs = params.toString() ? `?${params}` : "";
205
+ const data = await haruspexFetch(`/scores/${encodeURIComponent(args.symbol)}/history${qs}`);
206
+ const lines = [`**${data.symbol}** — ${data.count} scores from ${data.from} to ${data.to}\n`];
207
+ for (const s of data.scores) {
208
+ lines.push(`${s.date}: ${s.score}/100 (${s.outlook}, ${s.change >= 0 ? "+" : ""}${s.change})`);
209
+ }
210
+ return lines.join("\n");
211
+ }
212
+ case "get_batch_scores": {
213
+ const data = await haruspexFetch("/scores/batch", {
214
+ method: "POST",
215
+ body: JSON.stringify({ symbols: args.symbols }),
216
+ });
217
+ const lines = [];
218
+ for (const entry of data.scores) {
219
+ if ("error" in entry) {
220
+ lines.push(`**${entry.symbol}**: ${entry.error}`);
221
+ }
222
+ else {
223
+ lines.push(formatScore(entry));
224
+ lines.push("");
225
+ }
226
+ }
227
+ return lines.join("\n");
228
+ }
229
+ case "search_stocks": {
230
+ const params = new URLSearchParams({ q: args.query });
231
+ if (args.limit)
232
+ params.set("limit", String(args.limit));
233
+ const data = await haruspexFetch(`/search?${params}`);
234
+ if (data.results.length === 0)
235
+ return "No stocks found.";
236
+ return data.results
237
+ .map((r) => `${r.symbol} — ${r.name} (${r.exchange || "N/A"}, ${r.type})`)
238
+ .join("\n");
239
+ }
240
+ case "get_stock_news": {
241
+ const params = new URLSearchParams();
242
+ if (args.limit)
243
+ params.set("limit", String(args.limit));
244
+ const qs = params.toString() ? `?${params}` : "";
245
+ const data = await haruspexFetch(`/stocks/${encodeURIComponent(args.symbol)}/news${qs}`);
246
+ if (data.articles.length === 0)
247
+ return `No recent news for ${data.symbol}.`;
248
+ return data.articles
249
+ .map((a) => `[${a.source}] ${a.title}\n ${a.url} (${a.publishedAt})`)
250
+ .join("\n\n");
251
+ }
252
+ case "record_skill_invocation": {
253
+ if (TELEMETRY_DISABLED) {
254
+ return "Telemetry disabled (HARUSPEX_TELEMETRY=0). Skipped.";
255
+ }
256
+ try {
257
+ const data = await haruspexFetch("/skills/invocation", {
258
+ method: "POST",
259
+ body: JSON.stringify({
260
+ skill: args.skill,
261
+ version: args.version,
262
+ client: args.client,
263
+ notes: args.notes,
264
+ }),
265
+ });
266
+ return `Recorded skill invocation ${data.id}.`;
267
+ }
268
+ catch (err) {
269
+ const msg = err instanceof Error ? err.message : String(err);
270
+ return `Telemetry ping failed (non-fatal): ${msg}`;
271
+ }
272
+ }
273
+ default:
274
+ throw new Error(`Unknown tool: ${name}`);
275
+ }
276
+ }
277
+ // ── MCP server setup ─────────────────────────────────────────────────
278
+ const server = new Server({ name: "haruspex-gemini", version: "1.0.0" }, { capabilities: { tools: {} } });
279
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
280
+ tools: TOOLS,
281
+ }));
282
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
283
+ const { name, arguments: args } = request.params;
284
+ try {
285
+ const result = await handleTool(name, (args || {}));
286
+ return { content: [{ type: "text", text: result }] };
287
+ }
288
+ catch (error) {
289
+ const message = error instanceof Error ? error.message : String(error);
290
+ return {
291
+ content: [{ type: "text", text: `Error: ${message}` }],
292
+ isError: true,
293
+ };
294
+ }
295
+ });
296
+ const transport = new StdioServerTransport();
297
+ await server.connect(transport);
298
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAChD,MAA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AAK,CAAC,CAAC;QACvE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;YACtD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@haruspex-guru/mcp-server-gemini",
3
+ "version": "1.0.0",
4
+ "description": "Haruspex MCP server tuned for Gemini CLI. Exposes the Haruspex public API (live multi-dimension stock scoring) as MCP tools — get_stock_score, get_batch_scores, get_stock_score_history, search_stocks, get_stock_news. Spawned by the Haruspex Gemini CLI extension.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "haruspex-mcp-gemini": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "dev": "tsx src/index.ts",
17
+ "start": "node dist/index.js",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "keywords": [
21
+ "mcp",
22
+ "model-context-protocol",
23
+ "haruspex",
24
+ "stocks",
25
+ "finance",
26
+ "gemini",
27
+ "gemini-cli",
28
+ "google-gemini"
29
+ ],
30
+ "homepage": "https://haruspex.guru/integrations/gemini",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/Haruspex-guru/haruspex-gemini-extension.git"
34
+ },
35
+ "license": "MIT",
36
+ "dependencies": {
37
+ "@modelcontextprotocol/sdk": "^0.5.0"
38
+ },
39
+ "devDependencies": {
40
+ "tsx": "^4.7.0",
41
+ "typescript": "^5.3.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }