Mochi MCP Server
An MCP server for creating and managing Mochi Cards flashcards via AI.
Supports both HTTP/SSE (for Vercel deployment) and stdio (for local use with Claude Desktop).
Features
Card Operations
create_card- Create a new cardget_card- Get card detailslist_cards- List cardsupdate_card- Update a carddelete_card- Delete a cardadd_attachment- Add attachment to a carddelete_attachment- Delete attachmentcreate_cards_bulk- Create multiple cards at once
Deck Operations
create_deck- Create a new deckget_deck- Get deck detailslist_decks- List all decksupdate_deck- Update a deckdelete_deck- Delete a deck
Template Operations
create_template- Create a new templateget_template- Get template detailslist_templates- List all templates
Review
get_due_cards- Get cards due for review
Deployment
Deploy to Vercel
- Click the deploy button above
- Set the
MOCHI_API_KEYenvironment variable - Deploy
API Endpoints
GET /- Server info pagePOST /api/mcp- MCP JSON-RPC endpointGET /api/mcp/sse- SSE endpoint for streaming connectionsPOST /api/mcp/sse- SSE message endpoint
Example Request
curl -X POST https://your-domain.vercel.app/api/mcp \
-H "Content-Type: application/json" \
-H "x-mochi-api-key: YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
Local Development
Installation
npm install
Development Server
npm run dev
Build
npm run build
Stdio Mode (Claude Desktop)
For local use with Claude Desktop, use the stdio transport:
Build stdio version
npm run build:stdio
Claude Desktop Configuration
Add the following to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"mochi": {
"command": "node",
"args": ["/path/to/mochi-mcp-server/dist/stdio.js"],
"env": {
"MOCHI_API_KEY": "your-api-key-here"
}
}
}
}
Getting Mochi API Key
- Log in to Mochi Cards
- Go to Account Settings → API to get your API key
Usage
Creating Cards
Card content is in Markdown format. Use --- to separate front and back:
What is the capital of France?
---
Paris
Bulk Card Creation
{
"method": "tools/call",
"params": {
"name": "create_cards_bulk",
"arguments": {
"deck_id": "deck-id",
"cards": [
{ "content": "Question 1\n---\nAnswer 1" },
{ "content": "Question 2\n---\nAnswer 2", "tags": ["tag1", "tag2"] }
]
}
}
}
Notes
- Mochi API only accepts one concurrent request per account
- Be aware of rate limits (429 error)
- Deck deletion cannot be undone
License
ISC
