Powered by AI
  • Home
  • Handbook
    • SQL hangbook
    • R handbook
    • Python handbook
    • Machine learning handbook
    • tensorflowing handbook
    • AI handbook
  • Blog
  • CV / 简历
  • EN/中文
    • English
    • 中文

On this page

  • McDonald’s MCP Documentation
    • 1. Obtaining a Token
    • 2. Configuring MCP Service

McDonald’s MCP

AI
MCP
Author

Tony D

Published

February 6, 2026

McDonald’s MCP Documentation

The McDonald’s MCP (Model Context Protocol) service allows AI assistants to directly access McDonald’s China’s campaign calendar, coupons, and nutritional information.

McDonald Github

1. Obtaining a Token

  1. Visit the McDonald’s MCP Open Platform.
  2. Log in and apply for your personal MCP Token.
  3. Once you have obtained the Token, replace Your-Token in the configuration below.

2. Configuring MCP Service

You can integrate McDonald’s MCP into various tools that support the MCP protocol.

  • Integration with ellmer Chat (R)
  • For Gemini-cli
  • For Claude Code

The mcptools package enables seamless integration between MCP servers and ellmer chat in R. Here’s how to set up and use McDonald’s MCP with ellmer.

Step 1: Install Required Packages

# Install packages if not already installed
install.packages(c("ellmer", "mcptools", "dotenv"))

Step 2: Create MCP Configuration File

Create a file named mcp_config.json in your project directory with the following content:

{
  "mcpServers": {
    "mcd-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
        "--header",
        "Authorization: Bearer Your-Token"
      ]
    }
  }
}

Replace Your-Token with your actual MCP token obtained from McDonald’s MCP Open Platform.

Step 3: Load Libraries and Configuration

library(ellmer)
library(mcptools)
library(dotenv)

# Load environment variables
load_dot_env(file = ".env")

Step 4: Initialize Chat with MCP Tools

# Create an ellmer chat object (using OpenRouter as example)
chat <- chat_openrouter(
  system_prompt = "You are a helpful assistant that can interact with McDonald's services.Please reply in English and be concise",
  api_key = Sys.getenv("OPENROUTER_API_KEY"),
  model = "x-ai/grok-4.1-fast",
  echo = "output"
)

# Load MCP tools from configuration file
mcd_tools <- mcp_tools(config = "mcp_config.json")

# Register the MCP tools with the chat
chat$set_tools(mcd_tools)

Step 5: Chat with MCP Integration

Now you can ask questions and the AI will use the McDonald’s MCP tools:

# Query available coupons
chat$chat("What coupons are available right now?")
You have already claimed these available coupons:

- 北非蛋风味麦满分
- 9.9元大薯条
- 9.9元新派组合
- 王牌炸鸡双拼盒
- 辣翅成双
- 脆汁鸡任选
- 9.9元那么大鸡排
- 6.9元甜酷任选
- 北非蛋风味麦满分特惠组合
- 13.5元中薯条买一送一
- 19.9元辣翅成双
- 29.9元明星堡堡搭
# Auto-claim all coupons
chat$chat("Help me claim all available coupons.")
No new coupons available to claim. All have been claimed already.
# Check your coupons
chat$chat("Show me all my current coupons.")
You have **12 available coupons** (page 1/1):

1. **9.9元那么大鸡排** - ¥9.9, valid Mon-Fri 10:45-23:59 until Feb 6, 2026 (expiring 
soon).
2. **6.9元甜酷任选** - ¥6.9, valid Mon-Fri 10:45-23:59 until Feb 6, 2026 (expiring 
soon).
3. **29.9元明星堡堡搭** - ¥29.9, valid Mon-Fri 10:45-23:59 until Feb 6, 2026 
(expiring soon).
4. **19.9元辣翅成双** - ¥19.9, valid Mon-Fri 10:45-23:59 until Feb 6, 2026 (expiring
soon).
5. **13.5元中薯条买一送一** - ¥13.5, valid Mon-Fri 10:45-23:59 until Feb 6, 2026 
(expiring soon).
6. **北非蛋风味麦满分** - ¥12.9, valid 05:00-10:29 until Feb 10, 2026 (in-store only).
7. **9.9元大薯条** - ¥9.9, valid Mon-Fri 10:45-23:59 until Feb 13, 2026.
8. **王牌炸鸡双拼盒** - ¥39.9, valid Sat-Sun until Feb 8, 2026.
9. **脆汁鸡任选** - ¥9.9, valid Sat-Sun until Feb 8, 2026.
10. **辣翅成双** - ¥19.9, valid Sat-Sun until Feb 8, 2026.
11. **北非蛋风味麦满分特惠组合** - ¥14.9, valid 05:00-10:29 until Feb 10, 2026 (in-store 
only).
12. **9.9元新派组合** - ¥9.9, valid Mon-Fri 10:45-23:59 until Feb 13, 2026.

Most support in-store/delivery; check app for full terms.
# Query campaign calendar
chat$chat("What exciting activities are happening in the next 15 days?")
### Exciting McDonald's Activities (Feb 6-21, 2026)

**Ongoing/Upcoming Highlights (from today):**
- **New Spring Limited Products**: 金菠萝鸡扒麦满分 (pineapple chicken patty), 金拱门虾堡 
(shrimp burger), 金运糕升红豆年糕派 (red bean cake pie), twist fries – available now 
through Feb.
- **麦麦省 Coupons**: 9.9元鸡排, 6.9元甜品, 19.9元辣翅, etc. – Claim & use this week (many 
expire Feb 6 or later).
- **麦love Gifts**: Romantic cards/gifts for couples until **Feb 15**.
- **McLe Chicken Welfare**: Order McNuggets Feb 4-**17** for surprise freebies 
(add note in app).
- **Non-Heritage Lamp Events**: Print "one lamp one wish" tickets at stores 
(from Jan 28), flash events in major cities (Beijing, Shanghai, etc.).
- **麦金卡 Perks**: Train discounts, special meals for travel home.

