@catchmexz/fedin-cms-mcp 0.1.1 → 0.1.2
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/build/index.js +24 -22
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -20,7 +20,7 @@ process.on('uncaughtException', (error) => {
|
|
|
20
20
|
*/
|
|
21
21
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
22
22
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
23
|
-
import { CallToolRequestSchema,
|
|
23
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, ErrorCode, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
24
24
|
import axios from "axios";
|
|
25
25
|
import dotenv from 'dotenv';
|
|
26
26
|
// Load environment variables from .env file
|
|
@@ -819,27 +819,29 @@ async function createContentType(contentTypeData) {
|
|
|
819
819
|
* - JSON MIME type
|
|
820
820
|
* - Human readable name and description
|
|
821
821
|
*/
|
|
822
|
-
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
822
|
+
// server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
823
|
+
// try {
|
|
824
|
+
// // Fetch all content types
|
|
825
|
+
// const contentTypes = await fetchContentTypes();
|
|
826
|
+
// // Create a resource for each content type
|
|
827
|
+
// const contentTypeResources = contentTypes.map(ct => ({
|
|
828
|
+
// uri: `strapi://content-type/${ct.uid}`,
|
|
829
|
+
// mimeType: "application/json",
|
|
830
|
+
// name: ct.info.displayName,
|
|
831
|
+
// description: `Strapi content type: ${ct.info.displayName}`
|
|
832
|
+
// }));
|
|
833
|
+
// // Return the resources
|
|
834
|
+
// return {
|
|
835
|
+
// resources: contentTypeResources
|
|
836
|
+
// };
|
|
837
|
+
// } catch (error) {
|
|
838
|
+
// console.error("[Error] Failed to list resources:", error);
|
|
839
|
+
// throw new McpError(
|
|
840
|
+
// ErrorCode.InternalError,
|
|
841
|
+
// `Failed to list resources: ${error instanceof Error ? error.message : String(error)}`
|
|
842
|
+
// );
|
|
843
|
+
// }
|
|
844
|
+
// });
|
|
843
845
|
/**
|
|
844
846
|
* Handler for reading the contents of a specific resource.
|
|
845
847
|
* Takes a strapi:// URI and returns the content as JSON.
|