chron-mcp 0.1.8 → 0.1.10
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/dist/index.js +23 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,9 +35,31 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
38
|
+
const os_1 = require("os");
|
|
39
|
+
const path_1 = require("path");
|
|
38
40
|
const index_1 = require("./db/index");
|
|
39
41
|
const server_1 = require("./server");
|
|
42
|
+
const VERSION = '0.1.10';
|
|
43
|
+
// --version: quick install check, safe to run anywhere
|
|
44
|
+
if (process.argv[2] === '--version' || process.argv[2] === '-v') {
|
|
45
|
+
process.stdout.write(`chron-mcp ${VERSION}\n`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
40
48
|
async function main() {
|
|
49
|
+
const dbPath = process.env.CHRON_DB_PATH ?? (0, path_1.join)((0, os_1.homedir)(), '.chron', 'chron.db');
|
|
50
|
+
// Running interactively in a terminal — not from an MCP client
|
|
51
|
+
if (process.stdin.isTTY) {
|
|
52
|
+
process.stdout.write(`chron-mcp ${VERSION} ✓\n`);
|
|
53
|
+
process.stdout.write(`database: ${dbPath}\n\n`);
|
|
54
|
+
process.stdout.write(`Installation verified. Add to your MCP config:\n\n`);
|
|
55
|
+
process.stdout.write(` Claude Code: claude mcp add chron -- npx -y chron-mcp\n`);
|
|
56
|
+
process.stdout.write(` Claude Desktop: add to claude_desktop_config.json\n`);
|
|
57
|
+
process.stdout.write(` Cursor: add to ~/.cursor/mcp.json\n\n`);
|
|
58
|
+
process.stdout.write(`See README: https://github.com/SirinivasK/chron\n`);
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
process.stderr.write(`chron-mcp ${VERSION} starting\n`);
|
|
62
|
+
process.stderr.write(`database: ${dbPath}\n`);
|
|
41
63
|
const db = await (0, index_1.initDb)();
|
|
42
64
|
const server = (0, server_1.createServer)(db);
|
|
43
65
|
if (process.env.CHRON_TRANSPORT === 'http') {
|
|
@@ -47,6 +69,7 @@ async function main() {
|
|
|
47
69
|
else {
|
|
48
70
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
49
71
|
await server.connect(transport);
|
|
72
|
+
process.stderr.write('ready\n');
|
|
50
73
|
}
|
|
51
74
|
}
|
|
52
75
|
main().catch((err) => {
|