This MCP server provides integration with the Mochi flashcard system, allowing you to manage your flashcards through the Model Context Protocol.
- Create, update, and delete flashcards
- List flashcards, decks, and templates
-
Install dependencies:
npm install
-
Configure your Mochi API token:
- Copy
.env.example
to.env
- Replace
your_mochi_api_token_here
with your actual Mochi API token
- Copy
-
Build the project:
npm run build
-
Start the server:
npm start
Create a new flashcard in Mochi.
- Parameters:
content
: string (Markdown content of the card. Separate front and back using a horizontal rule---
)deck-id
: string (ID of the deck to create the card in)template-id
: string (optional, template to use for the card)manual-tags
: string[] (optional, tags to add to the card)fields
: object (map of field IDs to field values, required if using a template)
Update or delete an existing flashcard in Mochi. To delete, set trashed
to true.
- Parameters:
card-id
: string (ID of the card to update)- Any updatable card fields (see code for all options)
- To delete: set
trashed?
to'true'
(string)
List cards (paginated).
- Parameters:
deck-id
: string (optional, filter by deck)limit
: number (optional, 1-100)bookmark
: string (optional, for pagination)
List all decks.
- Parameters:
bookmark
: string (optional, for pagination)
List all templates.
- Parameters:
bookmark
: string (optional, for pagination)
Here's how to use the MCP server with the MCP Inspector:
-
Start the server:
npm start
-
In another terminal, use the MCP Inspector to interact with the server:
mcp-inspector
-
Create a new flashcard:
{ "tool": "mochi_create_card", "params": { "content": "What is MCP?\n---\nModel Context Protocol - a protocol for providing context to LLMs", "deck-id": "<YOUR_DECK_ID>" } }
-
List all decks:
{ "tool": "mochi_list_decks", "params": {} }
-
Delete a flashcard (set
trashed
to true via update):{ "tool": "mochi_update_card", "params": { "card-id": "<CARD_ID>", "trashed?": "true" } }
To use this with Claude Desktop, add the following to your claude_desktop_config.json
:
{
"mcpServers": {
"mochi": {
"command": "npx",
"args": [
"-y",
"@fredrika/mcp-mochi"
],
"env": {
"MOCHI_API_KEY": "<YOUR_TOKEN>"
}
}
}
}