Boomerang Wellbeing Planner

Boomerang Wellbeing Planner

Generates personalised 12-week wellbeing planners for Australian near-retirees, integrating ABS statistics and providing an interactive journey visualization.

Category
访问服务器

README

Boomerang Wellbeing Planner — MCP Server

A Node.js MCP (Model Context Protocol) server that generates personalised 12-week wellbeing planners for Australian near-retirees. It exposes a single MCP tool over Streamable HTTP (so it is reachable over a network URL from clients like ServiceNow), calls the Anthropic API to generate the plan content, and serves an interactive "journey path" visualisation of each plan.

What it does

  1. An MCP client calls the generate_wellbeing_plan tool with a free-text wellbeing concern.
  2. The server asks Claude (default model: claude-sonnet-5) for a 12-week, milestone-based plan, grounded in ABS statistics about loneliness and community participation among older Australians. The response is schema-constrained, parsed, and validated. The plan never contains medical or clinical advice — sensitive topics are framed as "worth discussing with a GP or counsellor".
  3. The plan is stored (in-memory + a simple JSON file, no database) and rendered as a warm, calm HTML journey: one node per week on a connected path, colour-coded by responsible agent (wellbeing = rose, connection = blue), with a circular progress ring showing the overall wellbeing score.
  4. The tool returns both the raw JSON plan and a view_url to that page.

Everything runs on one server / one port: POST /mcp (MCP endpoint) and GET /plans/:plan_id (viewer).

Setting the ANTHROPIC_API_KEY secret in Replit

  1. Open the Repl and click Tools → Secrets (padlock icon).
  2. Add a secret with key ANTHROPIC_API_KEY and your key from console.anthropic.com as the value.
  3. Click Run. Replit installs dependencies on boot and starts the server on $PORT.

Optional secrets: ANTHROPIC_MODEL (defaults to claude-sonnet-5) and BASE_URL (auto-detected on Replit). For local development, copy .env.example to .env.

MCP tool schema

Tool: generate_wellbeing_plan

Input:

Field Type Required Description
user_query string yes The user's free-text wellbeing concern
emotional_state string no e.g. "lonely", "anxious", "low motivation"
age_bracket string no e.g. "65-70"

Output (returned as JSON text content):

{
  "plan": {
    "plan_id": "<uuid>",
    "generated_at": "<iso datetime>",
    "overall_wellbeing_score": 62,
    "weeks": [
      {
        "week_offset": 0,
        "theme": "Gentle first steps",
        "milestones": [
          {
            "title": "Take a 20-minute morning walk twice this week",
            "target_date": "Week 1",
            "owner": "retiree",
            "agent_responsible": "wellbeing",
            "confidence": 0.85
          }
        ]
      }
    ]
  },
  "view_url": "https://<repl-domain>/plans/<plan_id>"
}

weeks covers offsets 0–11, with a check-in week every 3 weeks. owner is "retiree" or "agent"; agent_responsible is "wellbeing" or "connection"; confidence is 0.00–1.00.

Testing it manually

With curl

The MCP Streamable HTTP transport takes JSON-RPC over POST. Call the tool directly:

curl -s -X POST "http://localhost:3000/mcp" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "generate_wellbeing_plan",
      "arguments": {
        "user_query": "I retire in 6 months and I am worried I will feel lonely and aimless",
        "emotional_state": "anxious",
        "age_bracket": "65-70"
      }
    }
  }'

(Replace http://localhost:3000 with your Repl URL.) List the available tools with "method": "tools/list", "params": {}. The response includes the plan JSON and the view_url — open it in a browser to see the interactive journey.

With MCP Inspector

npx @modelcontextprotocol/inspector

Choose transport Streamable HTTP, enter https://<your-repl>/mcp, connect, and run generate_wellbeing_plan from the Tools tab.

REST endpoint: render a plan as a PNG

POST /render-plan-image takes a plan JSON (the same weeks[] schema shown above) and renders it server-side to a PNG using node-canvas — no headless browser involved.

Response: { "image_base64": "<png bytes as base64>", "content_type": "image/png" }. Returns 400 with a clear message if weeks is missing. The canvas is 900px wide with a 1400px minimum height, growing taller if the plan's milestones need the room.

curl -s -X POST "http://localhost:3000/render-plan-image" \
  -H "Content-Type: application/json" \
  -d @plan.json | node -e "
    let d=''; process.stdin.on('data',c=>d+=c).on('end',()=>{
      require('fs').writeFileSync('plan.png', Buffer.from(JSON.parse(d).image_base64,'base64'));
      console.log('wrote plan.png');
    })"

Dependency note: the canvas package is an optional dependency (its prebuilt binary installs cleanly on Replit/Linux). On platforms where it can't build, the server falls back to the API-compatible @napi-rs/canvas automatically.

Local development

npm install
cp .env.example .env   # add your ANTHROPIC_API_KEY
npm start              # http://localhost:3000

Project layout

server.js            Express app: /mcp (Streamable HTTP, stateless) + /plans/:id viewer
src/generatePlan.js  Anthropic API call, schema-constrained output, validation
src/renderPlan.js    Self-contained HTML journey-path renderer
src/planStore.js     In-memory store persisted to data/plans.json
.replit / replit.nix Replit run + environment config

Note: This project provides general lifestyle planning only — never medical or psychological advice.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选