Lifeos

io.github.edrisranjbar由 GitHub 账号 edrisranjbar 发布v2.0.0更新于 Oct 24, 2026

Self-hosted life OS: habits, goals, tasks, finances and notes over a token-protected API.

已验证STDIO仅桌面效率与工作流金融

概览

AI 生成的概览

本地 stdio MCP 服务器,让助手通过受令牌保护的 API 读写自建 LifeOS 中的目标、任务、习惯、财务、笔记与记事本。

可以做什么
  • 通过一个只读查询工具读取仪表盘、目标、任务、习惯、今日习惯、财务汇总、支出、收入、笔记与记事本文档
  • 创建、更新和删除目标、任务与笔记,并完成或取消完成任务和习惯
  • 以托曼为单位记录支出和设置收入,可按周期筛选
  • 创建、更新和删除记事本文档,正文支持 markdown 或 HTML
  • 写入前可用来源、目标与看板筛选条件消除任务和目标 ID 的歧义
适用场景
适合自建 LifeOS 并希望助手查看仪表盘、规划目标与任务、打卡习惯、记录支出或起草笔记,而不必打开网页界面的场景。它不是托管服务,没有可访问的 LifeOS API 就无法使用。
运行要求
需要 Node.js 22.9 或更高版本(推荐 24)在本地以 stdio 运行 npm 包 @edicodes/lifeos-mcp。需要已部署的 LifeOS API 及其 /api/v1 接口,并设置 LIFEOS_BASE_URL(HTTPS,开发时可用 32 字符专用 LIFEOS_API_TOKEN。LIFEOS_MCP_TIMEOUT_MS 为可选项。不提供远程 MCP 地址。
安装前请注意
API 令牌属于机密,不要写入提交的客户端配置,建议通过环境变量转发。删除会永久移除目标、任务、笔记和记事本文档,并被标记为破坏性操作,是否确认取决于客户端。机密笔记默认隐藏,除非请求 include_secret 且服务端允许。超时可能发生在写入已提交之后,重试创建或记录支出前应先检查已保存状态。返回的 HTML 应视为数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Lifeos,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

LifeOS MCP server

Local stdio server using the official MCP SDK, Node 22.9+ (24 recommended) and Zod validation. All tools call LifeOS /api/v1 over HTTP. No SQL, filesystem, arbitrary state-key, config or credential-management tools are exposed.

Install and run

sh
cd mcpnpm cicp .env.example .envnpm start

Set the ignored .env:

dotenv
LIFEOS_BASE_URL=https://lifeos.example.comLIFEOS_API_TOKEN=replace-with-your-dedicated-random-tokenLIFEOS_MCP_TIMEOUT_MS=10000

Use the same dedicated token configured in PHP (at least 32 characters; generate 32 random bytes). Install the API first. Remote origins require verified HTTPS; HTTP is permitted only for localhost/127.0.0.1/::1 development. URL credentials, query strings and subpaths are rejected. Redirects are rejected to prevent forwarding credentials. Timeout covers response parsing and must be 100–120000 ms. Stdout contains only protocol messages; startup/errors do not log tokens or upstream response bodies.

npm start loads .env from mcp. Clients that launch node src/index.js directly must supply environment values. Do not commit real client configs or tokens.

Client configuration

The server is published on npm as @edicodes/lifeos-mcp and listed in the MCP Registry as io.github.edrisranjbar/lifeos, so clients can run it without cloning the repo:

json
{  "mcpServers": {    "lifeos": {      "command": "npx",      "args": ["-y", "@edicodes/lifeos-mcp"],      "env": {        "LIFEOS_BASE_URL": "https://lifeos.example.com",        "LIFEOS_API_TOKEN": "replace-with-your-dedicated-random-token"      }    }  }}

To run your own checkout instead, point the client at src/index.js:

json
{  "mcpServers": {    "lifeos": {      "command": "node",      "args": ["/absolute/path/lifeos/mcp/src/index.js"],      "env": {        "LIFEOS_BASE_URL": "https://lifeos.example.com",        "LIFEOS_API_TOKEN": "replace-with-your-dedicated-random-token"      }    }  }}

For Codex, set the token in its launch environment and forward it in user ~/.codex/config.toml, following the official OpenAI documentation:

toml
[mcp_servers.lifeos]command = "node"args = ["/absolute/path/lifeos/mcp/src/index.js"]env_vars = ["LIFEOS_API_TOKEN"]
[mcp_servers.lifeos.env]LIFEOS_BASE_URL = "https://lifeos.example.com"LIFEOS_MCP_TIMEOUT_MS = "10000"

Use actual absolute paths. No client configuration is installed automatically. This implementation is stdio only; clients requiring a remote MCP URL need a separate authenticated transport bridge/server. /api/v1 is not an MCP transport URL.

Tools

DomainTools
Read anythinglifeos_query
Goalslifeos_create_goal, lifeos_update_goal, lifeos_delete_goal
Taskslifeos_create_task, lifeos_update_task, lifeos_complete_task, lifeos_delete_task
Habitslifeos_complete_habit, lifeos_uncomplete_habit
Financelifeos_log_expense, lifeos_set_income
Noteslifeos_create_note, lifeos_update_note, lifeos_delete_note

All reads go through the read-only lifeos_query tool. Its type picks what to read: dashboard, goals, goal, tasks, task, habits, today_habits, finance_summary, expenses, incomes, notes or note. goal, task and note require id. tasks takes optional source, goal_id, board_id and column_id filters; task takes source, goal_id and board_id to resolve ambiguous IDs. finance_summary, expenses and incomes take an optional period. notes and note take include_secret. Parameters that don't apply to the chosen type are rejected before any request is made. Writes stay as separate tools, so each one gets its own approval prompt and destructive ones stay marked.

Upgrading from 1.x: version 2.0.0 replaces the 12 read tools (lifeos_dashboard, lifeos_list_goals, lifeos_get_goal, lifeos_list_tasks, lifeos_get_task, lifeos_list_habits, lifeos_get_today_habits, lifeos_finance_summary, lifeos_list_expenses, lifeos_list_incomes, lifeos_list_notes, lifeos_get_note) with lifeos_query. For example, lifeos_get_goal with { id } becomes lifeos_query with { type: "goal", id }. Clients that call the old names directly need updating; clients that discover tools at startup only need a restart.

Updates take id and a patch object. Goal measures/tasks supplied in a patch replace their lists; omitted fields survive. Task creation requires source and container IDs. Task update/complete/delete optionally take source/container filters to resolve ambiguous IDs; query tasks first to obtain IDs. Finance amounts are Toman; period defaults to active. Habit dates default to Tehran today. Completion/uncompletion/set-income are idempotent. Deletes permanently remove data and are explicitly marked destructive; approval behavior is controlled by the client.

Secret notes are omitted by default, including direct lookup. Explicit include_secret: true on a notes/note query or on update/delete requires server permission. Dashboard never includes secrets. No tool returns the token. Success returns concise JSON text and structured {data: ...}; failures have isError: true and safe code/message/status.

Example prompts:

  • Show me my LifeOS dashboard.
  • Create a SMART goal called Build dream home studio, due in three months.
  • Add Buy acoustic panels as a task to that goal.
  • Mark Reading complete for today.
  • Log a 450,000 Toman food expense.
  • Show my current financial balance.
  • Create a note called Studio Ideas.

Reload the browser after external edits. Stale UI saves return conflicts instead of replacing API changes. A network timeout can happen after a write commits; inspect saved state before retrying non-idempotent create/expense calls.

Tests

sh
npm test

Mocked errors/timeouts/malformed responses, schemas and a real stdio handshake run by default. For disposable MySQL/API integration, follow the root README and set LIFEOS_TEST_BASE_URL=http://localhost:8000. Integration refuses remote hosts and requires tests/mysql_fixture.php; it never loads production config.

Notepad

Read via lifeos_query types notepad_documents (list) and notepad_document (id). Write via lifeos_create_notepad_document, lifeos_update_notepad_document (id, patch), and lifeos_delete_notepad_document (id). Fields: title, body, format (markdown/html). Body replaces the source; omitted fields are preserved. Treat returned HTML as data. Reconnect the MCP client after updating its server.

来源:mcp/README.md,提交 5dc08c2

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v2.0.0最新Oct 10, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分