anki-mcp-http 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -7
- package/bin/ankimcp.js +11 -1
- package/dist/cli.js +23 -5
- package/dist/cli.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -68,7 +68,42 @@ The easiest way to install this MCP server for Claude Desktop:
|
|
|
68
68
|
|
|
69
69
|
That's it! The bundle includes everything needed to run the server locally.
|
|
70
70
|
|
|
71
|
-
### Option 2:
|
|
71
|
+
### Option 2: NPM Package with STDIO (For Other MCP Clients)
|
|
72
|
+
|
|
73
|
+
Want to use Anki with MCP clients like **Cursor IDE**, **Cline**, or **Zed Editor**? Use the npm package with the `--stdio` flag:
|
|
74
|
+
|
|
75
|
+
**Supported Clients:**
|
|
76
|
+
- [Cursor IDE](https://www.cursor.com/) - AI-powered code editor
|
|
77
|
+
- [Cline](https://github.com/cline/cline) - VS Code extension for AI assistance
|
|
78
|
+
- [Zed Editor](https://zed.dev/) - Fast, modern code editor
|
|
79
|
+
- Other MCP clients that support STDIO transport
|
|
80
|
+
|
|
81
|
+
**Basic Configuration:**
|
|
82
|
+
|
|
83
|
+
Add this to your MCP client's configuration file:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"anki-mcp": {
|
|
89
|
+
"command": "npx",
|
|
90
|
+
"args": ["-y", "anki-mcp-http", "--stdio"],
|
|
91
|
+
"env": {
|
|
92
|
+
"ANKI_CONNECT_URL": "http://localhost:8765"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Configuration file locations:**
|
|
100
|
+
- **Cursor IDE**: `~/.cursor/mcp.json` (macOS/Linux) or `%USERPROFILE%\.cursor\mcp.json` (Windows)
|
|
101
|
+
- **Cline**: Accessible via settings UI in VS Code
|
|
102
|
+
- **Zed Editor**: Install as MCP extension through extension marketplace
|
|
103
|
+
|
|
104
|
+
For client-specific features and troubleshooting, consult your MCP client's documentation.
|
|
105
|
+
|
|
106
|
+
### Option 3: HTTP Mode (For Remote AI Assistants)
|
|
72
107
|
|
|
73
108
|
Want to use Anki with ChatGPT or Claude.ai in your browser? This mode lets you connect web-based AI tools to your local Anki.
|
|
74
109
|
|
|
@@ -100,15 +135,19 @@ npm run start:prod:http
|
|
|
100
135
|
ankimcp [options]
|
|
101
136
|
|
|
102
137
|
Options:
|
|
103
|
-
|
|
104
|
-
-
|
|
138
|
+
--stdio Run in STDIO mode (for MCP clients)
|
|
139
|
+
-p, --port <port> Port to listen on (HTTP mode, default: 3000)
|
|
140
|
+
-h, --host <host> Host to bind to (HTTP mode, default: 127.0.0.1)
|
|
105
141
|
-a, --anki-connect <url> AnkiConnect URL (default: http://localhost:8765)
|
|
106
142
|
--help Show help message
|
|
107
143
|
|
|
108
|
-
Examples:
|
|
109
|
-
ankimcp # Use all defaults
|
|
144
|
+
Examples - HTTP Mode:
|
|
145
|
+
ankimcp # Use all defaults (HTTP mode)
|
|
110
146
|
ankimcp --port 8080 # Custom port
|
|
111
147
|
ankimcp --host 0.0.0.0 # Listen on all network interfaces
|
|
148
|
+
|
|
149
|
+
Examples - STDIO Mode:
|
|
150
|
+
ankimcp --stdio # For use with npx in MCP clients
|
|
112
151
|
```
|
|
113
152
|
|
|
114
153
|
**Using with ngrok:**
|
|
@@ -126,7 +165,7 @@ ngrok http 3000
|
|
|
126
165
|
|
|
127
166
|
**Security note:** Anyone with your ngrok URL can access your Anki, so keep that URL private!
|
|
128
167
|
|
|
129
|
-
### Option
|
|
168
|
+
### Option 4: Manual Installation from Source (Local Mode)
|
|
130
169
|
|
|
131
170
|
For development or advanced usage:
|
|
132
171
|
|
|
@@ -562,7 +601,7 @@ This project follows [Semantic Versioning](https://semver.org/) with a pre-1.0 d
|
|
|
562
601
|
- Will be released when the API is stable and tested
|
|
563
602
|
- Breaking changes will require major version bumps (2.0.0, etc.)
|
|
564
603
|
|
|
565
|
-
**Current Status**: `0.
|
|
604
|
+
**Current Status**: `0.6.0` - Active beta development. New features include the `twenty_rules` prompt for evidence-based flashcard creation, media file management, and improved prompt system. APIs may change based on feedback and testing.
|
|
566
605
|
|
|
567
606
|
## Similar Projects
|
|
568
607
|
|
package/bin/ankimcp.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// Check if --stdio flag is present
|
|
4
|
+
const isStdioMode = process.argv.includes('--stdio');
|
|
5
|
+
|
|
6
|
+
if (isStdioMode) {
|
|
7
|
+
// STDIO mode - for MCP clients like Cursor, Cline, Zed, etc.
|
|
8
|
+
require('../dist/main-stdio.js');
|
|
9
|
+
} else {
|
|
10
|
+
// HTTP mode (default) - for web-based AI assistants
|
|
11
|
+
require('../dist/main-http.js');
|
|
12
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -28,19 +28,37 @@ function parseCliArgs() {
|
|
|
28
28
|
const program = new commander_1.Command();
|
|
29
29
|
program
|
|
30
30
|
.name('ankimcp')
|
|
31
|
-
.description('AnkiMCP
|
|
31
|
+
.description('AnkiMCP Server - Model Context Protocol server for Anki')
|
|
32
32
|
.version(getVersion())
|
|
33
|
-
.option('
|
|
34
|
-
.option('-
|
|
33
|
+
.option('--stdio', 'Run in STDIO mode (for MCP clients like Cursor, Cline, Zed)')
|
|
34
|
+
.option('-p, --port <number>', 'Port to listen on (HTTP mode)', '3000')
|
|
35
|
+
.option('-h, --host <address>', 'Host to bind to (HTTP mode)', '127.0.0.1')
|
|
35
36
|
.option('-a, --anki-connect <url>', 'AnkiConnect URL', 'http://localhost:8765')
|
|
36
37
|
.addHelpText('after', `
|
|
37
|
-
|
|
38
|
+
Transport Modes:
|
|
39
|
+
HTTP Mode (default): For web-based AI assistants (ChatGPT, Claude.ai)
|
|
40
|
+
STDIO Mode: For desktop MCP clients (Cursor, Cline, Zed)
|
|
41
|
+
|
|
42
|
+
Examples - HTTP Mode:
|
|
38
43
|
$ ankimcp # Use defaults
|
|
39
44
|
$ ankimcp --port 8080 # Custom port
|
|
40
45
|
$ ankimcp --host 0.0.0.0 --port 3000 # Listen on all interfaces
|
|
41
46
|
$ ankimcp --anki-connect http://localhost:8765
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
Examples - STDIO Mode:
|
|
49
|
+
$ ankimcp --stdio # For use with npx in MCP clients
|
|
50
|
+
|
|
51
|
+
# MCP client configuration (Cursor, Cline, Zed, etc.):
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"anki-mcp": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["-y", "anki-mcp-http", "--stdio"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Usage with ngrok (HTTP mode only):
|
|
44
62
|
1. Start ankimcp in one terminal
|
|
45
63
|
2. In another terminal: ngrok http 3000
|
|
46
64
|
3. Share the ngrok URL with your AI assistant
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAyBA,0CAEC;AAED,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAyBA,0CAEC;AAED,oCA4DC;AAED,oDA0BC;AArHD,yCAAoC;AACpC,2BAAkC;AAClC,+BAA4B;AAC5B,sEAA6C;AAQ7C,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC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