duo-metrics-mcp
Enables AI assistants to query personal Duolingo metrics such as daily XP, sessions, streak, and practice time using public and authenticated endpoints.
README
duo-metrics-mcp
Personal Duolingo metrics MCP server for AI assistants.
duo-metrics-mcp lets an MCP-compatible assistant answer daily language-learning
questions such as:
- Did I practice Duolingo today?
- How much XP did I earn today?
- How many sessions did I complete?
- How much time did I spend practicing?
- What is my current streak?
- What did my last week or month of Duolingo activity look like?
The server uses Duolingo's unofficial web endpoints. Public profile lookup works without authentication. Daily XP summaries require an authenticated Duolingo web session cookie.
Status
This is an unofficial personal-use MCP server. Duolingo does not publish or support these endpoints for third-party API use, so endpoint behavior can change without notice.
The current implementation is intentionally lightweight:
- no database
- no background scheduler
- no password login
- live API reads on demand
- optional local ignored session file for authenticated calls
Tools
duolingo_get_public_profile
Fetches public profile data by username.
Authentication: not required.
Useful for:
- user id discovery
- public streak data
- total XP
- active course
- course XP split
Input:
{
"username": "JoaoPedroS572669"
}
duolingo_get_authenticated_profile
Fetches the richer authenticated profile by user id.
Authentication: required.
Input:
{
"userId": 955434155472097
}
duolingo_get_xp_summaries
Fetches daily XP summaries, including sessions, total practice time, and streak extension status.
Authentication: required.
Input:
{
"userId": 955434155472097,
"startDate": "2026-06-01",
"endDate": "2026-06-20",
"timezone": "America/Sao_Paulo",
"readable": true
}
Example output:
{
"userId": 955434155472097,
"timezone": "America/Sao_Paulo",
"summaries": [
{
"date": "2026-06-20",
"gainedXp": 353,
"numSessions": 11,
"totalSessionTimeSeconds": 1057,
"totalSessionTimeMinutes": 17.6,
"streakExtended": true,
"frozen": false,
"repaired": false,
"dailyGoalXp": 1,
"shielded": false
}
]
}
duolingo_today_status
Returns a compact daily status for assistant workflows.
Authentication: required.
Input:
{
"userId": 955434155472097,
"timezone": "America/Sao_Paulo"
}
Example output:
{
"userId": 955434155472097,
"date": "2026-06-20",
"timezone": "America/Sao_Paulo",
"playedToday": true,
"xpToday": 353,
"sessionsToday": 11,
"minutesToday": 17.6,
"streakExtended": true
}
duolingo_auth_help
Explains the supported authentication configuration to the assistant.
Authentication: not required.
Requirements
- Node.js 20 or newer
- npm
- an MCP-compatible client that supports stdio servers
Installation
Clone and build:
git clone https://github.com/Tavaresiqueira/duo-metrics-mcp.git
cd duo-metrics-mcp
npm install
npm run build
Run the server manually:
npm start
For development:
npm run dev
Run the smoke test:
npm run smoke
The smoke test builds the project, starts the MCP server through stdio, lists the available tools, calls the public profile tool, and verifies the missing-auth path for authenticated tools.
Configuration
The server reads defaults from environment variables:
$env:DUOLINGO_USERNAME = "JoaoPedroS572669"
$env:DUOLINGO_USER_ID = "955434155472097"
These defaults let assistants call tools without repeating the username or user id on every request.
Authentication
Public profile data does not require authentication.
Daily XP summaries require an authenticated Duolingo session cookie. The server supports two auth modes:
DUOLINGO_COOKIEenvironment variable.duolingo-session.jsonin the repo root
Environment Variable
Set the full Cookie header before starting the MCP server:
$env:DUOLINGO_COOKIE = "jwt_token=...; logged_out_uuid=...; ..."
npm start
Local Session File
Create .duolingo-session.json:
{
"cookie": "jwt_token=...; logged_out_uuid=...; ...",
"createdAt": "2026-06-20T18:00:00Z",
"source": "manual browser session"
}
This file is ignored by git.
You can also create it from the environment variable:
$env:DUOLINGO_COOKIE = "jwt_token=...; logged_out_uuid=...; ..."
npm run save-session
Remove-Item Env:\DUOLINGO_COOKIE
Getting a Cookie
Use a browser where you are already logged in to Duolingo:
- Open
https://www.duolingo.com/learn. - Open browser developer tools.
- Go to the Network tab.
- Reload the page.
- Select a request to
www.duolingo.com. - Copy the request
Cookieheader. - Store it as
DUOLINGO_COOKIEor in.duolingo-session.json.
Do not commit cookies, tokens, or session files.
MCP Client Setup
Use the built server over stdio.
Example config:
{
"mcpServers": {
"duo-metrics": {
"command": "node",
"args": [
"C:\\Users\\joao.siqueira\\Documents\\duo-metrics-mcp\\dist\\index.js"
],
"env": {
"DUOLINGO_USERNAME": "JoaoPedroS572669",
"DUOLINGO_USER_ID": "955434155472097"
}
}
}
}
If you want authenticated tools without a .duolingo-session.json file, include
DUOLINGO_COOKIE in the MCP environment block. Prefer the local session file for
personal desktop use so the cookie does not sit in a shared config file.
Best Usage
This MCP works best as a small daily workflow source, not as a full Duolingo clone.
Good assistant prompts:
Check whether I completed Duolingo today.
Show my Duolingo XP for the last 7 days.
Include my Duolingo streak and today's XP in my evening shutdown.
Compare today's Duolingo effort against the last 14 days.
Before I stop working, confirm whether my Duolingo streak is safe.
Recommended workflow:
- Keep
DUOLINGO_USERNAMEandDUOLINGO_USER_IDconfigured. - Keep
.duolingo-session.jsonlocal and ignored. - Let the assistant call
duolingo_today_statusduring daily check-ins. - Use
duolingo_get_xp_summariesfor weekly/monthly review prompts. - Refresh the session cookie only when Duolingo starts returning
401.
Troubleshooting
Authenticated tools return missing session
Set DUOLINGO_COOKIE or create .duolingo-session.json.
Authenticated tools return 401
Your session probably expired. Log in to Duolingo in the browser again, copy a
fresh Cookie header, and update .duolingo-session.json.
Public profile lookup fails
Check that the username is the Duolingo username, not the email address. The username is case-insensitive for lookup, but the returned profile may use Duolingo's canonical casing.
Dates look off by one day
Pass the timezone explicitly:
{
"timezone": "America/Sao_Paulo"
}
Privacy
This server can access personal Duolingo account data when configured with a
session cookie. Treat .duolingo-session.json like a secret.
The project intentionally avoids password-based login. It only uses an existing web session cookie that you provide.
Development
Useful commands:
npm run build
npm run typecheck
npm run smoke
Project layout:
src/index.ts MCP server and tool registration
src/duolingoClient.ts Duolingo endpoint client and normalization
src/config.ts Environment/session-file configuration
src/types.ts Shared TypeScript types
scripts/save-session.mjs
scripts/smoke-test.mjs
Limitations
- Duolingo endpoints are unofficial.
- Session cookies can expire.
- Some browser cookies are
HttpOnly, so they cannot be read fromdocument.cookie. - The server does not currently persist long-term history.
- The server does not currently automate login.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。