pilates_mcp

pilates_mcp

Local-first MCP server for Pilates centers that creates, searches, and reuses promotional poster HTML/CSS sources, records design feedback, and renders PNG/PDF artifacts with headless Chromium. It also includes a Schedule Workspace for managing group/private timetables and generating schedule posters.

Category
访问服务器

README

pilates_mcp

pilates_mcp is a local-first MCP server for Pilates center promotional posters. It creates editable HTML/CSS poster sources, stores them in a local archive, searches and reuses past posters, records design feedback, and can render PNG/PDF artifacts with headless Chromium.

Phase 1 deliberately does not store member names, phone numbers, schedules, health data, payment data, or other member personal information.

Project Structure

This repository was empty at implementation time, so the server is implemented as a TypeScript + Node.js MCP server.

src/
  server.ts        MCP stdio JSON-RPC transport and tool dispatch
  service.ts       poster workflow orchestration
  repository.ts    local poster archive search/read/write
  renderer.ts      Playwright PNG/PDF renderer
  templates.ts     HTML/CSS template layer
  feedback.ts      design feedback storage
  profile.ts       center profile storage
  themes.ts        design token presets
  types.ts         domain types
data/
  posters/YYYY/<poster-id>/
    poster.html
    poster.css
    metadata.json
    content.json
    preview.png    optional
    poster.pdf     optional
    revisions/     update backups
  feedback/
    global.json
    table.json
    standard.json
    poster-<poster-id>.json
  config/
    center-profile.json
  schedules/
    settings.json
    center-closures.json
    group/
      template.json
      group_schedule.xlsx
      revisions/
    private/
      template.json
      private_schedule.xlsx
      revisions/

Install

npm install
npx playwright install chromium

Development

npm run build
npm test
npm run dev

PILATES_MCP_DATA_DIR can point the archive to another local data directory. If unset, the server uses ./data.

Railway Deployment

Railway deployment is configured with railway.json and Dockerfile.

The production container uses the official Playwright image so Chromium runtime dependencies are available for PNG/PDF rendering. Railway starts npm run start:railway, which exposes:

  • GET /health: deployment healthcheck
  • GET /tools: MCP tool summary for deployment inspection
  • GET /schedule: lightweight Excel-style Schedule Workspace

The stdio MCP server remains available through npm run start for MCP clients that connect by command. The Railway health process is intentionally separate because stdio MCP does not expose an HTTP port.

For persistent local-first archive storage on Railway, mount a Railway volume at /data or set PILATES_MCP_DATA_DIR to another persistent path.

MCP Client Connection

Use the built server as a stdio MCP command:

{
  "mcpServers": {
    "pilates_mcp": {
      "command": "node",
      "args": ["G:/pilates_mcp/dist/src/server.js"],
      "env": {
        "PILATES_MCP_DATA_DIR": "G:/pilates_mcp/data"
      }
    }
  }
}

Tools

Poster tools:

  • get_center_profile
  • update_center_profile
  • search_posters
  • get_poster
  • create_poster
  • update_poster
  • reuse_poster_template
  • import_poster
  • render_poster
  • add_design_feedback
  • get_design_feedback
  • recommend_poster_style

Schedule tools:

  • get_schedule_settings
  • update_schedule_settings
  • inspect_schedule_file
  • import_schedule_file
  • create_schedule_template
  • get_schedule
  • generate_weekly_schedule
  • set_schedule_slot
  • clear_schedule_slot
  • find_available_slots
  • validate_schedule
  • add_center_closure
  • remove_center_closure
  • get_center_closures
  • save_schedule
  • export_schedule
  • create_schedule_poster

Poster Creation Flow

create_poster reads the center profile, applies center defaults, validates the PosterBrief, gathers relevant feedback, resolves the layout and theme, renders static HTML/CSS, writes metadata/content/source files, and optionally renders PNG/PDF.

The required order is:

user request
-> center profile defaults
-> PosterBrief
-> validation
-> ask only missing questions
-> past posters and feedback
-> HTML/CSS
-> optional render
-> archive save

Required poster brief decisions are validated before generation:

  • eventName
  • programSeparation
  • tablePreference
  • tableStyle when a table is required or provided
  • vatPolicy when price content exists

The server returns valid: false, missing, and Korean questions instead of guessing missing event names, VAT policy, or program separation.

programSeparation and tableStyle are separate decisions. For example, group/private products can use programSeparation: "table" with tableStyle: "split" to render separate GROUP/PRIVATE table blocks. tablePreference represents user intent; layout is the final renderer choice.

Center defaults can reduce repeated questions:

{
  "posterDefaults": {
    "programSeparation": "table",
    "tablePreference": "required",
    "tableStyle": "split",
    "vatPolicy": "excluded"
  }
}

Priority is: current request and PosterBrief, then center profile defaults, then a validation response asking the user for only missing values. VAT is never inferred.

Examples

8월 회원권 가격표 포스터 생성

{
  "title": "8월 회원권 이벤트",
  "purpose": "event",
  "brief": {
    "eventName": "8월 회원권 이벤트",
    "programCategories": ["private", "duet"],
    "programSeparation": "table",
    "tablePreference": "required",
    "tableStyle": "comparison",
    "vatPolicy": "excluded"
  },
  "content": {
    "subtitle": "이번 달 특별 혜택",
    "badge": "8월 EVENT",
    "table": {
      "columns": ["상품", "정상가", "이벤트가"],
      "rows": [
        ["1:1 개인레슨 10회", "800,000원", "650,000원"],
        ["듀엣레슨 10회", "500,000원", "390,000원"]
      ],
      "highlightColumn": 2
    },
    "footer": "선착순 마감"
  },
  "style": "premium",
  "render": { "png": true, "pdf": true, "size": "instagram-portrait" }
}

