claude-recall 0.2.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/LICENSE +21 -0
- package/README.md +211 -0
- package/dist/cli/claude-recall-cli.js +345 -0
- package/dist/cli/commands/migrate.js +245 -0
- package/dist/core/pattern-detector.js +242 -0
- package/dist/core/patterns.js +56 -0
- package/dist/core/retrieval.js +108 -0
- package/dist/mcp/rate-limiter.js +114 -0
- package/dist/mcp/server.js +283 -0
- package/dist/mcp/session-manager.js +161 -0
- package/dist/mcp/tools/memory-tools.js +358 -0
- package/dist/mcp/transports/stdio.js +246 -0
- package/dist/memory/pattern-store.js +66 -0
- package/dist/memory/schema.sql +24 -0
- package/dist/memory/storage.js +274 -0
- package/dist/services/action-pattern-detector.js +251 -0
- package/dist/services/claude-json-watcher.js +243 -0
- package/dist/services/config.js +149 -0
- package/dist/services/database-manager.js +332 -0
- package/dist/services/logging.js +124 -0
- package/dist/services/memory-enhancer.js +148 -0
- package/dist/services/memory.js +334 -0
- package/dist/services/pattern-service.js +172 -0
- package/dist/services/preference-extractor.js +286 -0
- package/dist/services/semantic-preference-extractor.js +432 -0
- package/docs/MCP_API_REFERENCE.md +257 -0
- package/docs/MCP_USER_GUIDE.md +115 -0
- package/docs/release-process.md +86 -0
- package/package.json +89 -0
- package/scripts/postinstall.js +76 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Claude Recall MCP Server User Guide
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
### Global Installation (Recommended)
|
|
6
|
+
```bash
|
|
7
|
+
npm install -g claude-recall
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Local Installation
|
|
11
|
+
```bash
|
|
12
|
+
npm install claude-recall
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Adding to Claude Code
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# For global installation
|
|
19
|
+
claude mcp add claude-recall claude-recall mcp start
|
|
20
|
+
|
|
21
|
+
# For local installation
|
|
22
|
+
claude mcp add claude-recall npx claude-recall mcp start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Available Tools
|
|
26
|
+
|
|
27
|
+
### 1. Store Memory
|
|
28
|
+
**Tool**: `mcp__claude-recall__store_memory`
|
|
29
|
+
**Purpose**: Save important information for future recall
|
|
30
|
+
|
|
31
|
+
Example:
|
|
32
|
+
```
|
|
33
|
+
Store this memory: The user prefers TypeScript over JavaScript for all new projects
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Search Memories
|
|
37
|
+
**Tool**: `mcp__claude-recall__search`
|
|
38
|
+
**Purpose**: Find previously stored information
|
|
39
|
+
|
|
40
|
+
Example:
|
|
41
|
+
```
|
|
42
|
+
Search my memories for: TypeScript preferences
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. Retrieve Memory
|
|
46
|
+
**Tool**: `mcp__claude-recall__retrieve_memory`
|
|
47
|
+
**Purpose**: Get specific memories by ID or recent memories
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
```
|
|
51
|
+
Retrieve my recent memories about coding preferences
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 4. Get Statistics
|
|
55
|
+
**Tool**: `mcp__claude-recall__get_stats`
|
|
56
|
+
**Purpose**: View memory usage statistics
|
|
57
|
+
|
|
58
|
+
Example:
|
|
59
|
+
```
|
|
60
|
+
Show me my Claude Recall statistics
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 5. Clear Context
|
|
64
|
+
**Tool**: `mcp__claude-recall__clear_context`
|
|
65
|
+
**Purpose**: Clear session-specific context
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
```
|
|
69
|
+
Clear my current Claude Recall context (confirm: true)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Memory Persistence
|
|
73
|
+
|
|
74
|
+
- Memories are stored in a local SQLite database
|
|
75
|
+
- Sessions persist across Claude Code restarts
|
|
76
|
+
- Database location: `~/.claude-recall/claude-recall.db`
|
|
77
|
+
- Session data: `~/.claude-recall/sessions.json`
|
|
78
|
+
|
|
79
|
+
## Troubleshooting
|
|
80
|
+
|
|
81
|
+
### MCP Server Not Starting
|
|
82
|
+
1. Check Claude Code logs: `~/.claude-code/logs/`
|
|
83
|
+
2. Test manually: `claude-recall mcp start`
|
|
84
|
+
3. Verify installation: `which claude-recall`
|
|
85
|
+
|
|
86
|
+
### Memories Not Persisting
|
|
87
|
+
1. Check database permissions: `ls -la ~/.claude-recall/`
|
|
88
|
+
2. Verify disk space: `df -h`
|
|
89
|
+
3. Check logs for errors
|
|
90
|
+
|
|
91
|
+
### Rate Limiting
|
|
92
|
+
- Default: 100 requests per minute per session
|
|
93
|
+
- If rate limited, wait 60 seconds
|
|
94
|
+
- Check current usage with health endpoint
|
|
95
|
+
|
|
96
|
+
## Advanced Configuration
|
|
97
|
+
|
|
98
|
+
### Environment Variables
|
|
99
|
+
- `CLAUDE_RECALL_DB_PATH`: Custom database location
|
|
100
|
+
- `CLAUDE_RECALL_LOG_LEVEL`: Set to 'debug' for verbose logging
|
|
101
|
+
- `CLAUDE_RECALL_RATE_LIMIT`: Custom rate limit (default: 100)
|
|
102
|
+
|
|
103
|
+
### Debug Mode
|
|
104
|
+
```bash
|
|
105
|
+
# Run with debug logging
|
|
106
|
+
NODE_ENV=development DEBUG=claude-recall:* claude-recall mcp start
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Migration from File Watcher
|
|
110
|
+
|
|
111
|
+
If you were using the old file watcher version:
|
|
112
|
+
1. Export your memories: `claude-recall export`
|
|
113
|
+
2. Install new version: `npm install -g claude-recall@latest`
|
|
114
|
+
3. Add MCP server: `claude mcp add claude-recall claude-recall mcp start`
|
|
115
|
+
4. Import memories: `claude-recall import memories.json`
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Release Process for Claude Recall
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This document outlines the process for creating public releases from the private development repository.
|
|
5
|
+
|
|
6
|
+
## Repository Structure
|
|
7
|
+
- **Private**: `claude-recall-dev` - All development work
|
|
8
|
+
- **Public**: `claude-recall` - Clean, public releases only
|
|
9
|
+
|
|
10
|
+
## Release Steps
|
|
11
|
+
|
|
12
|
+
### 1. Prepare Release Branch
|
|
13
|
+
```bash
|
|
14
|
+
# From main branch with all features ready
|
|
15
|
+
git checkout main
|
|
16
|
+
git checkout -b release/vX.Y.Z
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Clean Development Files
|
|
20
|
+
The following are automatically excluded by .gitignore-dev:
|
|
21
|
+
- `test-*.{ts,js,sh,md}` files
|
|
22
|
+
- `demo-*.ts` and `debug-*.ts` files
|
|
23
|
+
- Log files and test artifacts
|
|
24
|
+
- Test directories (test-final/, tests-arlo/, etc.)
|
|
25
|
+
|
|
26
|
+
Additional manual cleanup:
|
|
27
|
+
- Remove internal documentation (STAGE*.md, task-phase-*.md)
|
|
28
|
+
- Remove swarm-tasks/ directory
|
|
29
|
+
- Remove .claude-flow/ directory
|
|
30
|
+
- Remove settings/ and config/ directories
|
|
31
|
+
- Remove any .example.json files
|
|
32
|
+
|
|
33
|
+
### 3. Update Public Files
|
|
34
|
+
```bash
|
|
35
|
+
# Copy public versions (keep these in a /public folder on main)
|
|
36
|
+
cp public/README-public.md README.md
|
|
37
|
+
cp public/.gitignore-public .gitignore
|
|
38
|
+
cp public/LICENSE LICENSE
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 4. Update Version
|
|
42
|
+
```bash
|
|
43
|
+
# Update package.json version
|
|
44
|
+
npm version patch/minor/major
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 5. Build and Test
|
|
48
|
+
```bash
|
|
49
|
+
npm run build
|
|
50
|
+
npm test
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 6. Commit Clean Version
|
|
54
|
+
```bash
|
|
55
|
+
git add -A
|
|
56
|
+
git commit -m "Release vX.Y.Z"
|
|
57
|
+
git tag vX.Y.Z
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 7. Push to Public Repository
|
|
61
|
+
```bash
|
|
62
|
+
# Add public remote if not already added
|
|
63
|
+
git remote add public https://github.com/raoulbia-ai/claude-recall.git
|
|
64
|
+
|
|
65
|
+
# Push release branch to public main
|
|
66
|
+
git push public release/vX.Y.Z:main --force
|
|
67
|
+
git push public vX.Y.Z # Push tag
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 8. Create GitHub Release
|
|
71
|
+
1. Go to https://github.com/raoulbia-ai/claude-recall/releases
|
|
72
|
+
2. Click "Create a new release"
|
|
73
|
+
3. Select the version tag
|
|
74
|
+
4. Add release notes
|
|
75
|
+
5. Publish release
|
|
76
|
+
|
|
77
|
+
### 9. Publish to NPM (optional)
|
|
78
|
+
```bash
|
|
79
|
+
npm publish
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Important Notes
|
|
83
|
+
- NEVER push development branches to public repo
|
|
84
|
+
- Always test the clean build before pushing
|
|
85
|
+
- Keep public README focused on users, not developers
|
|
86
|
+
- Maintain version consistency across package.json and git tags
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-recall",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server for persistent memory in Claude Code conversations",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"claude-recall": "dist/cli/claude-recall-cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"scripts/postinstall.js",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"docs/"
|
|
15
|
+
],
|
|
16
|
+
"directories": {
|
|
17
|
+
"doc": "docs",
|
|
18
|
+
"test": "tests"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"postinstall": "node scripts/postinstall.js || true",
|
|
22
|
+
"test": "jest --passWithNoTests",
|
|
23
|
+
"test:watch": "jest --watch",
|
|
24
|
+
"build": "tsc && mkdir -p dist/memory && cp src/memory/schema.sql dist/memory/ && chmod +x dist/cli/claude-recall-cli.js",
|
|
25
|
+
"build:cli": "tsc && chmod +x dist/cli/claude-recall-cli.js",
|
|
26
|
+
"dev": "ts-node",
|
|
27
|
+
"start": "ts-node src/server.ts",
|
|
28
|
+
"start:dev": "nodemon --exec ts-node src/server.ts",
|
|
29
|
+
"claude-recall": "ts-node src/cli/claude-recall-cli.ts",
|
|
30
|
+
"install:global": "npm run build && npm link",
|
|
31
|
+
"stats": "npm run claude-recall stats",
|
|
32
|
+
"search": "npm run claude-recall search",
|
|
33
|
+
"migrate:service-layer": "ts-node migrate-to-service-layer.ts",
|
|
34
|
+
"rollback:service-layer": "ts-node -e \"require('./migrate-to-service-layer').ServiceLayerMigration.rollback()\"",
|
|
35
|
+
"preuninstall": "node scripts/uninstall.js",
|
|
36
|
+
"prepare": "npm run build",
|
|
37
|
+
"mcp:start": "node dist/cli/claude-recall-cli.js mcp start",
|
|
38
|
+
"mcp:dev": "ts-node src/cli/claude-recall-cli.ts mcp start",
|
|
39
|
+
"mcp:debug": "NODE_ENV=development DEBUG=claude-recall:* ts-node src/cli/claude-recall-cli.ts mcp start",
|
|
40
|
+
"mcp:test": "echo '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{}}' | npm run mcp:start",
|
|
41
|
+
"mcp:health": "echo '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"health/check\",\"params\":{}}' | npm run mcp:start"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"claude-code",
|
|
45
|
+
"mcp",
|
|
46
|
+
"memory",
|
|
47
|
+
"ai",
|
|
48
|
+
"claude",
|
|
49
|
+
"anthropic",
|
|
50
|
+
"model-context-protocol"
|
|
51
|
+
],
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public",
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
55
|
+
},
|
|
56
|
+
"author": "Claude Recall Team",
|
|
57
|
+
"license": "ISC",
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=16.0.0"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "git+https://github.com/raoulbia-ai/claude-recall.git"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/raoulbia-ai/claude-recall#readme",
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/raoulbia-ai/claude-recall/issues"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@types/jest": "^30.0.0",
|
|
71
|
+
"@types/node": "^24.1.0",
|
|
72
|
+
"jest": "^30.0.5",
|
|
73
|
+
"ts-jest": "^29.4.1",
|
|
74
|
+
"ts-node": "^10.9.2",
|
|
75
|
+
"typescript": "^5.9.2"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@types/bcrypt": "^6.0.0",
|
|
79
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
80
|
+
"@types/express": "^5.0.3",
|
|
81
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
82
|
+
"bcrypt": "^6.0.0",
|
|
83
|
+
"better-sqlite3": "^12.2.0",
|
|
84
|
+
"chalk": "^5.5.0",
|
|
85
|
+
"commander": "^12.1.0",
|
|
86
|
+
"express": "^5.1.0",
|
|
87
|
+
"jsonwebtoken": "^9.0.2"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
console.log('\nš Setting up Claude Recall MCP server...\n');
|
|
8
|
+
|
|
9
|
+
// Find ~/.claude.json
|
|
10
|
+
const claudeConfigPath = path.join(os.homedir(), '.claude.json');
|
|
11
|
+
|
|
12
|
+
// Check if file exists
|
|
13
|
+
if (!fs.existsSync(claudeConfigPath)) {
|
|
14
|
+
console.log('ā Could not find ~/.claude.json');
|
|
15
|
+
console.log(' Please make sure Claude Code is installed and has been run at least once.');
|
|
16
|
+
console.log(' Then run: npm install -g claude-recall');
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
// Read current config
|
|
22
|
+
const configContent = fs.readFileSync(claudeConfigPath, 'utf8');
|
|
23
|
+
const config = JSON.parse(configContent);
|
|
24
|
+
|
|
25
|
+
// Ensure mcpServers exists
|
|
26
|
+
if (!config.mcpServers) {
|
|
27
|
+
config.mcpServers = {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Check if claude-recall already exists
|
|
31
|
+
if (config.mcpServers['claude-recall']) {
|
|
32
|
+
console.log('ā ļø Claude Recall is already configured in ~/.claude.json');
|
|
33
|
+
console.log(' Updating configuration...');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Set up database location in user's home directory
|
|
37
|
+
const dbDir = path.join(os.homedir(), '.claude-recall');
|
|
38
|
+
|
|
39
|
+
// Create directory if it doesn't exist
|
|
40
|
+
if (!fs.existsSync(dbDir)) {
|
|
41
|
+
fs.mkdirSync(dbDir, { recursive: true });
|
|
42
|
+
console.log(`š Created database directory: ${dbDir}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Add or update claude-recall configuration
|
|
46
|
+
config.mcpServers['claude-recall'] = {
|
|
47
|
+
type: 'stdio',
|
|
48
|
+
command: 'npx',
|
|
49
|
+
args: ['claude-recall', 'mcp', 'start'],
|
|
50
|
+
env: {
|
|
51
|
+
CLAUDE_RECALL_DB_PATH: dbDir,
|
|
52
|
+
CLAUDE_RECALL_DB_NAME: 'claude-recall.db'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Write back the config with proper formatting
|
|
57
|
+
fs.writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2));
|
|
58
|
+
|
|
59
|
+
console.log('ā
Successfully configured Claude Recall in ~/.claude.json');
|
|
60
|
+
console.log('\nš Next steps:');
|
|
61
|
+
console.log(' 1. Restart Claude Code if it\'s currently running');
|
|
62
|
+
console.log(' 2. Claude Recall will start automatically when you launch Claude Code');
|
|
63
|
+
console.log('\nš Installation complete!\n');
|
|
64
|
+
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error('ā Error updating ~/.claude.json:', error.message);
|
|
67
|
+
console.log('\nPlease manually add Claude Recall to your ~/.claude.json file:');
|
|
68
|
+
console.log(JSON.stringify({
|
|
69
|
+
"claude-recall": {
|
|
70
|
+
"type": "stdio",
|
|
71
|
+
"command": "npx",
|
|
72
|
+
"args": ["claude-recall", "mcp", "start"],
|
|
73
|
+
"env": {}
|
|
74
|
+
}
|
|
75
|
+
}, null, 2));
|
|
76
|
+
}
|