@fundtracer/mcp 1.0.6 → 1.0.8
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 +4 -5
- 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");
|
|
@@ -261,11 +260,11 @@ function api() {
|
|
|
261
260
|
const key = _mcpCtx?.apiKey || process.env.FUNDTRACER_MCP_API_KEY || "";
|
|
262
261
|
const headers = {
|
|
263
262
|
Authorization: `Bearer ${key}`,
|
|
264
|
-
"x-auth-token": key,
|
|
265
263
|
"Content-Type": "application/json"
|
|
266
264
|
};
|
|
267
265
|
if (_mcpCtx?.userId) {
|
|
268
266
|
headers["X-MCP-UserId"] = _mcpCtx.userId;
|
|
267
|
+
headers["x-auth-token"] = `${key}:${_mcpCtx.userId}`;
|
|
269
268
|
}
|
|
270
269
|
return axios.create({
|
|
271
270
|
baseURL: API_BASE,
|
|
@@ -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) {
|
package/package.json
CHANGED