@insightsentry/mcp 1.0.4 → 1.0.6
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/dist/index.js +2 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78,33 +78,11 @@ if (!apiKey) {
|
|
|
78
78
|
"Get your API key from https://insightsentry.com/dashboard");
|
|
79
79
|
process.exit(1);
|
|
80
80
|
}
|
|
81
|
-
// Validate the API key before proceeding.
|
|
82
|
-
// InsightSentry API keys are JWTs (three base64url segments separated by dots).
|
|
83
|
-
// Base64url may include trailing '=' padding.
|
|
84
|
-
const isJwt = /^[A-Za-z0-9_\-=]+\.[A-Za-z0-9_\-=]+\.[A-Za-z0-9_\-=]+$/.test(apiKey);
|
|
85
|
-
if (!isJwt) {
|
|
86
|
-
// Only check for placeholders/length on non-JWT values to avoid false positives.
|
|
87
|
-
const isPlaceholder = /^(<.*>|your[_\s-]*(api[_\s-]*)?key.*|test|example|xxx|api[_\s-]*key|insert[_\s-]*.*)$/i.test(apiKey);
|
|
88
|
-
if (apiKey.length < 5) {
|
|
89
|
-
console.error("Error: INSIGHTSENTRY_API_KEY is too short to be a valid API key.\n" +
|
|
90
|
-
"Get your API key from https://insightsentry.com/dashboard");
|
|
91
|
-
}
|
|
92
|
-
else if (isPlaceholder) {
|
|
93
|
-
console.error("Error: INSIGHTSENTRY_API_KEY contains a placeholder value.\n" +
|
|
94
|
-
"Replace it with your actual API key from https://insightsentry.com/dashboard");
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
console.error("Error: INSIGHTSENTRY_API_KEY is not a valid InsightSentry API key.\n" +
|
|
98
|
-
"InsightSentry API keys are JWT tokens (header.payload.signature format).\n" +
|
|
99
|
-
"Get your API key from https://insightsentry.com/dashboard");
|
|
100
|
-
}
|
|
101
|
-
process.exit(1);
|
|
102
|
-
}
|
|
103
81
|
const client = new ApiClient(apiKey);
|
|
104
82
|
const server = new McpServer({ name: "insightsentry", version: "1.0.0" }, { instructions: INSTRUCTIONS });
|
|
105
83
|
// Register all API tools with Zod schemas for type-safe parameter validation
|
|
106
84
|
for (const tool of toolDefinitions) {
|
|
107
|
-
server.
|
|
85
|
+
server.tool(tool.name, tool.description, tool.schema, async (args) => {
|
|
108
86
|
try {
|
|
109
87
|
const result = await client.request(tool.method, tool.pathTemplate, args);
|
|
110
88
|
const content = typeof result === "string"
|
|
@@ -126,7 +104,7 @@ for (const tool of toolDefinitions) {
|
|
|
126
104
|
}
|
|
127
105
|
// Register documentation resources
|
|
128
106
|
for (const doc of docResources) {
|
|
129
|
-
server.
|
|
107
|
+
server.resource(doc.name, doc.uri, { mimeType: doc.mimeType, description: doc.description }, async () => ({
|
|
130
108
|
contents: [
|
|
131
109
|
{ uri: doc.uri, mimeType: doc.mimeType, text: doc.content },
|
|
132
110
|
],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEpB,CAAC;AAEF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,EAAE,CAAC;AACzD,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,OAAO,CAAC,KAAK,CACX,kEAAkE;QAChE,2DAA2D,CAC9D,CAAC;IACF,OAAO,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C,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insightsentry/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "MCP server for InsightSentry financial data API - provides AI-accessible tools for market data, screening, options, and comprehensive API documentation resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|