Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": ["@commitlint/config-conventional"]
"extends": ["@commitlint/config-conventional"],
"rules": {
"header-max-length": [0, "always", 100]
}
}
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ FRONTEND_URL=http://localhost:5173
# If unset, falls back to FRONTEND_URL.
# Local dev: http://localhost:5173 Prod: https://app.your-domain.com,https://staging.your-domain.com
TRUSTED_ORIGINS=

# ── MCP SERVER ────────────────────────────────────────────────────────────

# API key used by the MCP server to authenticate against the REST API (ak_ prefix)
# Generate one in the web UI under Account → API Keys
MCP_API_KEY=
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,38 @@ Account management endpoints (`/v1/me/*`) use the session cookie set by [Better

---

## MCP integration (LLM → Anki)

The MCP server lets any LLM (Claude Desktop, API clients) manage your decks and notes directly:

```
User: "Create flashcards from this discussion"
LLM: "<calls create_notes_bulk> → cards appear in Anki instantly"
```

**Claude Desktop setup** — add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
"mcpServers": {
"anki-cloud": {
"command": "bun",
"args": ["run", "/path/to/anki-cloud/mcp/src/index.ts"],
"env": {
"API_URL": "http://localhost:3000",
"API_KEY": "ak_your_key_here"
}
}
}
}
```

Generate an API key in the web UI under **Account → API Keys**, replace the path and key, then restart Claude Desktop.

Full setup guide, available tools, and Docker deployment: [docs/mcp-integration.md](docs/mcp-integration.md)

---

## Connecting Anki Desktop

In Anki: **Preferences → Syncing → Self-hosted sync server**, set the URL to:
Expand Down Expand Up @@ -151,8 +183,9 @@ cd e2e && bun test
## Project structure

```
api/ REST API — TypeScript / Hono on Bun (shared workspace with db/)
api/ REST API — TypeScript / Hono on Bun (shared workspace with db/ and mcp/)
db/ Drizzle ORM + SQLite schema (@anki-cloud/db)
mcp/ MCP server — wraps REST API, 8 tools for LLM integration
web/ Account management UI (Vite + React) (standalone — cd web && bun install)
e2e/ End-to-end tests (standalone — cd e2e && bun install)
docs/ Architecture decisions (ADRs) + narrative docs
Expand Down
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /app
COPY package.json ./
COPY api/package.json ./api/
COPY db/package.json ./db/
COPY mcp/package.json ./mcp/
COPY bun.lock ./

RUN bun install --frozen-lockfile
Expand Down
172 changes: 172 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,17 @@ services:
depends_on:
- anki-sync-server

mcp:
build:
context: .
dockerfile: mcp/Dockerfile
ports:
- "3001:3001"
environment:
API_URL: http://api:3000
API_KEY: ${MCP_API_KEY}
depends_on:
- api

volumes:
app-data:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading