MCP 使用说明

RunYay MCP Guide

让支持 MCP 协议的 AI 直接读取你的跑步数据、制定训练计划并推送到手表。

Connect your AI assistant to RunYay — read running data, generate training plans, and push them straight to your watch.

什么是 MCP?

What is MCP?

MCP(Model Context Protocol)是 Anthropic 推出的开放标准协议,让 AI 助手能够安全地连接外部数据源和工具。

MCP (Model Context Protocol) is an open standard by Anthropic that lets AI assistants securely connect to external data sources and tools.

🚫
没有 MCP
Without MCP
你需要手动把跑步数据复制给 AI,再把 AI 生成的计划手动录入 App。
You copy running data to the AI manually, then paste AI-generated plans back into the app by hand.
有了跑鸭 MCP
With RunYay MCP
AI 直接读取你的跑步数据,直接写入训练计划,同步到手表——无需手动搬运。
AI reads your data directly, writes plans into RunYay, syncs to your watch — zero manual transfer.

MCP 服务地址

MCP Server URL

在 AI 工具的 MCP 设置中填入以下地址:

Enter this URL in your AI tool's MCP settings:

https://yayarun.cn/mcp

第一步:下载跑鸭 App

Step 1: Download RunYay

iOS & Android 下载
iOS & Android
扫码识别,自动跳转对应平台Scan to download on your platform

第二步:在 App 中开启连接

Step 2: Enable a Connection in RunYay

打开跑鸭 App → 设置连接与授权,选择以下任意一种连接方式:

Open RunYay → SettingsConnections & Authorization, then choose a method:

手动配置Manual
方式二:手动访问密钥
Method 2: API Key
适合无法打开浏览器的工具(本地 Agent、命令行等)。在 App 中生成密钥,填入配置文件。
Best for local agents and CLI tools that can't open a browser. Generate a key in the app, add it to your config.

方式二详细步骤

Method 2 — Step by Step

1
在「连接与授权」页点击「生成密钥」
Tap "Generate Key" in Connections & Authorization
输入连接名称、选择授权权限和有效期。
Enter a name, choose permissions, and set an expiration.
2
复制访问密钥
Copy the access key
密钥仅显示一次,请立即保存。
The key is shown only once — save it immediately.
3
填入 AI 工具配置
Add to your AI tool config
在 AI 工具的 MCP 配置中填入服务地址和密钥:
Add the server URL and your key to the MCP config:
{
  "mcpServers": {
    "runyay": {
      "url": "https://yayarun.cn/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ACCESS_KEY"
      }
    }
  }
}

每个账号最多创建 5 个手动访问密钥,可随时在 App 中吊销。

Each account supports up to 5 manual API keys. Revoke any key at any time in the app.

查看完整配置教程 Full Configuration Guide

支持的 AI 工具

Supported AI Tools

AI 工具AI Tool 推荐连接方式Recommended Method
Claude Desktop / claude.ai 方式一(OAuth)Method 1 (OAuth)
ChatGPT(支持 MCP 的版本)ChatGPT (MCP-enabled) 方式一(OAuth)Method 1 (OAuth)
Cursor, Windsurf 方式一或方式二均可Either method
本地 Agent / 命令行工具Local agents / CLI tools 方式二(访问密钥)Method 2 (API Key)
其他支持 MCP 协议的客户端Any MCP-compatible client 视工具支持情况选择Depends on tool support

工具能力一览

Available Tools

连接成功后,AI 可以调用以下工具:

Once connected, your AI can call the following tools:

📊 跑步数据查询Running Data
获取最新跑步数据
Get Latest Run Summary
读取你最近一次跑步的完整摘要,包含距离、时长、配速、心率、步频、步幅、功率、最大摄氧量、垂直振幅、温湿度等详细指标。
Fetches your most recent run in full detail: distance, duration, pace, heart rate, cadence, stride, power, VO₂ Max, vertical oscillation, temperature, humidity, and more.
特别支持分段数据——每公里(或每英里)的逐段配速、心率、步频,让 AI 深入分析节奏变化、后程掉速。

示例提示词:「帮我分析一下我最近这次跑步的分段配速,看看我有没有前快后慢的问题」
Supports per-split data — pace, heart rate, and cadence broken down by each kilometer (or mile), enabling deeper pacing analysis within a single run.