작년 9월 포스터 틀 재사용

{
  "sourcePosterId": "poster_20250901_ab12cd34",
  "title": "2026년 9월 신규회원 이벤트",
  "brief": {
    "eventName": "9월 신규회원 이벤트",
    "vatPolicy": "excluded"
  },
  "content": {
    "subtitle": "올해 가격으로 업데이트",
    "table": {
      "columns": ["상품", "정상가", "이벤트가"],
      "rows": [["1:1 개인레슨 10회", "820,000원", "670,000원"]],
      "highlightColumn": 2
    }
  }
}

최근 1년 기록 기반 스타일 추천

{
  "purpose": "event",
  "month": 9,
  "recentMonths": 12
}

Feedback

Feedback is stored in JSON files, not hard-coded. create_poster retrieves active global and layout-scoped feedback and includes it in the result as appliedFeedback.

Example:

{
  "scope": "table",
  "text": "이벤트가는 정상가보다 확실히 강조."
}

Rendering

render_poster uses Playwright Chromium with JavaScript disabled. Supported sizes:

  • instagram-portrait: 1080 x 1350
  • instagram-square: 1080 x 1080
  • story: 1080 x 1920
  • a4-portrait: A4 portrait

HTML/CSS are the source of truth. PNG/PDF are optional rendered artifacts.

Schedule Workspace

Phase 2 adds a local-first Schedule Workspace for Pilates group/private timetables. It is not a CRM. Private schedules may contain displayName only for grid display and operational placement.

Core model:

  • ScheduleSettings: week display, opening/closing time, default slot minutes, holiday option, locale, country code
  • ScheduleTemplate: explicit-save weekly group/private template
  • ScheduleSlot: neutral domain slot separate from Excel cells
  • ScheduleTemplateMapping: XLSX worksheet/header/time/day-column mapping
  • CenterClosure: center-specific closed dates, separate from national holidays

set_schedule_slot changes an in-memory dirty workspace. It is not persisted until save_schedule is called. export_schedule writes XLSX and backs up an existing XLSX before replacing it.

Existing XLSX files are handled by inspect_schedule_file and import_schedule_file. The importer captures worksheet name, used range, day columns, time column, column widths, row heights, and merges where available. Formulas are not executed.

Holiday handling is provider-based. Phase 2 includes a local provider with basic KR holiday fixtures and can be replaced later by an external provider without changing the domain model. Center closures have priority over public holidays, but occupied slots are not silently deleted; warnings are returned.

Railway serves a lightweight Excel-style workspace at /schedule with sticky headers, direct cell editing, delete/backspace, and visible save state. MCP remains the source of actual schedule operations.

Schedule Examples

Scenario A, create a new group timetable when no file exists:

{
  "scheduleType": "group",
  "settings": {
    "weekDisplay": "mon-sat",
    "openingTime": "09:00",
    "closingTime": "21:00",
    "defaultSlotMinutes": 60,
    "autoHolidayMarking": true,
    "locale": "ko-KR",
    "countryCode": "KR"
  }
}

Scenario B, import an existing Excel file and generate next week:

{ "filePath": "fixtures/group_schedule.xlsx", "scheduleType": "group" }
{
  "scheduleType": "group",
  "weekStart": "2026-10-05",
  "applyHolidays": true,
  "applyCenterClosures": true
}

Scenario C, private schedule operation:

{
  "scheduleType": "private",
  "dayOfWeek": "monday",
  "startTime": "19:00",
  "displayName": "김OO"
}

Scenario D, group schedule poster:

{
  "scheduleType": "group",
  "weekStart": "2026-10-05",
  "title": "9월 그룹레슨 시간표",
  "render": { "png": true, "pdf": true, "size": "instagram-portrait" }
}

Security And Privacy

The archive uses generated poster IDs and validates poster IDs before file access. Archive-relative imports are checked to block ../ traversal and root escape. Generated poster HTML is static, user text is HTML-escaped, and remote scripts are not part of the template. Rendering disables JavaScript.

Phase 1 excludes member management, reservations, payments, SMS, Instagram posting, StudioMate integration, external design scraping, image generation AI, cloud DB requirements, and SaaS authentication.

Phase 2 permits only displayName as person-related schedule display data. It does not create fields for phone, email, address, birth date, gender, health condition, medical history, payment, membership, consultation, attendance profile, or marketing consent. Names are not used for profiling, analytics, poster feedback, marketing, or recommendations.

Phase 2 still excludes StudioMate integration, StudioMate scraping, Chrome extension automation, member CRM, contact management, payment management, attendance analysis, member preference profiling, automatic booking confirmation, SMS, KakaoTalk, Instagram posting, payroll, settlement, and complex ERP features.

Extension Points

The service/repository split keeps room for future semantic search or another index. External design references can be added later behind a provider interface such as:

interface DesignReferenceProvider {
  search(query: string): Promise<DesignReference[]>;
}

Phase 1 does not implement scraping or copying external templates.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选