#!/usr/bin/env node
import { existsSync, mkdirSync, writeFileSync } from 'fs';
import { join } from 'path';
import { homedir } from 'os';
console.log('π Work Memory MCP Server μ€μΉλ₯Ό μλ£νμ΅λλ€!');
// κΈ°λ³Έ λ°μ΄ν° λλ ν 리 μμ±
const defaultDataDir = join(homedir(), '.work-memory');
try {
if (!existsSync(defaultDataDir)) {
mkdirSync(defaultDataDir, { recursive: true });
console.log(`π κΈ°λ³Έ λ°μ΄ν° λλ ν 리 μμ±: ${defaultDataDir}`);
}
// κΈ°λ³Έ λλ ν 리 ꡬ쑰 μμ±
const subdirs = [
'history/changes',
'history/versions',
'cache',
'backups',
'logs'
];
subdirs.forEach(subdir => {
const fullPath = join(defaultDataDir, subdir);
if (!existsSync(fullPath)) {
mkdirSync(fullPath, { recursive: true });
}
});
// κΈ°λ³Έ μ€μ νμΌ μμ±
const configPath = join(defaultDataDir, 'config.json');
if (!existsSync(configPath)) {
const defaultConfig = {
dataDir: defaultDataDir,
logLevel: 'INFO',
maxMemorySize: 1048576,
cacheTTL: 300,
backupInterval: 60,
indexRebuildThreshold: 1000
};
writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2));
console.log(`βοΈ κΈ°λ³Έ μ€μ νμΌ μμ±: ${configPath}`);
}
} catch (error) {
console.warn('β οΈ μ΄κΈ° μ€μ μ€ μΌλΆ μ€λ₯κ° λ°μνμ΅λλ€:', error.message);
console.log('π‘ μλμΌλ‘ μ€μ νλ €λ©΄ work-memory-mcp --setupμ μ€ννμΈμ.');
}
console.log(`
π λ€μ λ¨κ³:
1. MCP μλ² μ€μ :
- Cursor: ~/.cursor/mcp.json λλ .cursor/mcp.json
- Claude: ~/.config/claude-desktop/claude_desktop_config.json
2. μ€μ μμ:
{
"mcpServers": {
"work-memory": {
"command": "work-memory-mcp"
}
}
}
3. μλ² μμ:
work-memory-mcp
4. λμλ§:
work-memory-mcp --help
π λ μμΈν μ€λͺ
: https://github.com/your-repo/work-memory-mcp/blob/main/docs/INSTALLATION.md
`);