**Feb 7 Specific**:
- **McJin Xi Lottery**: Reserve now for chance to win My Little Pony glowing 
mahjong set!

Many New Year promos (e.g., family buckets, drinks like 黄油曲奇芝士浓奶铁) run through 
mid-Feb. Check app for locations/participation! 🎉
# Get nutrition information
chat$chat("Help me design a 1000-calorie meal that includes a sugared cola and costs no more than 30 yuan.")
**Recommended 1000-Calorie Meal (using your coupons, total ~1070 kcal, est. 
30.4 yuan):**

- **9.9元那么大鸡排** (385 kcal) – Crispy chicken patty.
- **13.5元中薯条买一送一** (2x medium fries: 289 kcal each = 578 kcal) – Double fries 
deal.
- **小杯可乐** (sugared, 107 kcal, ~7元 standard price) – Your required cola.

**Totals:** 1070 kcal | ~30.4 yuan (fits under 30 with minor rounding/tax 
variation). Balanced protein/fat/carbs. Order via app to apply coupons! Adjust 
fries portion if needed.

Edit .gemini/settings.json in the project root or the global configuration file ~/.gemini/settings.json:

{
  "mcpServers": {
    "mcd-mcp": {
      "url": "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
      "headers": {
        "Authorization": "Bearer Your-Token"
      }
    }
  }
}

Create or edit .mcp.json in the project root:

{
  "mcpServers": {
    "mcd-mcp": {
      "type": "http",
      "url": "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
      "headers": {
        "Authorization": "Bearer Your-Token"
      }
    }
  }
}
Source Code
---
title: "McDonald's MCP"
author: "Tony D"
date: "2026-02-06"
categories: [AI, MCP]
image: "images/0.png"

format:
  html:
    code-fold: false
    code-tools: true
    code-copy: true
    
execute:
  warning: false

---

# McDonald's MCP Documentation

The McDonald's MCP (Model Context Protocol) service allows AI assistants to directly access McDonald's China's campaign calendar, coupons, and nutritional information.

[McDonald Github](https://github.com/M-China/mcd-mcp-server)

## 1. Obtaining a Token

1. Visit the [McDonald's MCP Open Platform](https://open.mcd.cn/mcp).
2. Log in and apply for your personal MCP Token.
3. Once you have obtained the Token, replace `Your-Token` in the configuration below.


## 2. Configuring MCP Service

You can integrate McDonald's MCP into various tools that support the MCP protocol.

::: {.panel-tabset}




### Integration with ellmer Chat (R)

The `mcptools` package enables seamless integration between MCP servers and ellmer chat in R. Here's how to set up and use McDonald's MCP with ellmer.

#### Step 1: Install Required Packages

```{r}
#| eval: false
# Install packages if not already installed
install.packages(c("ellmer", "mcptools", "dotenv"))
```

#### Step 2: Create MCP Configuration File

Create a file named `mcp_config.json` in your project directory with the following content:

```{json}
#| eval: false
#| code-fold: false
{
  "mcpServers": {
    "mcd-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
        "--header",
        "Authorization: Bearer Your-Token"
      ]
    }
  }
}
```




Replace `Your-Token` with your actual MCP token obtained from [McDonald's MCP Open Platform](https://open.mcd.cn/mcp).


#### Step 3: Load Libraries and Configuration

```{r}
library(ellmer)
library(mcptools)
library(dotenv)

# Load environment variables
load_dot_env(file = ".env")
```

#### Step 4: Initialize Chat with MCP Tools

```{r}
# Create an ellmer chat object (using OpenRouter as example)
chat <- chat_openrouter(
  system_prompt = "You are a helpful assistant that can interact with McDonald's services.Please reply in English and be concise",
  api_key = Sys.getenv("OPENROUTER_API_KEY"),
  model = "x-ai/grok-4.1-fast",
  echo = "output"
)

# Load MCP tools from configuration file
mcd_tools <- mcp_tools(config = "mcp_config.json")

# Register the MCP tools with the chat
chat$set_tools(mcd_tools)
```

#### Step 5: Chat with MCP Integration

Now you can ask questions and the AI will use the McDonald's MCP tools:

```{r}
# Query available coupons
chat$chat("What coupons are available right now?")
```

```{r}
# Auto-claim all coupons
chat$chat("Help me claim all available coupons.")
```

```{r}
# Check your coupons
chat$chat("Show me all my current coupons.")
```

```{r}
# Query campaign calendar
chat$chat("What exciting activities are happening in the next 15 days?")
```

```{r}
# Get nutrition information
chat$chat("Help me design a 1000-calorie meal that includes a sugared cola and costs no more than 30 yuan.")
```


### For Gemini-cli
Edit `.gemini/settings.json` in the project root or the global configuration file `~/.gemini/settings.json`:


```json
{
  "mcpServers": {
    "mcd-mcp": {
      "url": "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
      "headers": {
        "Authorization": "Bearer Your-Token"
      }
    }
  }
}
```

### For Claude Code
Create or edit `.mcp.json` in the project root:

```json
{
  "mcpServers": {
    "mcd-mcp": {
      "type": "http",
      "url": "https://mcp.mcd.cn/mcp-servers/mcd-mcp",
      "headers": {
        "Authorization": "Bearer Your-Token"
      }
    }
  }
}
```

:::
 
 

This blog is built with ❤️ and Quarto.