@fundtracer/mcp 1.0.5 → 1.0.7
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/fundtracer-mcp.js +10 -8
- package/package.json +1 -1
package/fundtracer-mcp.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __esm = (fn, res) => function __init() {
|
|
@@ -221,9 +220,9 @@ var init_tools = __esm({
|
|
|
221
220
|
});
|
|
222
221
|
|
|
223
222
|
// src/mcp/mcpLogger.ts
|
|
224
|
-
import { getFirestore } from "../firebase.js";
|
|
225
223
|
async function logMcpRequest(entry) {
|
|
226
224
|
try {
|
|
225
|
+
const { getFirestore } = await import("../firebase.js");
|
|
227
226
|
const db = getFirestore();
|
|
228
227
|
if (!db) {
|
|
229
228
|
console.warn("[MCP-LOGGER] getFirestore() returned null");
|
|
@@ -258,7 +257,7 @@ function err(message) {
|
|
|
258
257
|
return { content: [{ type: "text", text: message }], isError: true };
|
|
259
258
|
}
|
|
260
259
|
function api() {
|
|
261
|
-
const key = process.env.FUNDTRACER_MCP_API_KEY || "";
|
|
260
|
+
const key = _mcpCtx?.apiKey || process.env.FUNDTRACER_MCP_API_KEY || "";
|
|
262
261
|
const headers = {
|
|
263
262
|
Authorization: `Bearer ${key}`,
|
|
264
263
|
"x-auth-token": key,
|
|
@@ -497,8 +496,8 @@ async function validateMcpApiKey(rawKey) {
|
|
|
497
496
|
return validateViaHttp(rawKey);
|
|
498
497
|
}
|
|
499
498
|
async function validateWithFirestore(rawKey) {
|
|
500
|
-
const { getFirestore
|
|
501
|
-
const db =
|
|
499
|
+
const { getFirestore } = await import("../firebase.js");
|
|
500
|
+
const db = getFirestore();
|
|
502
501
|
if (!db) return null;
|
|
503
502
|
const keyDoc = await db.collection("apiKeys").doc(rawKey).get();
|
|
504
503
|
if (keyDoc.exists) {
|
|
@@ -514,7 +513,8 @@ async function validateWithFirestore(rawKey) {
|
|
|
514
513
|
return {
|
|
515
514
|
userId: data.userId,
|
|
516
515
|
tier: data.tier || "free",
|
|
517
|
-
apiKeyPrefix: rawKey.substring(0, 15)
|
|
516
|
+
apiKeyPrefix: rawKey.substring(0, 15),
|
|
517
|
+
apiKey: rawKey
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
520
|
const { hashAPIKey } = await import("../models/apiKey.js");
|
|
@@ -533,7 +533,8 @@ async function validateWithFirestore(rawKey) {
|
|
|
533
533
|
return {
|
|
534
534
|
userId: data.userId,
|
|
535
535
|
tier: data.tier || "free",
|
|
536
|
-
apiKeyPrefix: rawKey.substring(0, 15)
|
|
536
|
+
apiKeyPrefix: rawKey.substring(0, 15),
|
|
537
|
+
apiKey: rawKey
|
|
537
538
|
};
|
|
538
539
|
}
|
|
539
540
|
}
|
|
@@ -558,7 +559,8 @@ async function validateViaHttp(rawKey) {
|
|
|
558
559
|
return {
|
|
559
560
|
userId: data.userId,
|
|
560
561
|
tier: data.tier || "free",
|
|
561
|
-
apiKeyPrefix: rawKey.substring(0, 15)
|
|
562
|
+
apiKeyPrefix: rawKey.substring(0, 15),
|
|
563
|
+
apiKey: rawKey
|
|
562
564
|
};
|
|
563
565
|
}
|
|
564
566
|
async function trackUsage(userId, rawKey) {
|
package/package.json
CHANGED