@insforge/mcp 1.1.7-dev.3 → 1.1.7-dev.4
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.
|
@@ -783,12 +783,16 @@ function registerInsforgeTools(server, config = {}) {
|
|
|
783
783
|
}
|
|
784
784
|
};
|
|
785
785
|
server.tool(
|
|
786
|
-
"get-
|
|
787
|
-
|
|
788
|
-
{
|
|
789
|
-
|
|
786
|
+
"get-docs",
|
|
787
|
+
'Fetch Insforge documentation. Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.',
|
|
788
|
+
{
|
|
789
|
+
docType: z14.enum(["instructions", "db-sdk", "auth-sdk", "storage-sdk", "functions-sdk", "ai-integration-sdk"]).describe(
|
|
790
|
+
'Documentation type: "instructions" (essential backend setup - use FIRST), "db-sdk" (database operations), "auth-sdk" (authentication), "storage-sdk" (file storage), "functions-sdk" (edge functions), "ai-integration-sdk" (AI features)'
|
|
791
|
+
)
|
|
792
|
+
},
|
|
793
|
+
withUsageTracking("get-docs", async ({ docType }) => {
|
|
790
794
|
try {
|
|
791
|
-
const content = await fetchDocumentation(
|
|
795
|
+
const content = await fetchDocumentation(docType);
|
|
792
796
|
return {
|
|
793
797
|
content: [
|
|
794
798
|
{
|
|
@@ -800,7 +804,46 @@ function registerInsforgeTools(server, config = {}) {
|
|
|
800
804
|
} catch (error) {
|
|
801
805
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
802
806
|
return {
|
|
803
|
-
content: [{ type: "text", text: `Error: ${errMsg}` }]
|
|
807
|
+
content: [{ type: "text", text: `Error fetching ${docType} documentation: ${errMsg}` }]
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
})
|
|
811
|
+
);
|
|
812
|
+
server.tool(
|
|
813
|
+
"get-anon-key",
|
|
814
|
+
"Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
|
|
815
|
+
{
|
|
816
|
+
apiKey: z14.string().optional().describe("API key for authentication (optional if provided via --api_key)")
|
|
817
|
+
},
|
|
818
|
+
withUsageTracking("get-anon-key", async ({ apiKey }) => {
|
|
819
|
+
try {
|
|
820
|
+
const actualApiKey = getApiKey(apiKey);
|
|
821
|
+
const response = await fetch2(`${API_BASE_URL}/api/auth/tokens/anon`, {
|
|
822
|
+
method: "POST",
|
|
823
|
+
headers: {
|
|
824
|
+
"x-api-key": actualApiKey,
|
|
825
|
+
"Content-Type": "application/json"
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
const result = await handleApiResponse(response);
|
|
829
|
+
return {
|
|
830
|
+
content: [
|
|
831
|
+
{
|
|
832
|
+
type: "text",
|
|
833
|
+
text: formatSuccessMessage("Anonymous token generated", result)
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
};
|
|
837
|
+
} catch (error) {
|
|
838
|
+
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
839
|
+
return {
|
|
840
|
+
content: [
|
|
841
|
+
{
|
|
842
|
+
type: "text",
|
|
843
|
+
text: `Error generating anonymous token: ${errMsg}`
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
isError: true
|
|
804
847
|
};
|
|
805
848
|
}
|
|
806
849
|
})
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED