Polyprompt
An MCP server that translates your coding prompts from your native language into a target language, enabling you to learn a new language through immersion and spaced repetition while building software.
README
<div align="center">
<img src="./assets/banner.svg" width="100%" alt="Polyprompt — code with Claude, Codex or Gemini in your native language while learning a new one" />
<br/>
<p align="center"> <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-22c55e?style=flat-square"> <img alt="Node >= 18.18" src="https://img.shields.io/badge/Node-%E2%89%A5%2018.18-339933?style=flat-square&logo=nodedotjs&logoColor=white"> <img alt="TypeScript 5.7" src="https://img.shields.io/badge/TypeScript-5.7-3178c6?style=flat-square&logo=typescript&logoColor=white"> <img alt="MCP server" src="https://img.shields.io/badge/MCP-server-a78bfa?style=flat-square"> <img alt="Tests: 175 passing" src="https://img.shields.io/badge/tests-175%20passing-22c55e?style=flat-square"> <img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-2dd4bf?style=flat-square"> </p> <p align="center"> <img alt="Works with Claude, Codex and Gemini" src="https://img.shields.io/badge/works%20with-Claude%20%C2%B7%20Codex%20%C2%B7%20Gemini-60a5fa?style=flat-square"> <img alt="Engine: MCP sampling" src="https://img.shields.io/badge/engine-MCP%20sampling%20(no%20extra%20key)-f59e0b?style=flat-square"> </p>
Code with Claude, Codex or Gemini in your own language — and learn a new one while you build.
</div>
Polyprompt is an MCP server. You write your coding prompts in your native language (say, Italian); Polyprompt translates them into the language you want to learn (say, English), the AI agent does the work in that language, and every useful new word is saved and resurfaced with spaced repetition.
You learn a language passively, in the flow of real work, using the AI subscription you already pay for — no extra API key required.
You: "crea un endpoint REST per gli utenti"
↓ translate tool
Polyprompt: Italian → English
"create a REST endpoint for users"
endpoint — punto di accesso (noun) · users — utenti (noun)
↓
Agent builds the feature in English; the new words enter your review deck.
Two ways to learn
Polyprompt works in both directions — corrections one way, immersion the other — right inside your editor while you ship.
| Mode | You write in… | Polyprompt gives you… |
|---|---|---|
| Immersion | your native language (Italian) | the target translation (English) + a glossary, so you learn by osmosis |
| Tutor | the target language (English) | your mistakes corrected, each explained in your native language, plus an improved version |
Tutor mode — you try to write in English:
You: "add validate to the form and create a users"
↓ correct tool
Polyprompt: "add validation to the form and create a user"
"add validate" → "add validation" — 'validate' è un verbo; serve il sostantivo
"create a users" → "create a user" — dopo "a" va il singolare
↓
Agent builds the feature; you just learned two fixes — in Italian.
The agent picks the direction automatically from the language you wrote in (or pin one
with mode: immersion | tutor).
Why
Most developers learn technical English by osmosis — badly, slowly, and with gaps. Polyprompt turns the thousands of prompts you already write into deliberate, spaced language practice, without adding a separate study habit. Native in, target out, vocabulary remembered.
- Immersion, not friction — think in your language, ship in the one you're learning.
- Uses your subscription — translation runs on the host model via MCP sampling, so there's nothing extra to pay for or configure (API keys are optional fallbacks).
- Works everywhere MCP does — Claude Code, Codex CLI, Gemini CLI, and any other MCP client.
- Real spaced repetition — an SM-2 scheduler turns sightings into durable memory.
Quick start
One command installs Polyprompt, picks your languages, and connects it to every AI client it finds (Claude Code, Codex, Gemini) — all in one step:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/DisSa12/polyprompt/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/DisSa12/polyprompt/main/install.ps1 | iex
Target a single client with --client claude (sh) or -Client claude (PowerShell).
Prefer to do it by hand? It's still two small steps:
npm install -g polyprompt # 1. install (Node 18+); "npx -y polyprompt <cmd>" also works
polyprompt setup # 2. pick languages + connect your AI client(s) automatically
# polyprompt init --native it --target en # language setup only, no client wiring
Then just code. When you write in Italian, the agent calls translate, works in
English, and shows you what you said in English plus the new words.
Tip: ask your agent once — "use Polyprompt immersion mode" — or load the
immersionprompt the server exposes, so it consistently translates your prompts.
First run
The first time you run polyprompt init in a terminal, it walks you through a quick
language picker — choose the language you think in and the one you want to learn
(press Enter for the default, or type ? to list all 30+). Already know what you want, or
scripting it? Pass --native/--target and the prompts are skipped entirely.
<div align="center"> <img src="./assets/setup.svg" width="82%" alt="polyprompt init — interactive first-run language picker asking for your native and target language" /> </div>
Levels that adapt to you
Polyprompt meets you where you are and grows with you. Each time you write in the language you're learning, tutor mode grades how clean it was; write well consistently and Polyprompt raises your CEFR level on its own. As your level climbs, it gradually shifts the language of its explanations from your native one toward the one you're learning:
| Your level | Explanations are written in… |
|---|---|
| A1 – A2 | your native language |
| B1 | your native language, key terms kept in the target |
| B2 | a roughly even mix of both |
| C1 | mostly the target language |
| C2 | entirely the target language |
So a beginner is coached gently in their own language, while an advanced learner is
fully immersed. Turn it off with POLYPROMPT_NO_AUTO_LEVEL=1, or pin a level any time
with polyprompt config --level B1.
Staying up to date
Polyprompt keeps itself current. Everyday commands run a quiet, throttled check (at most
once a day) and update in the background when a newer version is published — whether you
installed it globally via npm or from a git clone. Force an update now with polyprompt update, or switch the automatic check off with POLYPROMPT_NO_UPDATE=1 (it never runs
in CI, or while the MCP server is serving a client).
How it works
flowchart LR
U["You"] -->|"write in Italian (native)"| H["Claude / Codex / Gemini"]
U -->|"write in English (target)"| H
H -->|"translate · immersion"| T["Polyprompt MCP server"]
H -->|"correct · tutor"| T
T -->|"sampling · your subscription"| H
T -->|"English text / corrections + glossary"| H
H -->|"builds the feature"| U
T -. saves vocabulary .-> G[("glossary.json · SM-2 deck")]
- The host AI calls the
translatetool with your native-language prompt. - Polyprompt translates it — by default via MCP sampling, i.e. by asking the host
AI itself to translate (your subscription, no extra key). If sampling isn't
available and no API key is set — or a configured engine fails at call time — it
returns instruct-mode guidance so the agent translates the prompt itself and logs
it via
record_translation. The learning loop never breaks. - New vocabulary is saved to
~/.polyprompt/glossary.jsonand scheduled for review. - The agent carries out your request using the translated text.
Tools
| Tool | What it does |
|---|---|
translate |
Immersion — translate a native-language prompt; save new words. |
correct |
Tutor — correct target-language writing; explain each mistake in your native language. |
record_translation |
Log a translation the agent made itself (instruct-mode / manual). |
explain |
Explain a word or phrase in your native language, with examples. |
review |
List vocabulary due for spaced-repetition review. |
record_review |
Grade recall (0–5) and reschedule a card. |
stats |
Show progress: words collected, mastered, due, streak. |
config |
View or change language pair, level, mode, and engine. |
It also exposes immersion and tutor prompts with behaviour instructions for the host AI.
CLI
The same engine is available from your terminal:
polyprompt translate "aggiungi validazione al form" --provider mock # immersion
polyprompt correct "add validate to the form" --provider mock # tutor
polyprompt explain "endpoint"
polyprompt review --limit 10
polyprompt grade "endpoint" 4 # grade recall (0-5) and reschedule
polyprompt stats
polyprompt config --mode tutor --level B1 # switch mode / level
polyprompt languages # list supported languages
polyprompt setup --client claude # connect Polyprompt to your AI client(s)
polyprompt update # update to the latest version right now
polyprompt uninstall --purge # disconnect from clients + delete your data
mockis a built-in offline engine — handy for trying Polyprompt without any model. It only translates between Italian and English; for other languages usesamplingor an API-key engine.
Configuration
Stored at ~/.polyprompt/config.json (override the directory with POLYPROMPT_HOME):
| Field | Meaning | Default |
|---|---|---|
nativeLang |
The language you think in (ISO 639-1) | it |
targetLang |
The language you're learning | en |
level |
Your CEFR level A1–C2 (tunes difficulty) |
A2 |
mode |
Default direction: immersion or tutor |
immersion |
provider |
Translation engine (see below) | auto |
Engines
provider |
Source | Needs |
|---|---|---|
auto (default) |
Best available, in order: sampling → anthropic → openai → gemini (first ready wins; mock is never auto-selected) |
— |
sampling |
The host AI via MCP sampling | An MCP client that supports sampling |
anthropic |
Anthropic API | ANTHROPIC_API_KEY |
openai |
OpenAI (or compatible) API | OPENAI_API_KEY (POLYPROMPT_OPENAI_BASE_URL optional) |
gemini |
Google Gemini API | GEMINI_API_KEY |
mock |
Offline dictionary (Italian and English only) | — (demo/testing) |
Model overrides: POLYPROMPT_MODEL, or per-engine POLYPROMPT_ANTHROPIC_MODEL /
POLYPROMPT_OPENAI_MODEL / POLYPROMPT_GEMINI_MODEL.
Behaviour switches: POLYPROMPT_NO_AUTO_LEVEL=1 disables the automatic level-ups;
POLYPROMPT_NO_UPDATE=1 disables the background self-update.
Client setup
Run polyprompt install <client> for copy-paste config. In short:
Claude Code
claude mcp add polyprompt -- polyprompt mcp
Codex CLI — ~/.codex/config.toml
[mcp_servers.polyprompt]
command = "polyprompt"
args = ["mcp"]
Gemini CLI — ~/.gemini/settings.json
{ "mcpServers": { "polyprompt": { "command": "polyprompt", "args": ["mcp"] } } }
See examples/ for ready-made files, including a Claude Code skill
that turns on immersion behaviour automatically.
Uninstalling
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/DisSa12/polyprompt/main/uninstall.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/DisSa12/polyprompt/main/uninstall.ps1 | iex
# or by hand:
polyprompt uninstall --purge # disconnect from every client (+ delete local data)
npm uninstall -g polyprompt
uninstall removes Polyprompt from your MCP clients (Claude Code, Codex, Gemini);
--purge also deletes your local config and glossary.
Development
npm install
npm run build # compile to dist/
npm test # vitest (unit + in-memory MCP integration + a real stdio handshake)
npm run typecheck # tsc --noEmit
npm run dev -- translate "ciao" --provider mock # run the CLI from source
The codebase is small and layered: pure SRS/store logic (src/glossary),
engine-agnostic providers (src/providers), a runtime that ties them together
(src/runtime.ts), and a thin MCP/CLI surface (src/server, src/cli.ts).
Built and hardened across two adversarial multi-agent review passes — every confirmed finding applied, with 175 tests green.
Roadmap
- A mistakes deck — spaced repetition for the corrections tutor mode finds, not just vocabulary.
- Richer review UX (cloze, listening) and export to Anki.
- Per-project glossaries.
License
MIT — see LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。