@asd412id/mcp-context-manager 1.0.0 → 1.0.1
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 +241 -80
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,182 @@
|
|
|
1
1
|
# MCP Context Manager
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) tools
|
|
3
|
+
MCP (Model Context Protocol) tools for context management in AI coding agents. Helps prevent out-of-context issues in long conversations.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Memory Store** - Persistent key-value storage
|
|
8
|
-
- **Context Summarizer** -
|
|
7
|
+
- **Memory Store** - Persistent key-value storage across sessions
|
|
8
|
+
- **Context Summarizer** - Summarize chat/text, extract key points, decisions, action items
|
|
9
9
|
- **Project Tracker** - Track decisions, changes, todos, notes, errors
|
|
10
10
|
- **Session Checkpoint** - Save/restore session state
|
|
11
|
-
- **Smart File Loader** - Load
|
|
11
|
+
- **Smart File Loader** - Load files with relevance filtering
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
|
+
Requires Node.js >= 18.0.0
|
|
16
|
+
|
|
15
17
|
```bash
|
|
18
|
+
# Run directly with npx (recommended)
|
|
19
|
+
npx @asd412id/mcp-context-manager
|
|
20
|
+
|
|
21
|
+
# Or install globally
|
|
16
22
|
npm install -g @asd412id/mcp-context-manager
|
|
17
23
|
```
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
## Configuration by Client
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
### Claude Desktop
|
|
28
|
+
|
|
29
|
+
**Config file location:**
|
|
30
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
31
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
32
|
+
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"context-manager": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
23
43
|
```
|
|
24
44
|
|
|
25
|
-
|
|
45
|
+
### VS Code (Copilot / Claude Extension)
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
**Config file:** `.vscode/mcp.json` in your workspace
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"servers": {
|
|
52
|
+
"context-manager": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "@asd412id/mcp-context-manager"],
|
|
55
|
+
"type": "stdio"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or in **VS Code Settings** (`settings.json`):
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcp.servers": {
|
|
66
|
+
"context-manager": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Cursor
|
|
75
|
+
|
|
76
|
+
**Config file location:**
|
|
77
|
+
- **Windows:** `%APPDATA%\Cursor\mcp.json`
|
|
78
|
+
- **macOS:** `~/Library/Application Support/Cursor/mcp.json`
|
|
79
|
+
- **Linux:** `~/.config/Cursor/mcp.json`
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"mcpServers": {
|
|
84
|
+
"context-manager": {
|
|
85
|
+
"command": "npx",
|
|
86
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Windsurf
|
|
93
|
+
|
|
94
|
+
**Config file location:**
|
|
95
|
+
- **Windows:** `%APPDATA%\Windsurf\mcp.json`
|
|
96
|
+
- **macOS:** `~/Library/Application Support/Windsurf/mcp.json`
|
|
97
|
+
- **Linux:** `~/.config/Windsurf/mcp.json`
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"mcpServers": {
|
|
102
|
+
"context-manager": {
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Cline (VS Code Extension)
|
|
111
|
+
|
|
112
|
+
**Config file:** `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"context-manager": {
|
|
118
|
+
"command": "npx",
|
|
119
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Continue (VS Code Extension)
|
|
28
126
|
|
|
29
|
-
|
|
127
|
+
**Config file:** `~/.continue/config.json`
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"experimental": {
|
|
132
|
+
"modelContextProtocolServers": [
|
|
133
|
+
{
|
|
134
|
+
"transport": {
|
|
135
|
+
"type": "stdio",
|
|
136
|
+
"command": "npx",
|
|
137
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### OpenCode
|
|
146
|
+
|
|
147
|
+
**Config file:** `opencode.json` or in your project config
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"context-manager": {
|
|
153
|
+
"command": "npx",
|
|
154
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Zed Editor
|
|
161
|
+
|
|
162
|
+
**Config file:** `~/.config/zed/settings.json`
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"context_servers": {
|
|
167
|
+
"context-manager": {
|
|
168
|
+
"command": {
|
|
169
|
+
"path": "npx",
|
|
170
|
+
"args": ["-y", "@asd412id/mcp-context-manager"]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Custom Context Path (All Clients)
|
|
178
|
+
|
|
179
|
+
To specify a custom path for storing context data, add the `env` option:
|
|
30
180
|
|
|
31
181
|
```json
|
|
32
182
|
{
|
|
@@ -42,35 +192,42 @@ Tambahkan ke `claude_desktop_config.json`:
|
|
|
42
192
|
}
|
|
43
193
|
```
|
|
44
194
|
|
|
45
|
-
|
|
195
|
+
## Prompts (Shortcut Commands)
|
|
46
196
|
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
| `
|
|
197
|
+
| Prompt | Description |
|
|
198
|
+
|--------|-------------|
|
|
199
|
+
| `ctx-init` | Load context from previous session |
|
|
200
|
+
| `ctx-save` | Save current state to checkpoint |
|
|
201
|
+
| `ctx-remember` | Save important info to memory |
|
|
202
|
+
| `ctx-todo` | Add a todo item |
|
|
203
|
+
| `ctx-decide` | Log a decision |
|
|
204
|
+
| `ctx-status` | Show project status |
|
|
205
|
+
| `ctx-compress` | Compress long context |
|
|
206
|
+
| `ctx-recall` | Search in memory |
|
|
50
207
|
|
|
51
|
-
## Available Tools
|
|
208
|
+
## Available Tools (25 tools)
|
|
52
209
|
|
|
53
|
-
### Memory Store
|
|
210
|
+
### Memory Store
|
|
54
211
|
|
|
55
212
|
| Tool | Description |
|
|
56
213
|
|------|-------------|
|
|
57
|
-
| `memory_set` |
|
|
58
|
-
| `memory_get` |
|
|
59
|
-
| `memory_search` |
|
|
60
|
-
| `memory_delete` |
|
|
61
|
-
| `memory_list` | List
|
|
214
|
+
| `memory_set` | Store key-value in memory |
|
|
215
|
+
| `memory_get` | Retrieve value from memory |
|
|
216
|
+
| `memory_search` | Search memory by pattern/tags |
|
|
217
|
+
| `memory_delete` | Delete memory entry |
|
|
218
|
+
| `memory_list` | List all memory keys |
|
|
62
219
|
| `memory_clear` | Clear memory (all/by tags) |
|
|
63
220
|
|
|
64
|
-
### Context Summarizer
|
|
221
|
+
### Context Summarizer
|
|
65
222
|
|
|
66
223
|
| Tool | Description |
|
|
67
224
|
|------|-------------|
|
|
68
|
-
| `context_summarize` |
|
|
69
|
-
| `context_get_summary` |
|
|
70
|
-
| `context_list_summaries` | List
|
|
71
|
-
| `context_merge_summaries` |
|
|
225
|
+
| `context_summarize` | Summarize text, extract key points, decisions, action items |
|
|
226
|
+
| `context_get_summary` | Get summary by ID |
|
|
227
|
+
| `context_list_summaries` | List all summaries |
|
|
228
|
+
| `context_merge_summaries` | Merge multiple summaries |
|
|
72
229
|
|
|
73
|
-
### Project Tracker
|
|
230
|
+
### Project Tracker
|
|
74
231
|
|
|
75
232
|
| Tool | Description |
|
|
76
233
|
|------|-------------|
|
|
@@ -81,7 +238,7 @@ Tambahkan ke `claude_desktop_config.json`:
|
|
|
81
238
|
| `tracker_set_project` | Set project name |
|
|
82
239
|
| `tracker_export` | Export tracker as markdown |
|
|
83
240
|
|
|
84
|
-
### Session Checkpoint
|
|
241
|
+
### Session Checkpoint
|
|
85
242
|
|
|
86
243
|
| Tool | Description |
|
|
87
244
|
|------|-------------|
|
|
@@ -91,7 +248,7 @@ Tambahkan ke `claude_desktop_config.json`:
|
|
|
91
248
|
| `checkpoint_delete` | Delete checkpoint |
|
|
92
249
|
| `checkpoint_compare` | Compare 2 checkpoints |
|
|
93
250
|
|
|
94
|
-
### Smart File Loader
|
|
251
|
+
### Smart File Loader
|
|
95
252
|
|
|
96
253
|
| Tool | Description |
|
|
97
254
|
|------|-------------|
|
|
@@ -100,84 +257,88 @@ Tambahkan ke `claude_desktop_config.json`:
|
|
|
100
257
|
| `file_search_content` | Search pattern in file |
|
|
101
258
|
| `file_list_dir` | List directory files |
|
|
102
259
|
|
|
260
|
+
## Environment Variables
|
|
261
|
+
|
|
262
|
+
| Variable | Description | Default |
|
|
263
|
+
|----------|-------------|---------|
|
|
264
|
+
| `MCP_CONTEXT_PATH` | Path to store context data | `{cwd}/.context` |
|
|
265
|
+
|
|
103
266
|
## Usage Examples
|
|
104
267
|
|
|
105
|
-
###
|
|
268
|
+
### Session Start Workflow
|
|
106
269
|
|
|
107
270
|
```
|
|
108
|
-
|
|
109
|
-
|
|
271
|
+
User: ctx-init
|
|
272
|
+
AI: *runs checkpoint_load(), tracker_status(), memory_list()*
|
|
273
|
+
```
|
|
110
274
|
|
|
111
|
-
|
|
112
|
-
memory_get({ key: "api_base_url" })
|
|
275
|
+
### Save Important Information
|
|
113
276
|
|
|
114
|
-
|
|
115
|
-
|
|
277
|
+
```
|
|
278
|
+
User: ctx-remember what:"API endpoint at https://api.example.com"
|
|
279
|
+
AI: *saves to memory with appropriate key and tags*
|
|
116
280
|
```
|
|
117
281
|
|
|
118
|
-
###
|
|
282
|
+
### Before Ending Session
|
|
119
283
|
|
|
120
284
|
```
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
text: "..long conversation..",
|
|
124
|
-
maxLength: 2000,
|
|
125
|
-
sessionId: "session-123"
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// Merge multiple summaries
|
|
129
|
-
context_merge_summaries({ ids: ["sum_1", "sum_2", "sum_3"] })
|
|
285
|
+
User: ctx-save name:"feature-login-done"
|
|
286
|
+
AI: *creates checkpoint with current state*
|
|
130
287
|
```
|
|
131
288
|
|
|
132
|
-
###
|
|
289
|
+
### When Context Gets Long
|
|
133
290
|
|
|
134
291
|
```
|
|
135
|
-
|
|
136
|
-
|
|
292
|
+
User: ctx-compress
|
|
293
|
+
AI: *summarize conversation, save checkpoint, store key info*
|
|
294
|
+
```
|
|
137
295
|
|
|
138
|
-
|
|
139
|
-
tracker_log({ type: "todo", content: "Implement user authentication" })
|
|
296
|
+
## Best Practices
|
|
140
297
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
298
|
+
1. **Session start** - Always run `ctx-init` to load previous context
|
|
299
|
+
2. **Save decisions** - Use `ctx-decide` for every important decision
|
|
300
|
+
3. **Track todos** - Use `ctx-todo` for tasks to be done
|
|
301
|
+
4. **Checkpoint regularly** - Run `ctx-save` every ~15-20 messages or after milestones
|
|
302
|
+
5. **Compress when long** - Use `ctx-compress` if chat gets too long
|
|
144
303
|
|
|
145
|
-
|
|
304
|
+
## Data Storage
|
|
146
305
|
|
|
147
|
-
|
|
148
|
-
// Save checkpoint before major changes
|
|
149
|
-
checkpoint_save({
|
|
150
|
-
name: "before-refactor",
|
|
151
|
-
description: "Completed user module, starting refactor",
|
|
152
|
-
state: { currentTask: "refactoring", completedFiles: ["user.ts"] },
|
|
153
|
-
files: ["src/user.ts", "src/auth.ts"]
|
|
154
|
-
})
|
|
306
|
+
All data is stored in `.context/` folder (default: working directory):
|
|
155
307
|
|
|
156
|
-
|
|
157
|
-
|
|
308
|
+
```
|
|
309
|
+
.context/
|
|
310
|
+
├── memory.json # Memory store
|
|
311
|
+
├── tracker.json # Project tracker
|
|
312
|
+
├── checkpoints/ # Session checkpoints
|
|
313
|
+
│ ├── index.json
|
|
314
|
+
│ └── cp_*.json
|
|
315
|
+
└── summaries/ # Context summaries
|
|
316
|
+
└── index.json
|
|
158
317
|
```
|
|
159
318
|
|
|
160
|
-
|
|
319
|
+
## Troubleshooting
|
|
161
320
|
|
|
162
|
-
|
|
163
|
-
// Read only code structure
|
|
164
|
-
file_smart_read({ path: "src/index.ts", structureOnly: true })
|
|
321
|
+
### Server not starting
|
|
165
322
|
|
|
166
|
-
|
|
167
|
-
|
|
323
|
+
1. Make sure Node.js >= 18 is installed: `node --version`
|
|
324
|
+
2. Try running manually: `npx @asd412id/mcp-context-manager`
|
|
325
|
+
3. Check if port/process conflicts exist
|
|
168
326
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
327
|
+
### Tools not appearing
|
|
328
|
+
|
|
329
|
+
1. Restart your MCP client after configuration changes
|
|
330
|
+
2. Check config file syntax (valid JSON)
|
|
331
|
+
3. Verify the config file location is correct for your client
|
|
172
332
|
|
|
173
|
-
|
|
333
|
+
### Permission issues
|
|
174
334
|
|
|
175
|
-
1.
|
|
176
|
-
2.
|
|
177
|
-
3. **Summarize conversation** secara berkala
|
|
178
|
-
4. **Track decisions** agar tidak perlu explain ulang
|
|
179
|
-
5. **Load file secara smart** - hanya bagian yang diperlukan
|
|
335
|
+
1. Ensure write access to the context path
|
|
336
|
+
2. Try setting explicit `MCP_CONTEXT_PATH` in env
|
|
180
337
|
|
|
181
338
|
## License
|
|
182
339
|
|
|
183
340
|
MIT
|
|
341
|
+
|
|
342
|
+
## Contributing
|
|
343
|
+
|
|
344
|
+
Issues and PRs welcome at [GitHub](https://github.com/asd412id/mcp-context-manager)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asd412id/mcp-context-manager",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP tools for context management - summarizer, memory store, project tracker, checkpoints, and smart file loader",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|