duolingo
Provides access to the Duolingo API on behalf of the authenticated user, exposing profile, streak, XP, language/course, friends, leaderboard, shop, health, currency, progress, topic/vocabulary, skill, voice, and pronunciation-audio data.
Click on "Deploy 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., "@duolingo What's my current Duolingo streak and XP today?"
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.
@udondan/duolingo
Unofficial community project. Not affiliated with, endorsed or authorized by Duolingo.
A TypeScript package that provides a client library for the Duolingo API, a
command line interface (duolingo) and an
MCP server for LLM agents (e.g. Claude).
Built natively in TypeScript against the unofficial Duolingo REST API — no third-party Duolingo library dependency.
Table of Contents
Related MCP server: duo-metrics-mcp
Getting Your JWT Token
The CLI, the MCP server and the library all require a Duolingo JWT token for authentication.
Log in to duolingo.com in your browser.
Open the browser developer console (F12 → Console tab).
Run:
document.cookie.match(new RegExp('(^| )jwt_token=([^;]+)'))[0].slice(11);Copy the output — that is your JWT token.
Note: JWT tokens expire. If you get authentication errors, repeat the steps above.
CLI
CLI Installation
npm install -g @udondan/duolingo
duolingo --helpOr run it without installing: npx -y @udondan/duolingo --help.
The CLI and the MCP server are also available as the Docker image
udondan/duolingo (amd64 and
arm64), no Node.js needed. See With Docker.
Credentials
The CLI reads DUOLINGO_USERNAME and DUOLINGO_JWT from the environment. You
can also put them in ~/.config/duolingo/config:
mkdir -p ~/.config/duolingo
cat > ~/.config/duolingo/config <<'EOF'
DUOLINGO_USERNAME=your_username
DUOLINGO_JWT=your_jwt_token
EOF
chmod 0600 ~/.config/duolingo/configThe file is only read when no other user can access it (mode 0600).
Environment variables take precedence over the file.
Commands
Output is JSON by default. Use --format markdown (or -f markdown) for the
same readable text the MCP tools return.
duolingo streak
duolingo --format markdown progress es
duolingo known-words fr --username someone
duolingo leaderboard --unit monthCommand | Description |
| Profile: name, bio, location, followers, languages |
| Account settings |
| Current streak, daily goal and longest streak |
| XP earned and lessons completed today |
| Languages being learned ( |
| All courses, including Math, Chess and Music |
| Users the authenticated user follows |
| Recent activity of the current course |
| Friends ranked by XP |
| Shop items and prices |
| Hearts and refill status |
| Gem and lingot balances |
| Current streak goal and checkpoints |
| Level, points and streak of a language (e.g. |
| Detailed progress in a language (e.g. |
| Learned topics |
| Topics not learned yet |
| Fully mastered topics |
| Learned topics that need review |
| Words learned |
| Learned skills in learning order |
| Text-to-speech voices |
| Pronunciation audio URL |
| Full name of a language ( |
| Abbreviation of a language ( |
| Start the MCP server (stdio) |
Errors go to stderr and the CLI exits with code 1.
With Docker
Arguments after the image name are passed to the CLI. -e NAME without a
value takes the variable from your shell:
docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo streakAs an alias, the image behaves like an installed duolingo:
alias duolingo='docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo'
duolingo --format markdown progress esThe config file ~/.config/duolingo/config is not visible inside the
container, so pass the credentials as environment variables.
MCP Server
MCP Installation
The server is listed in the
MCP Registry
as io.github.udondan/duolingo.
Option A — run directly with npx (no install needed):
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt npx -y @udondan/duolingo mcpOption B — install globally:
npm install -g @udondan/duolingo
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt duolingo mcpOption C — run the Docker image:
docker run --rm -i -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingoWithout arguments, the image starts the MCP server. -i keeps stdin open,
which the server uses to talk to the client.
Option D — clone and build from source:
git clone https://github.com/udondan/duolingo.git
cd duolingo
bun install && bun run build
node dist/cli.js mcpClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"duolingo": {
"command": "npx",
"args": ["-y", "@udondan/duolingo", "mcp"],
"env": {
"DUOLINGO_USERNAME": "your_username",
"DUOLINGO_JWT": "your_jwt_token"
}
}
}
}With Docker instead of npx, the entry looks like this. -e NAME without a
value passes the variable from env to the container:
{
"mcpServers": {
"duolingo": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"DUOLINGO_USERNAME",
"-e",
"DUOLINGO_JWT",
"udondan/duolingo"
],
"env": {
"DUOLINGO_USERNAME": "your_username",
"DUOLINGO_JWT": "your_jwt_token"
}
}
}
}Claude Code
claude mcp add duolingo -- npx -y @udondan/duolingo mcpThen set the environment variables before starting Claude Code:
export DUOLINGO_USERNAME="your_username"
export DUOLINGO_JWT="your_jwt_token"Docker MCP Toolkit
With the Docker MCP Toolkit of Docker Desktop, the server runs as a container behind the MCP Gateway. The gateway starts the container on demand and passes its tools on to the connected clients. The credentials are stored as secrets in Docker Desktop instead of in plain text in the client configuration.
Requires Docker Desktop with the MCP Toolkit enabled.
Download the server definition
docker-mcp.ymland add it to a Toolkit profile. The Toolkit only reads such files from its catalogs directory:mkdir -p ~/.docker/mcp/catalogs curl -fsSL https://raw.githubusercontent.com/udondan/duolingo/main/docker-mcp.yml -o ~/.docker/mcp/catalogs/duolingo.yml # new profile "duolingo" ... docker mcp profile create --name duolingo --id duolingo --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml" # ... or add it to an existing profile docker mcp profile server add default --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml"The profile keeps the image at the version it had when it was added. Run
profile server addagain to update.Store the credentials as secrets (see Getting Your JWT Token):
docker mcp secret set duolingo.username=your_username docker mcp secret set duolingo.jwt=your_jwt_tokenConnect a client to the profile:
docker mcp client connect claude-desktop --profile duolingodocker mcp client connect --helplists more clients such asclaude-code,cursororvscode. This also works in Docker Desktop under MCP Toolkit.
docker mcp gateway run --profile duolingo --dry-run --verbose checks the setup
without starting a client. The output should end with duolingo: (N tools).
Available Tools
All tools are read-only — the server never modifies your Duolingo account.
Account
Tool | Description |
| Profile: username, name, bio, location, avatar, followers, learning language |
| Notification and account settings |
| Current streak, longest streak, daily goal, extended today |
| XP goal, XP earned today, lessons completed today |
| Languages being learned (full names or abbreviations) |
| All courses including Math, Chess, and Music with XP per course |
| Users the authenticated user follows, with total XP |
| Recent activity calendar for the current course (~last 2 weeks) |
| Authenticated user's friends sorted by XP for week or month |
| Full shop catalogue with prices and item types |
| Current hearts count, max hearts, refill timing |
| Gem and lingot balances |
| Current streak goal with upcoming checkpoints |
Language
Tool | Description |
| Level, points, streak for a specific language |
| Detailed progress: level %, points to next level, fluency |
| Learned topic/skill names |
| Not-yet-learned topics |
| Fully mastered topics (strength = 1.0) |
| Learned but not fully mastered topics |
| Set of known words for a language |
| Full skill objects sorted by learning order |
| Available TTS voice names for a language |
| Pronunciation audio URL for a word |
Courses on the learning path no longer fill the legacy skill tree. For the authenticated user's current course, the topic, skill and word tools read it from the current API instead: there, a topic is mastered once all its levels (crowns) are finished, and words come from the Words page. Other courses return no topics, skills or words.
Utilities
Tool | Description |
| Convert language abbreviation to full name (e.g. |
| Convert full language name to abbreviation (e.g. |
Library
Library Installation
npm install @udondan/duolingoQuick Start
import { DuolingoClient } from '@udondan/duolingo';
const client = new DuolingoClient('your_username', 'your_jwt_token');
// Get all courses including Math, Chess, and Music
const userData = await client.getUserData();
const userId = userData.id;
const v2 = await client.getUserDataV2(userId);
for (const course of v2.courses) {
console.log(`${course.subject}: ${course.xp} XP`);
}
// Get streak info
const streak = v2.streak;
const longestStreak = v2.streakData.longestStreak?.length;
// Get friends
const friends = await client.getFollowing(userId);
for (const friend of friends) {
console.log(`${friend.username}: ${friend.totalXp} XP`);
}
// Get shop items
const items = await client.getShopItems();
const streakFreeze = items.find((i) => i.id === 'streak_freeze');
// Get hearts
const health = await client.getHealth();
console.log(`Hearts: ${health.hearts}/${health.maxHearts}`);API Reference
new DuolingoClient(username, jwt)
Creates a new client instance. Results are cached per instance.
const client = new DuolingoClient('your_username', 'your_jwt_token');User Data
// Legacy API — returns language_data with skills, calendar, etc.
// Required for: language details, topics, known words, learned skills
const userData = await client.getUserData(username?);
// 2023-05-23 API — returns all courses (language + math/chess/music),
// richer streak data, subscriber level, gems, health
const userId = userData.id;
const v2 = await client.getUserDataV2(userId);
// Resolve a username to a numeric user ID
const id = await client.getUserIdByUsername('someuser');Courses (all subjects)
const v2 = await client.getUserDataV2(userId);
// All courses
v2.courses; // DuolingoCourse[]
// Filter by subject
const langCourses = v2.courses.filter((c) => c.subject === 'language');
const mathCourses = v2.courses.filter((c) => c.subject === 'math');
const chessCourses = v2.courses.filter((c) => c.subject === 'chess');
const musicCourses = v2.courses.filter((c) => c.subject === 'music');Each course has: id, subject, topic, xp, fromLanguage.
Language courses also have: learningLanguage, title, authorId.
Daily XP Progress
const progress = await client.getUserDataById(userId, [
'xpGoal',
'xpGains',
'streakData',
]);
// progress.xpGoal — daily XP goal
// progress.xpGains — array of { xp, skillId, time } for recent lessons
// progress.streakData.updatedTimestamp — last streak updateFriends & Social
// People this user follows (= friends)
const following = await client.getFollowing(userId);
// following[0].username, .totalXp, .userScore?.score (weekly XP), .isFollowedBy
// People who follow this user
const followers = await client.getFollowers(userId);Shop, Health & Currencies
// Full shop catalogue (read-only)
const items = await client.getShopItems();
// items[0].id, .name, .type, .price, .currencyType, .lastUsedDate
// Hearts / health (authenticated user only)
const health = await client.getHealth();
// health.hearts, .maxHearts, .eligibleForFreeRefill, .secondsUntilNextHeartSegment
// Gem and lingot balances (authenticated user only)
const { gems, lingots } = await client.getCurrencies();Streak Goals
// Current streak goal with checkpoints
const goal = await client.getStreakGoalCurrent();
// goal.hasActiveGoal, goal.streakGoal.lastCompleteGoal, .checkpoints, .nextSelectedGoal
// Available next goal options
const options = await client.getStreakGoalNextOptions();TTS Audio
// Discover available voices for a language
const voices = await client.getLanguageVoices('es'); // ['beaes', 'juniores', ...]
// Build an audio URL
const url = await client.buildAudioUrl('hola', 'es');
const urlWithVoice = await client.buildAudioUrl('hola', 'es', 'beaes');Error Handling
import {
DuolingoClient,
DuolingoAuthError,
DuolingoNotFoundError,
DuolingoCaptchaError,
DuolingoClientError,
} from '@udondan/duolingo';
try {
const data = await client.getUserData('someuser');
} catch (err) {
if (err instanceof DuolingoAuthError) {
// JWT expired — extract a new one from the browser
} else if (err instanceof DuolingoNotFoundError) {
// User does not exist
} else if (err instanceof DuolingoCaptchaError) {
// Duolingo blocked the request — try again later
} else if (err instanceof DuolingoClientError) {
// Other API error
}
}Development
git clone https://github.com/udondan/duolingo.git
cd duolingo
mise install # Node.js and Bun, versions from mise.toml
bun install
# Build
bun run build
# Run tests (unit + integration)
bun run test
# Integration tests require credentials:
export DUOLINGO_USERNAME="your_username"
export DUOLINGO_JWT="your_jwt_token"
bun run test
# Type-check without building
bun run typecheck
# Run MCP server in dev mode (no build step)
bun run devProject Structure
src/
├── index.ts # Library entry point — exports client, types, errors
├── cli.ts # `duolingo` binary
├── mcp.ts # MCP server (stdio transport), started by `duolingo mcp`
├── version.ts # Package version
├── cli/
│ ├── program.ts # CLI commands (commander)
│ └── config-file.ts # ~/.config/duolingo/config loader
├── client/
│ ├── duolingo.ts # DuolingoClient — all API methods
│ ├── types.ts # TypeScript interfaces for all API responses
│ └── errors.ts # Custom error classes
├── views/
│ ├── account.ts # Account queries: data + markdown
│ ├── language.ts # Language queries: data + markdown
│ ├── utils.ts # Language name/abbreviation lookups
│ └── view.ts # View type and rendering
└── tools/
├── account.ts # Account tools
├── language.ts # Language tools
├── shop.ts # Utility tools
└── helpers.ts # Shared utilities (error handling, Zod schemas)API Versions Used
Endpoint | API Version | Used For |
| Legacy | User profile, language data, skills, calendar |
| Current | Courses (all subjects), streak, health, gems |
| Current | Friends, leaderboard |
| Current | Shop catalogue |
| Current | Streak goals |
| Current | TTS voice discovery |
License
MIT — see LICENSE
Disclaimer
This is an unofficial, independent open-source project and is not affiliated with Duolingo, Inc. Duolingo is a trademark of Duolingo, Inc. The name is used only to describe compatibility. The API used is not public and may change at any time. Use at your own risk and in accordance with the Duolingo Terms and Conditions.
Available Tools
25 toolsduolingo_get_abbreviation_ofGet Duolingo Language AbbreviationARead-onlyIdempotent
Convert a full language name to its abbreviation. Only works for languages the given user is currently learning.
Inputs: language_name (required), username.
duolingo_get_audio_urlGet Duolingo Word Audio URLBRead-only
Get the URL of a pronunciation audio file for a word. Returns a CloudFront CDN URL pointing to the TTS audio file.
Inputs: word (required), voice, random, language_abbr.
duolingo_get_calendarGet Duolingo Activity CalendarARead-onlyIdempotent
Get a Duolingo user's recent activity calendar. Returns all recent activity entries, sorted newest first. The Duolingo API provides roughly the last 2 weeks of activity. Note: the calendar reflects the currently selected course only (e.g. Spanish, Math, Chess) — not all courses combined.
Inputs: username, response_format.
duolingo_get_coursesGet Duolingo CoursesARead-onlyIdempotent
Get all courses a Duolingo user is enrolled in, including non-language subjects like Math, Chess, and Music. Returns each course's subject, title, XP earned, and course ID. Language courses also include the language code.
Inputs: username, response_format.
duolingo_get_currenciesGet Duolingo Currency BalancesARead-onlyIdempotent
Get the authenticated user's gem and lingot balances. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_daily_xp_progressGet Duolingo Daily XP ProgressARead-only
Get the authenticated user's XP progress for today. Returns the daily XP goal, total XP earned today, and a list of lessons completed today. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_friendsGet Duolingo FriendsARead-onlyIdempotent
Get the list of Duolingo users that a given user is following (their friends). Returns each friend's username, display name, and total XP. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_golden_topicsGet Duolingo Golden (Mastered) TopicsARead-onlyIdempotent
Get the list of fully mastered ("golden") topics for a language. A golden topic has a strength of 1.0 (fully reviewed).
Inputs: language_abbr (required), username, response_format.
duolingo_get_healthGet Duolingo Health (Hearts)ARead-onlyIdempotent
Get the authenticated user's current hearts/health status. Returns heart count, max hearts, refill eligibility, and time until next heart refill. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_known_topicsGet Duolingo Known TopicsCRead-onlyIdempotent
Get the list of learned topic/skill names for a language.
Inputs: language_abbr (required), username, response_format.
duolingo_get_known_wordsGet Duolingo Known WordsCRead-onlyIdempotent
Get the set of words a user has learned in a language.
Inputs: language_abbr (required), username, response_format.
duolingo_get_language_detailsGet Duolingo Language DetailsBRead-onlyIdempotent
Get a user's status and details for a specific language. Returns level, points, streak, and learning status for the given language.
Inputs: language_name (required), username, response_format.
duolingo_get_language_from_abbrGet Duolingo Language Name from AbbreviationARead-onlyIdempotent
Convert a language abbreviation to its full name. Only works for languages the given user is currently learning.
Inputs: language_abbr (required), username.
duolingo_get_language_progressGet Duolingo Language ProgressARead-onlyIdempotent
Get detailed progress metrics for a specific language. Returns level, percent to next level, points rank, fluency score, skills learned, and more.
Inputs: language_abbr (required), response_format.
duolingo_get_languagesGet Duolingo Learning LanguagesBRead-onlyIdempotent
Get the list of languages a Duolingo user is currently learning.
Inputs: username, abbreviations, response_format.
duolingo_get_language_voicesGet Duolingo Language TTS VoicesBRead-onlyIdempotent
Get the available text-to-speech (TTS) voices for a language. Returns a list of voice names.
Inputs: language_abbr, response_format.
duolingo_get_leaderboardGet Duolingo LeaderboardARead-only
Get the XP leaderboard for a Duolingo user's friends. Returns the users they follow, sorted by XP for the given time unit (week or month). Only works for the authenticated user.
Inputs: unit, response_format.
duolingo_get_learned_skillsGet Duolingo Learned SkillsARead-onlyIdempotent
Get full skill objects for all learned skills, sorted by learning order. Returns detailed skill data including title, strength, progress, words, and more.
Inputs: language_abbr (required), username, response_format.
duolingo_get_reviewable_topicsGet Duolingo Reviewable TopicsARead-onlyIdempotent
Get the list of learned but not fully mastered topics for a language. These are topics that have been started but whose strength is below 1.0, meaning they need review.
Inputs: language_abbr (required), username, response_format.
duolingo_get_settingsGet Duolingo User SettingsARead-onlyIdempotent
Get the authenticated user's Duolingo account settings. Returns notification preferences and follow/follower relationship flags. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_shop_itemsGet Duolingo Shop ItemsARead-onlyIdempotent
Get the full Duolingo shop catalogue. Returns all purchasable items with their prices, currency type (gems/lingots), item type, and last-used dates. This is read-only — it does not purchase anything.
Inputs: response_format.
duolingo_get_streak_goalGet Duolingo Streak GoalARead-onlyIdempotent
Get the authenticated user's current streak goal and upcoming checkpoints. Shows the last completed goal, upcoming milestones, and the next selected goal. Only works for the authenticated user.
Inputs: response_format.
duolingo_get_streak_infoGet Duolingo Streak InfoARead-onlyIdempotent
Get a Duolingo user's current streak information. Returns the site-wide streak count, daily XP goal, and whether the streak has been extended today.
Inputs: username, response_format.
duolingo_get_unknown_topicsGet Duolingo Unknown TopicsBRead-onlyIdempotent
Get the list of not-yet-learned topics/skills for a language.
Inputs: language_abbr (required), username, response_format.
duolingo_get_user_infoGet Duolingo User InfoARead-onlyIdempotent
Get a Duolingo user's profile information. Returns username, full name, bio, location, avatar URL, follower/following counts, learning language, UI language, cohort, admin status, and more.
Inputs: username, response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools target distinct data (streak, health, currencies, leaderboard, shop), but several pairs overlap heavily: get_language_details vs get_language_progress both return level/points/streak for one language, get_known_topics vs get_learned_skills return the same learned-skill set at different granularity, and get_languages vs get_courses both enumerate what a user studies. Descriptions help somewhat but an agent can still easily misselect among these.
All 25 tools uniformly use the duolingo_get_<noun> snake_case pattern, which is highly predictable. Minor deviations are the redundant `duolingo_` prefix on every name and awkward noun phrases like get_language_from_abbr and get_abbreviation_of, which don't fit the clean verb_noun shape.
25 tools is at the heavy end for what is essentially a single read-only API surface. The four topic-list tools (known/unknown/golden/reviewable) could be one tool with a filter, so several tools feel like thin wrappers rather than earning their place.
Read coverage is broad (profile, streak, XP, courses, topics, words, leaderboard, shop, health, currencies), but the surface is entirely read-only with no mutation operations, and there are gaps like quests/achievements and any way to act on data. Agents can inspect state but cannot perform the domain's core lifecycle actions.
Maintenance
Related MCP Connectors
660+ data tools for agents: TikTok, Douyin, Instagram, YouTube, X, weather, GitHub. Pay per call.
Web data for agents: YouTube transcripts, screenshots, Google News, WHOIS, jobs, tech stack, more.
Social media data API for AI agents. Live data from any public link, handle or search.
The LinkedIn API for AI agents. Search, inbox, posts and outreach over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLMs to retrieve and analyze sleep, recovery, and physiological cycle data from the WHOOP API. It provides tools for accessing detailed metrics such as strain, HRV, and readiness scores through secure OAuth 2.0 authentication.414 npm1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to query personal Duolingo metrics such as daily XP, sessions, streak, and practice time using public and authenticated endpoints.5MIT
- AlicenseAqualityDmaintenanceEnables AI agents to query a GitHub user's public profile, repositories, language breakdowns, and README content61MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage D&D Beyond characters, access campaigns, and look up spells, monsters, items, and more through a reverse-engineered API.MIT