Example: "Analyze the splits from my latest run — did I go out too fast and fade at the end?"
查询历史跑步记录
Get Run History
按日期范围查询多次跑步数据(单次最多跨度 90 天),支持按活动类型筛选(户外跑 / 室内跑 / 越野跑)。
Queries multiple runs within a date range (up to 90 days per request). Filter by activity type: outdoor / indoor / trail.
示例:「统计我这个月的总跑量和平均配速」「对比我上个月和这个月的训练强度」
Example: "What was my total mileage this month?" · "Compare my training load this month vs last month."
🗓️ 训练计划管理Training Plans
查看训练计划
Get Training Plans
查询已有的训练计划列表,可按日期范围、完成状态筛选。
Lists your existing plans, filterable by date range and completion status.
示例:「看看我这周还有哪些训练计划没完成」
Example: "Which training sessions this week haven't I finished yet?"
推送训练计划
Push Training Plan
让 AI 根据你的目标和近期数据生成结构化训练计划,直接写入跑鸭 App。支持热身、主训练、放松三段式结构,支持间歇跑、有氧跑等多种类型,单次最多推送 30 条。
Generates structured training plans and writes them directly into RunYay. Supports warmup / main workout / cooldown blocks, intervals, aerobic runs, and more. Up to 30 plans per push.
计划写入后可一键同步到手表。目前已支持佳明(Garmin)、高驰(COROS)和 Apple Watch。

示例:「根据我最近的跑步数据,帮我制定下周的训练计划并推送到跑鸭」
Once in RunYay, sync to your watch with one tap. Garmin, COROS, and Apple Watch are currently supported.

Example: "Based on my recent data, build next week's training plan and push it to RunYay."
删除训练计划
Delete Training Plan
删除指定训练计划。
Removes a specific plan by ID.
示例:「把明天的训练计划删掉,我需要休息」
Example: "Delete tomorrow's training session — I need to rest."

使用场景示例

Example Prompts

以下提示词可以直接发给 AI:

Copy and send any of these directly to your AI:

「帮我分析上个月的跑步数据,找出我的进步和不足,给出具体建议。」
"Analyze my running data from last month. What's improved and what needs work?"
「根据我最近的成绩,推算我的 VDOT,并帮我制定下周的训练计划推送到跑鸭。」
"Estimate my VDOT from recent runs and create a training plan for next week. Push it to RunYay."
「我计划 3 个月后参加半马,帮我制定一个系统的备赛训练计划,按周推送到跑鸭。」
"I'm racing a half marathon in 3 months. Build a systematic training plan and push it to RunYay week by week."
「对比我最近 10 次跑步的心率数据,分析我的有氧基础变化趋势。」
"Look at my heart rate data across my last 10 runs and identify trends in my aerobic base."

授权管理与用量

Managing Connections & Usage

在跑鸭 App 设置 → 连接与授权 页面可以:

In RunYay → Settings → Connections & Authorization, you can:

  • 查看所有已连接的 AI 工具
  • View all connected AI tools
  • 修改每个连接的授权权限范围
  • Edit permission scopes per connection
  • 查看今日 / 本月 MCP 工具调用次数及额度
  • Check today's and this month's API call counts against your quota
  • 随时吊销任意连接
  • Revoke any connection instantly

常见问题

FAQ

跑鸭 MCP 采用标准 OAuth2 协议授权,数据访问路径为「AI 工具 → 跑鸭官方服务器 → 你的账号数据」,不经过任何第三方。你可以随时在 App 中撤销授权,撤销后 AI 工具立即失去访问权限。AI 工具本身是否留存对话记录,取决于你使用的 AI 产品的隐私政策。

RunYay MCP uses standard OAuth2 authorization. Data flows directly between the AI tool and RunYay's official servers — no third parties involved. Revoke access at any time in the app; the AI tool loses access immediately. Whether the AI tool retains conversation history depends on that product's own privacy policy.

训练计划会先写入跑鸭 App,然后在 App 内操作即可同步到手表。目前已支持佳明(Garmin)、高驰(COROS)和 Apple Watch,其他品牌手表陆续接入中。

Plans are written to RunYay first, then synced to your watch from within the app. Garmin, COROS, and Apple Watch are currently supported, with more brands on the way.

访问密钥仅在创建时显示一次。如果丢失,请在 App「连接与授权」页吊销该密钥,再重新生成一个。

Keys are shown only once at creation. If lost, revoke it in the app under Connections & Authorization and generate a new one.

可以。告诉 AI 你想修改的内容,AI 可以查询到对应计划的 ID,覆盖更新。

Yes. Tell the AI what you'd like to change — it can look up the plan ID and overwrite it with the updated version.