@fredrika/mcp-mochi 2.1.0 → 2.3.0

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ const CreateCardRequestSchema = z.object({
34
34
  content: z
35
35
  .string()
36
36
  .min(1)
37
- .describe("Markdown content of the card. Separate the question and answer with a horizontal rule surrounded by newlines: '\\n---\\n'"),
37
+ .describe("Markdown content of the card. Separate the question and answer with a horizontal rule (3 dashes) surrounded by newlines: '\\n---\\n'. IMPORTANT: the dashes must be on an empty line."),
38
38
  deckId: z.string().min(1).describe("ID of the deck to create the card in"),
39
39
  templateId: z
40
40
  .string()
@@ -277,9 +277,9 @@ const GetDueCardsResponseSchema = z.object({
277
277
  cards: z.array(DueCardSchema).describe("Array of cards due for review"),
278
278
  });
279
279
  function getApiKey() {
280
- const apiKey = process.env.API_KEY;
280
+ const apiKey = process.env.MOCHI_API_KEY;
281
281
  if (!apiKey) {
282
- console.error("API_KEY environment variable is not set");
282
+ console.error("MOCHI_API_KEY environment variable is not set");
283
283
  process.exit(1);
284
284
  }
285
285
  return apiKey;
@@ -540,7 +540,7 @@ function formatToolError(error) {
540
540
  // Note: Using type assertions due to Zod version compatibility between SDK (v4) and project (v3)
541
541
  server.registerTool("create_flashcard", {
542
542
  title: "Create flashcard on Mochi",
543
- description: "Create a new flashcard in Mochi. Look up deckId with list_decks first. Use create_card_from_template if the deck has a template-id defined.",
543
+ description: "Create a new flashcard in Mochi. Look up deckId with list_decks first. Use create_card_from_template if the deck has a template-id defined. IMPORTANT: To add images/audio/files: 1) Create the card (include placeholder with id like '![](ChWupMjQ.png)' in content), 2) Use add_attachment with the returned card ID to upload the file with the matching id.",
544
544
  inputSchema: CreateCardRequestSchema,
545
545
  outputSchema: CreateCardResponseSchema,
546
546
  annotations: {
@@ -666,7 +666,7 @@ server.registerTool("archive_flashcard", {
666
666
  });
667
667
  server.registerTool("add_attachment", {
668
668
  title: "Add attachment to flashcard on Mochi",
669
- description: "Add an attachment (image, audio, etc.) to a card using base64 data. For URL-based images, just use markdown directly in card content instead.",
669
+ description: "Upload an attachment (image, audio, etc.) to an EXISTING card using base64 data. The card content must already include the markdown reference '![](@media/filename)' where filename matches the uploaded file. Workflow: 1) Create card with create_flashcard (include '![](@media/filename.png)' in content), 2) Upload file with this tool using the card ID and matching filename. For URL-based images, just use standard markdown in card content instead.",
670
670
  inputSchema: AddAttachmentSchema,
671
671
  outputSchema: AddAttachmentResponseSchema,
672
672
  annotations: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fredrika/mcp-mochi",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "MCP server for Mochi flashcard integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",