UNPKG

@fredrika/mcp-mochi

Version:

MCP server for Mochi flashcard integration

155 lines (154 loc) 6.16 kB
#!/usr/bin/env node import { z } from "zod"; declare const CreateCardRequestSchema: z.ZodObject<{ content: z.ZodString; deckId: z.ZodString; templateId: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>; tags: z.ZodOptional<z.ZodArray<z.ZodString>>; attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>; declare const UpdateCardRequestSchema: z.ZodObject<{ content: z.ZodOptional<z.ZodString>; deckId: z.ZodOptional<z.ZodString>; templateId: z.ZodOptional<z.ZodString>; archived: z.ZodOptional<z.ZodBoolean>; trashed: z.ZodOptional<z.ZodBoolean>; fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ id: z.ZodString; value: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; declare const ListDecksParamsSchema: z.ZodObject<{ bookmark: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const ListCardsParamsSchema: z.ZodObject<{ deckId: z.ZodOptional<z.ZodString>; limit: z.ZodOptional<z.ZodNumber>; bookmark: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const ListTemplatesParamsSchema: z.ZodObject<{ bookmark: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const GetDueCardsParamsSchema: z.ZodObject<{ deckId: z.ZodOptional<z.ZodString>; date: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const CreateCardFromTemplateSchema: z.ZodObject<{ templateId: z.ZodString; deckId: z.ZodString; fields: z.ZodRecord<z.ZodString, z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString>>; attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>; interface AddAttachmentRequest { cardId: string; data: string; filename: string; contentType?: string; } declare const TemplateSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; content: z.ZodString; pos: z.ZodString; fields: z.ZodRecord<z.ZodString, z.ZodObject<{ id: z.ZodString; name: z.ZodString; pos: z.ZodString; type: z.ZodNullable<z.ZodOptional<z.ZodString>>; source: z.ZodNullable<z.ZodOptional<z.ZodString>>; options: z.ZodOptional<z.ZodObject<{ "multi-line?": z.ZodOptional<z.ZodBoolean>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>; declare const ListTemplatesResponseSchema: z.ZodObject<{ bookmark: z.ZodString; docs: z.ZodArray<z.ZodObject<{ id: z.ZodString; name: z.ZodString; content: z.ZodString; pos: z.ZodString; fields: z.ZodRecord<z.ZodString, z.ZodObject<{ id: z.ZodString; name: z.ZodString; pos: z.ZodString; type: z.ZodNullable<z.ZodOptional<z.ZodString>>; source: z.ZodNullable<z.ZodOptional<z.ZodString>>; options: z.ZodOptional<z.ZodObject<{ "multi-line?": z.ZodOptional<z.ZodBoolean>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; type ListTemplatesParams = z.infer<typeof ListTemplatesParamsSchema>; type ListTemplatesResponse = z.infer<typeof ListTemplatesResponseSchema>; type ListCardsParams = z.infer<typeof ListCardsParamsSchema>; type ListDecksParams = z.infer<typeof ListDecksParamsSchema>; type CreateCardRequest = z.infer<typeof CreateCardRequestSchema>; type UpdateCardRequest = z.infer<typeof UpdateCardRequestSchema>; type GetDueCardsParams = z.infer<typeof GetDueCardsParamsSchema>; type CreateCardFromTemplateParams = z.infer<typeof CreateCardFromTemplateSchema>; declare const CreateCardResponseSchema: z.ZodObject<{ id: z.ZodString; tags: z.ZodArray<z.ZodString>; content: z.ZodString; name: z.ZodString; "deck-id": z.ZodString; fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, z.core.$strip>; declare const ListCardsResponseSchema: z.ZodObject<{ bookmark: z.ZodString; docs: z.ZodArray<z.ZodObject<{ id: z.ZodString; tags: z.ZodArray<z.ZodString>; content: z.ZodString; name: z.ZodString; "deck-id": z.ZodString; fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, z.core.$strip>>; }, z.core.$strip>; type CreateCardResponse = z.infer<typeof CreateCardResponseSchema>; type ListDecksResponse = z.infer<typeof ListDecksResponseSchema>; type ListCardsResponse = z.infer<typeof ListCardsResponseSchema>; declare const ListDecksResponseSchema: z.ZodObject<{ bookmark: z.ZodString; docs: z.ZodArray<z.ZodObject<{ id: z.ZodString; sort: z.ZodNumber; name: z.ZodString; "template-id": z.ZodNullable<z.ZodOptional<z.ZodString>>; "archived?": z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; "trashed?": z.ZodNullable<z.ZodOptional<z.ZodObject<{ date: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>; declare const GetDueCardsResponseSchema: z.ZodObject<{ cards: z.ZodArray<z.ZodObject<{ id: z.ZodString; content: z.ZodString; name: z.ZodString; "deck-id": z.ZodString; "new?": z.ZodOptional<z.ZodBoolean>; }, z.core.$loose>>; }, z.core.$strip>; export declare class MochiClient { private api; private token; constructor(token: string); createCard(request: CreateCardRequest): Promise<CreateCardResponse>; updateCard(cardId: string, request: UpdateCardRequest): Promise<CreateCardResponse>; listDecks(params?: ListDecksParams): Promise<ListDecksResponse>; listCards(params?: ListCardsParams): Promise<ListCardsResponse>; listTemplates(params?: ListTemplatesParams): Promise<ListTemplatesResponse>; getDueCards(params?: GetDueCardsParams): Promise<z.infer<typeof GetDueCardsResponseSchema>>; getTemplate(templateId: string): Promise<z.infer<typeof TemplateSchema>>; createCardFromTemplate(request: CreateCardFromTemplateParams): Promise<CreateCardResponse>; deleteCard(cardId: string): Promise<void>; addAttachment(request: AddAttachmentRequest): Promise<{ filename: string; markdown: string; }>; } export {};