jrnl MCP服务器
 ](https://nodejs.org/)  
一种模型上下文协议(MCP)服务器,提供对jrnl(命令行日志)条目的只读访问。
架构文档 -系统设计和组件概述
先决条件
- Node.js 18或更高版本
- jrnl已安装并配置(
pip install jrnl)
安装
npm install
npm run build
npm link # Install globally as jrnl-mcp commandClaude桌面配置
将以下内容添加到您的Claude Desktop配置文件中:
macOS
地点: ~/Library/Application Support/Claude/claude_desktop_config.json
配置
{
"mcpServers": {
"jrnl": {
"command": "jrnl-mcp"
}
}
}注意:如果您是通过安装的 npm link,该命令将在全球范围内可用。 对于没有全局安装的本地开发,请使用:
{
"mcpServers": {
"jrnl": {
"command": "node",
"args": ["
/dist/index.js"]
}
}
}可用工具
- search_entrys -使用筛选器搜索日记条目
- list_tags -列出所有带有使用次数的标签
- get_统计 -获取日志统计信息
- 分析事件 -分析标签共现
- list_期刊 -列出可用期刊
- set_journal -切换到其他日记
发展
npm run format # Format code
npm run lint # Run linter
npm test # Run tests
npm run build # Build for production出版
此包使用GitHub Actions和npm Trusted Publishing(OIDC)进行自动发布。 不需要npm令牌!
初始设置(一次)
为此包配置npm可信发布:
- 首选https://www.npmjs.com/package/jrnl-mcp/access
- 点击“发布权限”或“受信任的发布者”
- 添加新的受信任发布者:
- 提供者:GitHub操作 - 存储库所有者:认真的 - 仓库名称:jrnl mcp - 工作流名称:publish.yml - 环境:(留空)
发布新版本
- 更新中的版本
package.json:
npm version patch # or minor, or major- 将版本提交和标签推送到GitHub:
git push && git push --tags- 在GitHub上创建新版本:
- 首选https://github.com/yostos/jrnl-mcp/releases - 点击“起草新版本” - 选择您刚才按下的标签 - 添加发行说明 - 点击“发布发布”
- GitHub操作将自动:
- 运行测试 - 构建包 - 发布到带有出处的npm(使用OIDC,不需要令牌!)
已发布的包将有证明它是从您的GitHub存储库构建的。
使用Claude Desktop进行测试
- 构建项目:
npm run build - 使用正确的路径更新您的Claude Desktop配置
- 重新启动克劳德桌面
- 让克劳德搜索你的日记条目进行测试
示例提示:
- “使用jrnl显示我上周的日记条目”
- “使用jrnl,我在日记中使用了哪些标签?”
- “你能用jrnl给我看我日记的统计数据吗?”
- “使用jrnl在我的日记条目中搜索标记为@work的条目”
