Skip to main content
Glama
bwats
by bwats

LifeOS MCP

为任何 AI 智能体提供对你 LifeOS 知识库的只读访问权限 —— 适用于 Claude Desktop、Claude Code、Cursor、ChatGPT、Codex 或任何兼容 MCP 的客户端。

该服务器从 ~/lifeos/ 读取内容,并通过 lifeos:// 资源 URI 和 lifeos__* 工具名称呈现所有内容。


安装

发布后(即将推出)

npx lifeos-mcp

从源码安装(当前)

git clone https://github.com/bwats/lifeos-mcp
cd lifeos-mcp
npm install && npm run build
node bin/lifeos-mcp.js

从源码全局安装

cd ~/lifeos-mcp
npm install -g .
lifeos-mcp  # starts the MCP server on stdio

它暴露了什么

lifeos-mcp 为任何兼容 MCP 的 AI 客户端提供对以下内容的直接只读访问:

表面

~/lifeos/ 中的路径

工具

身份

identity.md

lifeos__get_identity

偏好

preferences.md

lifeos__get_preferences

技能

skills/*/

lifeos__list_skills, lifeos__read_skill

项目

projects/*.md

lifeos__list_projects, lifeos__read_project

维基

wiki/pages/**/*.md

lifeos__list_wiki_pages, lifeos__read_wiki_page

规则

system/*.md

lifeos__list_rules, lifeos__read_rule

任意文件

(路径安全)

lifeos__read_file

搜索

(全文)

lifeos__search


模式

调用

发生什么

lifeos-mcp

在 stdio 上启动 MCP 服务器(默认)

lifeos-mcp --stdio

在 stdio 上启动 MCP 服务器(显式)

lifeos-mcp list

列出 ~/lifeos/cadence/rituals/ 中的仪式

lifeos-mcp validate <ritual.md>

验证仪式规范文件

lifeos-mcp render <ritual.md> --to <harness>

将仪式渲染到目标工具中

lifeos-mcp --help

显示所有子命令和选项


配置 MCP 客户端

Claude Desktop

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "lifeos": {
      "command": "npx",
      "args": ["lifeos-mcp"]
    }
  }
}

或者从源码安装:

{
  "mcpServers": {
    "lifeos": {
      "command": "node",
      "args": ["/Users/yourname/lifeos-mcp/bin/lifeos-mcp.js"]
    }
  }
}

Cursor (settings.json)

{
  "mcpServers": {
    "lifeos": {
      "command": "node",
      "args": ["/Users/yourname/lifeos-mcp/bin/lifeos-mcp.js"]
    }
  }
}

Claude Code (~/.claude/settings.json)

{
  "mcpServers": {
    "lifeos": {
      "command": "node",
      "args": ["/Users/yourname/lifeos-mcp/bin/lifeos-mcp.js"]
    }
  }
}

OpenAI Codex (codex.json)

{
  "mcpServers": {
    "lifeos": {
      "command": "node",
      "args": ["/Users/yourname/lifeos-mcp/bin/lifeos-mcp.js"]
    }
  }
}

自定义 LifeOS 路径

传递 --lifeos-path 或设置 LIFEOS_PATH 环境变量:

{
  "mcpServers": {
    "lifeos": {
      "command": "node",
      "args": [
        "/Users/yourname/lifeos-mcp/bin/lifeos-mcp.js",
        "--lifeos-path", "/custom/path/to/lifeos"
      ]
    }
  }
}

环境变量

变量

默认值

描述

LIFEOS_PATH

~/lifeos

LifeOS 根目录的绝对路径


工具

工具

描述

lifeos__health

检查服务器健康状况和 LifeOS 可用性

lifeos__get_identity

读取 identity.md — 前置元数据 + 正文

lifeos__get_preferences

读取 preferences.md — 前置元数据 + 正文

lifeos__list_skills

列出 ~/lifeos/skills/ 中的所有技能目录名称

lifeos__read_skill

读取指定技能的文档

lifeos__list_rules

列出 ~/lifeos/system/ 中的规则/指南名称

lifeos__read_rule

读取特定的规则文件

lifeos__list_projects

列出 ~/lifeos/projects/ 中的项目文件名

lifeos__read_project

读取特定的项目定义

lifeos__list_wiki_pages

递归列出所有维基页面路径

lifeos__read_wiki_page

按路径读取维基页面

lifeos__search

对所有 LifeOS 文件进行全文搜索

lifeos__read_file

通过相对路径读取 ~/lifeos/ 下的任何文件(路径遍历安全)

lifeos__propose_edge

在两个知识节点之间提出类型化的语义边

lifeos__accept_edge

接受提议的边(需要写入许可)

lifeos__reject_edge

拒绝提议的边(需要写入许可)

lifeos__read_pending_queue

列出待处理的边提议(始终只读)


资源

URI

描述

lifeos://identity

LifeOS 身份配置文件 (identity.md)

lifeos://preferences

用户偏好设置 (preferences.md)

lifeos://skills/{name}

~/lifeos/skills/{name}/ 的技能文档

lifeos://projects/{name}

~/lifeos/projects/{name}.md 的项目定义

lifeos://wiki/{+path}

~/lifeos/wiki/pages/{path}.md 的维基页面

lifeos://rules/{name}

~/lifeos/system/{name}.md 的系统规则

所有模板资源都支持列表查询 — 客户端可以枚举可用资源。


CLI 子命令

# List all rituals with id, title, and trigger summary
lifeos-mcp list

# Validate a ritual spec (structural check)
lifeos-mcp validate ~/lifeos/cadence/rituals/morning-review.md

# Render a ritual to a harness
lifeos-mcp render ~/lifeos/cadence/rituals/morning-review.md --to openclaw
lifeos-mcp render ~/lifeos/cadence/rituals/morning-review.md --to claude-code

渲染器接口(可插拔)

第三方渲染器通过 registerRenderer 在运行时插入:

import { registerRenderer } from "lifeos-mcp/dist/renderers/index.js";

registerRenderer({
  name: "my-harness",
  async render(spec, body, ctx) {
    return {
      files: [{ path: "/out/job.json", content: JSON.stringify(spec) }],
      summary: `Rendered ${spec.id} to my-harness`,
    };
  },
});

内置渲染器:openclaw (cron 任务 JSON), claude-code (斜杠命令 + launchd plist)。


安全性

  • 所有文件路径都经过验证,确保在 LifeOS 根目录内 — 不可能发生路径遍历。

  • 服务器默认只读;写入工具 (lifeos__propose_edge, lifeos__accept_edge, lifeos__reject_edge) 需要通过 ~/Library/Application Support/LifeOS/mcp-write-config.json 显式许可。

  • 仅可访问 ~/lifeos/ (或 LIFEOS_PATH) 下的文件。


构建

cd ~/lifeos-mcp
npm install
npm run build
# Output: dist/ + bin/lifeos-mcp.js

许可证

MIT

Install Server
F
license - not found
A
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bwats/lifeos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server