@fredrika/mcp-mochi
Version:
MCP server for Mochi flashcard integration
316 lines (315 loc) • 9.24 kB
TypeScript
#!/usr/bin/env node
import { z } from "zod";
declare const CreateCardRequestSchema: z.ZodObject<{
content: z.ZodString;
"deck-id": z.ZodString;
"template-id": z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
"manual-tags": z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
id: z.ZodString;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
value: string;
}, {
id: string;
value: string;
}>>>;
}, "strip", z.ZodTypeAny, {
content: string;
"deck-id": string;
"template-id": string | null;
"manual-tags"?: string[] | undefined;
fields?: Record<string, {
id: string;
value: string;
}> | undefined;
}, {
content: string;
"deck-id": string;
"template-id"?: string | null | undefined;
"manual-tags"?: string[] | undefined;
fields?: Record<string, {
id: string;
value: string;
}> | undefined;
}>;
declare const UpdateCardRequestSchema: z.ZodObject<{
content: z.ZodOptional<z.ZodString>;
"deck-id": z.ZodOptional<z.ZodString>;
"template-id": z.ZodOptional<z.ZodString>;
"archived?": z.ZodOptional<z.ZodBoolean>;
"trashed?": z.ZodOptional<z.ZodString>;
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
id: z.ZodString;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
value: string;
}, {
id: string;
value: string;
}>>>;
}, "strip", z.ZodTypeAny, {
content?: string | undefined;
"deck-id"?: string | undefined;
"template-id"?: string | undefined;
fields?: Record<string, {
id: string;
value: string;
}> | undefined;
"archived?"?: boolean | undefined;
"trashed?"?: string | undefined;
}, {
content?: string | undefined;
"deck-id"?: string | undefined;
"template-id"?: string | undefined;
fields?: Record<string, {
id: string;
value: string;
}> | undefined;
"archived?"?: boolean | undefined;
"trashed?"?: string | undefined;
}>;
declare const ListDecksParamsSchema: z.ZodObject<{
bookmark: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
bookmark?: string | undefined;
}, {
bookmark?: string | undefined;
}>;
declare const ListCardsParamsSchema: z.ZodObject<{
"deck-id": z.ZodOptional<z.ZodString>;
limit: z.ZodOptional<z.ZodNumber>;
bookmark: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
"deck-id"?: string | undefined;
bookmark?: string | undefined;
limit?: number | undefined;
}, {
"deck-id"?: string | undefined;
bookmark?: string | undefined;
limit?: number | undefined;
}>;
declare const ListTemplatesParamsSchema: z.ZodObject<{
bookmark: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
bookmark?: string | undefined;
}, {
bookmark?: string | undefined;
}>;
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;
options: z.ZodOptional<z.ZodObject<{
"multi-line?": z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
"multi-line?"?: boolean | undefined;
}, {
"multi-line?"?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
id: string;
content: string;
fields: Record<string, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}>;
pos: string;
}, {
name: string;
id: string;
content: string;
fields: Record<string, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}>;
pos: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
bookmark: string;
docs: {
name: string;
id: string;
content: string;
fields: Record<string, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}>;
pos: string;
}[];
}, {
bookmark: string;
docs: {
name: string;
id: string;
content: string;
fields: Record<string, {
name: string;
id: string;
pos: string;
options?: {
"multi-line?"?: boolean | undefined;
} | undefined;
}>;
pos: string;
}[];
}>;
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>;
declare const CreateCardResponseSchema: z.ZodObject<{
id: z.ZodString;
tags: z.ZodArray<z.ZodString, "many">;
content: z.ZodString;
name: z.ZodString;
"deck-id": z.ZodString;
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}, {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}>;
declare const ListCardsResponseSchema: z.ZodObject<{
bookmark: z.ZodString;
docs: z.ZodArray<z.ZodObject<{
id: z.ZodString;
tags: z.ZodArray<z.ZodString, "many">;
content: z.ZodString;
name: z.ZodString;
"deck-id": z.ZodString;
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}, {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
bookmark: string;
docs: {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}[];
}, {
bookmark: string;
docs: {
name: string;
id: string;
content: string;
"deck-id": string;
tags: string[];
fields?: Record<string, unknown> | undefined;
}[];
}>;
type CreateCardResponse = z.infer<typeof CreateCardResponseSchema>;
type ListDecksResponse = z.infer<typeof ListDecksResponseSchema>["docs"];
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;
archived: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
sort: number;
name: string;
id: string;
archived?: boolean | undefined;
}, {
sort: number;
name: string;
id: string;
archived?: boolean | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
bookmark: string;
docs: {
sort: number;
name: string;
id: string;
archived?: boolean | undefined;
}[];
}, {
bookmark: string;
docs: {
sort: number;
name: string;
id: string;
archived?: boolean | undefined;
}[];
}>;
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>;
}
export {};