OZON MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OZON MCP Serverlogin to my OZON seller account"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OZON MCP Server
中文文档
OZON MCP Server 是一个基于 Model Context Protocol (MCP) 的工具,通过 Playwright 实现 OZON 电商后台自动化操作,支持 QQ 邮箱验证码自动读取。
功能
自动登录 (
login-with-email-code) - 使用 QQ 邮箱验证码自动登录 OZON 卖家后台价格监控 (
get-marketing-actions) - 获取营销活动商品价格数据,识别低于最低价格的商品CLI 直接调用 - 无需 MCP 协议,可从命令行直接执行单个操作
安装
方式一:从 PyPI 安装(推荐)
# 安装 uv (如果没有)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 全局安装 ozon-mcp
uv tool install ozon-mcp
# 安装浏览器
uv tool run ozon-mcp playwright install chromium方式二:克隆源码开发
# 克隆项目
git clone https://github.com/oychao1988/ozon-mcp.git
cd ozon-mcp
# 安装 uv (如果没有)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 安装依赖
uv sync
uv run playwright install chromium配置环境变量
复制 .env.example 为 .env 并填写:
cp .env.example .env编辑 .env 文件:
# OZON 账号配置(只需要用户名)
ozon_username="your_qq@qq.com"
# QQ 邮箱授权码(16位)- 获取方式见下方
qq_imap_auth_code="your_16_digit_auth_code"
# Chrome Profile 配置(可选)
chrome_profile_source="copy_to_local"获取 QQ 邮箱授权码
登录 mail.qq.com
设置 → 账户 → POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务
开启 IMAP/SMTP 服务,获取 16 位授权码
在 Claude Code 中配置
方式一:使用已安装的 ozon-mcp 命令(推荐)
claude mcp add ozon --transport stdio -- ozon-mcp方式二:使用 uvx 远程运行
claude mcp add ozon --transport stdio -- uvx ozon-mcp使用 uvx 从 GitHub 直接运行(无需安装)
claude mcp add ozon --transport stdio -- uvx github:oychao1988/ozon-mcpClaude Code 使用示例
配置完成后,可以在 Claude Code 中直接调用 MCP 工具:
# 登录 OZON 账号
使用 ozon 工具执行 login-with-email-code 命令
# 获取营销活动价格数据
使用 ozon 工具执行 get-marketing-actions 命令,参数为 page=1, page_size=20在 Claude Code 对话中可以这样交互:
# 登录示例
User: 请帮我登录 OZON 卖家后台
Claude: [调用 login-with-email-code]
# 获取数据示例
User: 获取第1页的营销活动商品数据
Claude: [调用 get-marketing-actions,参数 {page: 1, page_size: 20}]
# 获取所有页面数据
User: 获取所有营销活动商品的价格数据
Claude: [调用 get-marketing-actions,参数 {all_pages: true}]在 Cursor 中配置
在 .mcp.json 或 Cursor MCP 设置中添加:
{
"mcpServers": {
"ozon": {
"command": "ozon-mcp"
}
}
}或使用 uvx:
{
"mcpServers": {
"ozon": {
"command": "uvx",
"args": ["ozon-mcp"]
}
}
}使用方法
工具列表
1. login-with-email-code
自动登录 OZON 卖家后台(使用 QQ 邮箱接收验证码)。
{
"command": "login-with-email-code"
}2. get-marketing-actions
获取营销活动商品价格数据。
{
"command": "get-marketing-actions",
"arguments": {
"page": 1,
"page_size": 20,
"all_pages": false
}
}参数说明:
参数 | 类型 | 默认值 | 说明 |
page | number | 1 | 页码(从 1 开始) |
page_size | number | 20 | 每页产品数量 |
all_pages | boolean | false | 是否获取所有页面数据 |
CLI 命令行直接调用
除了通过 MCP 协议在 Claude Code / Cursor 中使用,也可以直接从命令行执行单个操作:
# 检查环境配置
python cli.py check
# 登录 OZON 卖家后台
python cli.py login
# 获取营销活动数据(第1页,50条,表格输出)
python cli.py marketing
# 获取第2页,每页100条
python cli.py marketing --page 2 --page-size 100
# 获取所有页面数据并保存到文件
python cli.py marketing --all --output products.json
# 保存为 CSV 格式
python cli.py marketing --page-size 100 --output data/products.csv
# 无头模式运行(不显示浏览器界面)
python cli.py --headless marketing
# JSON 格式输出(适合管道处理)
python cli.py marketing --json
python cli.py login --jsonCLI 参数说明:
命令 | 参数 | 说明 |
| - | 检查环境配置是否完整 |
|
| 无头模式运行 |
|
| 页码(从1开始) |
| 每页产品数量(默认50) | |
| 获取所有页面 | |
| 最大滚动次数 | |
| 滚动延迟(秒,默认3秒) | |
| 输出文件路径(csv 或 json 格式) | |
通用 |
| 无头模式 |
| JSON 格式输出 |
说明: CLI 脚本直接调用
server.py中的 handler 函数,复用了全部浏览器自动化逻辑,只是跳过了 MCP 协议层。
运行测试
# 运行所有测试
uv run pytest tests/ -v
# 运行特定测试文件
uv run pytest tests/test_server.py -v
# 运行带覆盖率报告的测试
uv run pytest tests/ -v --cov=ozon_mcp
# 运行特定测试类
uv run pytest tests/test_handlers.py::TestRetryDecorator -v
# 运行特定测试用例
uv run pytest tests/test_server.py::TestLoginOTPFlow::test_otp_filled_then_submit_button_clicked -v项目结构
ozon-mcp/
├── src/ozon_mcp/ # 核心代码
│ ├── __init__.py # 版本声明和导出
│ ├── server.py # MCP Server 入口 + 业务逻辑
│ ├── browser.py # Playwright 浏览器管理
│ ├── mail.py # QQ 邮箱 IMAP 操作
│ ├── session.py # 多账号会话管理
│ ├── _selectors.py # YAML 选择器加载器
│ ├── selectors.yaml # 选择器配置文件
│ ├── handlers/ # 工具处理器
│ │ ├── __init__.py
│ │ └── base.py # BaseHandler 基类
│ └── ozon_selectors.py # OZON 页面选择器常量
├── cli.py # CLI 命令行脚本(直接调用 handler)
├── tests/ # 测试代码
│ ├── test_browser.py # 浏览器管理器测试
│ ├── test_handlers.py # 处理器测试
│ ├── test_mail.py # 邮箱模块测试
│ ├── test_selectors.py # 选择器配置测试
│ ├── test_server.py # MCP Server 测试
│ └── test_session.py # 会话管理器测试
├── .env.example # 环境变量示例
├── pyproject.toml # 项目配置
└── README.md # 使用说明发布到 PyPI
# 构建包
uv build
# 发布到 PyPI(需要账号)
uv publish
# 或发布到 TestPyPI 测试
uv publish --repository testpypi注意事项
隐私保护 - 请勿提交
.env文件或chrome-profile/目录到 Git验证码 - 确保 QQ 邮箱能正常接收 OZON 的验证码邮件
Chrome Profile - 首次登录后会保存登录状态,避免重复验证
Claude Code 管理命令
# 查看已配置的 MCP 服务器
claude mcp list
# 移除 MCP 服务器
claude mcp remove ozon
# 重新添加(更新版本后)
claude mcp add ozon --transport stdio -- ozon-mcp
# 检查 MCP 服务器状态
claude mcp start ozon常见问题
Q: 登录失败,显示验证码错误 A: 确保 QQ 邮箱能收到 OZON 的邮件,检查垃圾邮件文件夹
Q: 页面加载超时 A: 增加网络超时时间,或检查 Chrome Profile 是否正常
Q: 如何查看详细日志
A: 运行 RUST_LOG=debug claude 启动 Claude Code 查看 MCP 通信日志
更新日志
v0.1.2 (2026-04-20)
Bug 修复:
修复
__version__与pyproject.toml版本不一致的问题修复 OTP 验证码填写后未点击提交按钮的问题
删除重复的
scroll_to_load函数定义
健壮性改进:
添加 tenacity 依赖用于重试逻辑
IMAP 连接添加 30 秒 socket 超时
邮件轮询添加指数退避策略
分页失败时返回已获取的部分数据
scroll_to_load支持通过max_scrolls和scroll_delay参数配置
可扩展性改进:
新增
SessionManager支持多账号管理新增
BaseHandler基类,集成重试和错误恢复逻辑Selectors 配置迁移到 YAML 文件,支持热重载
Server.py 全面采用
SelectorConfig管理选择器
包修复:
修复
pyproject.toml缺少handlers子包和selectors.yaml数据文件的打包配置
v0.1.0 (2026-04-20)
初始版本发布,包含:
login-with-email-code- QQ 邮箱验证码自动登录get-marketing-actions- 营销活动价格数据获取Playwright 浏览器自动化
Chrome Profile 会话管理
Related MCP server: Browser Testing MCP Server
English Docs
OZON MCP Server is a Model Context Protocol (MCP) based tool for automating OZON seller platform operations using Playwright, with QQ Mail OTP support.
Features
Auto Login - Login to OZON using QQ Mail verification codes
Price Monitoring - Check marketing action prices and identify underpriced items
Installation
# Install via uv
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install ozon-mcp
# Install browser
uv tool run ozon-mcp playwright install chromiumConfiguration
Copy .env.example to .env and configure:
ozon_username="your_qq@qq.com"
qq_imap_auth_code="your_16_digit_auth_code"Get QQ Mail auth code from: mail.qq.com → Settings → Account → IMAP/SMTP service
Claude Code Configuration
claude mcp add ozon --transport stdio -- ozon-mcpCursor Configuration
Add to .mcp.json or Cursor MCP settings:
{
"mcpServers": {
"ozon": {
"command": "ozon-mcp"
}
}
}License
MIT License - see LICENSE file
Available Tools
2 toolsget-marketing-actionsB
获取营销活动数据(产品名称、SKU、当前价格、最低价)
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 页码(从 1 开始) | |
| page_size | No | 每页产品数量 | |
| all_pages | No | 是否获取所有页面数据 | |
| max_scrolls | No | 滚动加载最大次数 | |
| scroll_delay | No | 每次滚动之间的等待时间(秒) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behaviors. It does not mention that the tool is read-only, rate limits, side effects, or pagination behavior despite 5 parameters controlling scrolling and pagination.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that conveys the core purpose. It is efficient but could benefit from additional details without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema, the description partially explains return data but lacks details on structure, pagination, or limitations. With 5 parameters, more context is needed for full completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds value by listing returned fields (product name, SKU, price), which gives context but does not elaborate on individual parameters beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves marketing campaign data and lists specific fields (product name, SKU, current price, lowest price). It distinguishes from the sibling tool 'login-with-email-code' which is for authentication.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for fetching marketing data but provides no explicit guidance on when to use it versus alternatives. No when-not or context is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
login-with-email-codeB
登录 OZON 卖家后台,使用 QQ 邮箱接收验证码
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description only states the action; no mention of behavioral traits like error handling, rate limits, session management, or what happens with invalid codes. With no annotations, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, appropriately concise and front-loaded. Could be slightly more structured but not verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a login tool with no output schema and no annotations, the description lacks completeness. It does not explain how the verification code works, prerequisites, or expected outcomes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has no parameters, so description does not need to add meaning. Baseline score of 4 for empty params.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool logs into OZON seller backend using QQ email verification code. It is a specific verb+resource and distinguishes from the sibling 'get-marketing-actions'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs the sibling. No when-not or alternative context provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The two tools serve entirely different purposes: one handles authentication and the other retrieves marketing data. There is no functional overlap, making it trivial for an agent to distinguish between them.
Both tool names use hyphens and follow a verb-noun structure. However, one uses 'get' with a noun phrase while the other uses 'login' with a prepositional phrase, which is a minor inconsistency in verb pattern.
With only two tools, the server feels underpopulated for its apparent scope as an OZON seller platform. Most servers in this domain would require a dozen or more tools to cover basic operations.
The server severely lacks expected functionality. After logging in, users would need tools for products, orders, campaigns, and more. A single data retrieval tool leaves massive gaps in the tool surface.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Task-scoped email inboxes for AI agents: read mail, extract verification codes, and reply.
MCP server for e-mail testing: create disposable inboxes, wait for delivery, and extract e-mail content or links - all from your AI agent or test automation workflow. Get a free API key on https://app.zyntra.app/
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables automated GitHub login through browser automation using Playwright. Provides MCP tools for programmatic authentication to GitHub accounts with credential management.1
- FlicenseNot gradedqualityDmaintenanceEnables automated browser testing of web applications using Playwright, supporting user interactions, form submissions, console monitoring, network request inspection, and visual verification through screenshots.
- AlicenseAqualityNot gradedmaintenanceEnables browser automation through Playwright using accessibility tree snapshots instead of screenshots. Supports web scraping, form interactions, testing, and connecting to existing browser sessions with logged-in accounts.22239,3205
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that utilizes Playwright to automate Bilibili video uploads, including automated metadata entry for titles, tags, and descriptions. It features QR code login and cookie persistence to enable seamless interaction with the Bilibili creator platform.17
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/oychao1988/ozon-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server