@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-instructions",
787
- "Instruction Essential backend setup tool. <critical>MANDATORY: You MUST use this tool FIRST before attempting any backend operations. Contains required API endpoints, authentication details, and setup instructions.</critical>",
788
- {},
789
- withUsageTracking("get-instructions", async () => {
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("instructions");
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
  })
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-CLLI7UFN.js";
4
+ } from "./chunk-BY5473FJ.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-CLLI7UFN.js";
4
+ } from "./chunk-BY5473FJ.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.1.7-dev.3",
3
+ "version": "1.1.7-dev.4",
4
4
  "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",