AgentPlayerAchievements MCP Server

MCP-powered local platform turns vibe coding into a game. Steam-style achievements for Claude Code, Hermes and more.

Documentation

Agent Player Achievements (AGPA) ๐Ÿ†

AGPA Logo

ENย |ย ไธญๆ–‡ย |ย ESย |ย ํ•œ๊ตญ์–ดย |ย ๆ—ฅๆœฌ่ชž

Gamified achievement system for AI coding agents.
Earn XP, unlock trophies, level up โ€” just by doing what you already do.

License: MIT 217 achievements 1207 tests Node >= 18 27 CLI commands GitHub stars Last commit i18n: 5 languages

Claude Codeย ยทย Kilo Codeย ยทย OpenCodeย ยทย Hermesย ยทย OpenClaw

Quick Start ยท How It Works ยท Features ยท Supported Tools ยท CLI Commands ยท Community Packs ยท Dashboard ยท Security & Privacy ยท Contributing ยท FAQ


Without AGPA โŒ

  • No visibility into your coding habits across sessions
  • Can't track progress โ€” getting faster? Using more tools? No way to know
  • No motivation to explore your agent's full feature set
  • Same routine every day โ€” no surprises, no milestones

With AGPA โœ…

  • Auto-tracking โ€” every tool call, file edit, and git commit logged automatically
  • Steam-style dashboard โ€” XP bar, levels, streaks, heatmaps, achievement showcase
  • 217 achievements across 11 categories โ€” from "Hello World" to "Completionist"
  • Instant feedback โ€” terminal popups, macOS notifications, 8-bit sounds on unlock

Dashboard Preview

AGPA Home
Home โ€” XP bar, streaks, agent stats
Achievement Grid
Achievements โ€” 217 achievements ร— 11 categories
Achievement Sets
Sets โ€” themed collections with progress tracking
Achievement Detail
Detail Card โ€” rarity, unlock date, replay animation


Quick Start

Prerequisites: Node.js โ‰ฅ 18

# Option A: install globally (recommended for users)
npm install -g @eiainano/agpa
agpa init

# Option B: clone and link (recommended for contributors)
git clone https://github.com/eiainano/AgentPlayerAchievements.git
cd AgentPlayerAchievements && npm install && npm link
agpa init

That's it. Keep using your agent โ€” achievements unlock automatically as you work.

[!TIP] Want to see what the dashboard looks like without waiting for real unlocks? Run agpa demo to generate sample data instantly.

agpa dashboard         # open the achievement dashboard
agpa stats             # check your progress
agpa assets download   # (optional) pre-download all 219 pixel-art badges

How It Works

Your Coding Session
  โ”‚
  โ”œโ”€ You code, agent responds โ€” every action is tracked
  โ”‚   โ””โ”€ dual-channel: MCP tools + Hook events
  โ”‚
  โ”œโ”€ Session ends โ†’ engine evaluates 217 achievements
  โ”‚   โ””โ”€ unlocked? โ†’ macOS notification ๐ŸŽ‰
  โ”‚
  โ””โ”€ agpa dashboard โ†’ view, sort, filter, share

Two data channels โ†’ one engine โ†’ one dashboard:

ChannelMethodCaptures
Hook CLITool hooks (subprocess via stdin)file.read/write/edit, tool.complete, git.commit, session.start/end, task.complete, agent.spawn
MCP ServerSTDIO protocol (7 tools)image.read, file.language_used, plan.mode_entered, user.message, automode.start, achievement config, explain

Both channels write to the same ~/.agent-achievements/ event log. The engine evaluates 12 condition types against 217 achievements.

[!NOTE] Zero overhead. The Hook CLI is a sub-millisecond subprocess. The MCP server runs on STDIO with no network calls. All data stays on your machine.

Features

  • ๐ŸŽฎ Achievement Dashboard โ€” XP bar, level, streak, activity heatmap, rarity breakdown, showcase
  • ๐Ÿ† 217 Achievements across 11 categories โ€” from "Hello World" to "Completionist"
  • ๐Ÿ”ฅ GitHub-style activity heatmap โ€” 4 months of coding activity at a glance
  • ๐Ÿ“ธ Share Card โ€” dark/light themed, bilingual, downloadable PNG
  • ๐Ÿ”Š 8-bit sound effects & notifications โ€” rarity-graded retro sounds + desktop push notifications on unlock
  • ๐Ÿ“‚ Multi-profile โ€” up to 4 profiles, switch anytime (work, personal, experimentation)

Supported Tools

Claude Code Kilo Code OpenCode Cursor VS Code Hermes OpenClaw

ToolAuto-trackMCP trackEasiest Setup
Claude Codeโœ…โœ…agpa init auto-detects
Kilo Codeโœ…โœ…TS plugin + MCP config
OpenCodeโœ…โœ…TS plugin + MCP config
Hermesโ€”โœ…MCP JSON config
OpenClawโœ…โœ…Plugin + MCP config

All five tools have full dual-channel coverage except Hermes (no hook API). For any MCP-compatible client (Cursor, VS Code, Windsurf, etc.), MCP-only tracking works out of the box โ€” you just miss hook-based auto-tracking.

[!TIP] New to MCP? Start with agpa init โ€” it auto-detects your installed tools and configures everything. Manual JSON configs below are fallbacks.

Claude Code โ€” auto-track + MCP (full coverage)

agpa init auto-detects Claude Code and registers both channels. For manual setup:

MCP config (~/.claude/.mcp.json or project-root .mcp.json):

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}

Hook registration โ€” agpa init adds hook entries to your Claude Code settings. Verify with agpa verify.

Cursor / VS Code โ€” MCP only

These editors support MCP but don't expose hook APIs for auto-tracking. You get tool-call tracking via MCP.

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}
Kilo Code / OpenCode โ€” auto-track + MCP (full coverage)

These tools support TS plugins for hook-level auto-tracking. agpa init registers the plugin + MCP config.

Manual MCP config (opencode.json or Kilo Code settings):

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}

The TS plugin (registered by agpa init) handles PostToolUse, SessionStart, SessionEnd, and other hook events automatically.

Hermes โ€” MCP only

Hermes does not expose a hook API. MCP-based tracking covers tool calls and session events.

MCP config (~/.hermes/mcp.json):

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}
OpenClaw โ€” auto-track + MCP (full coverage)

OpenClaw supports a plugin system for hook-level tracking. agpa init registers both the plugin and MCP config.

Manual MCP config:

{
  "mcpServers": {
    "agpa": {
      "command": "npx",
      "args": ["tsx", "path/to/AgentPlayerAchievements/src/main.ts"]
    }
  }
}

CLI Commands

CommandDescription
agpa initAuto-detect and register with your agent tools
agpa uninstallCleanly remove AGPA from all configured tools
agpa verifyCheck installation correctness
agpa doctorDiagnose system state
agpa dashboardStart achievement dashboard (localhost:3867)
agpa statsShow achievement progress summary
agpa progressList all achievements with unlock status
agpa profileManage achievement profiles (create, list, switch, softwares, delete)
agpa demoGenerate MVP demo data for testing
agpa resetReset all tracking data
agpa configView/modify config (lang, sound, debug...)
agpa showcaseManage showcase (list, pin, unpin, auto-fill)
agpa searchSearch achievements by keyword/rarity/category
agpa suggestSuggest next achievement to hunt
agpa soundToggle 8-bit rarity-graded sound effects (on, off)
agpa activityView streak + 4-month activity heatmap
agpa exportExport achievement data as JSON
agpa importImport from backup
agpa mcpStart MCP server (stdio mode)
agpa webAlias for agpa dashboard
agpa packList or inspect installed community achievement packs
agpa bannerSwitch terminal banner color theme (Neon/Arcade/Gold)
agpa historyBrowse raw event log entries
agpa explainShow why an achievement is locked/unlocked (condition breakdown)
agpa watchReal-time achievement progress monitor
agpa upgradeCheck for updates and upgrade AGPA
agpa completionGenerate shell completion script (bash/zsh/fish)

Full CLI reference: agpa --help

Community Packs

Anyone can create and share achievement packs. Drop a YAML file into ~/.agent-achievements/packs/ to install:

agpa pack list              # list installed packs
agpa pack info <id>         # show pack details

See Creating Achievement Packs for the pack format spec, event type catalog, and 12 condition types.

Dashboard

Stats row โ†’ Streak + Heatmap โ†’ Showcase โ†’ Achievement grid with search/filter

agpa dashboard           # default :3867
agpa dashboard 8080      # custom port
agpa dashboard --profile work   # launch with specific profile
  • Stats: XP, level, total achievements, streak, tasks, tool uses
  • Heatmap: GitHub-style 4-month activity grid
  • Showcase: Pinned favorite achievements (up to 6)
  • Achievement Grid: search, sort by rarity/category, filter unlocked/locked
  • Sound toggle: 8-bit rarity-graded effects
  • Share button: generates a beautiful bilingual card โ†’ PNG download

Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚   Engine (src/engine/)   โ”‚
                    โ”‚   track() / poll()       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†—                    โ†–
            MCP Server               Hook CLI
          (src/main.ts)           (src/cli/hook.ts)
                โ”‚                        โ”‚
          STDIO long-lived      short-lived subprocess
                โ”‚                  (stdin pipe)
                โ”‚                        โ”‚
          Agent calls             Hooks fire
          consciously             automatically
                โ”‚                        โ”‚
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚ Manual     โ”‚          โ”‚ Auto-track  โ”‚
          โ”‚ image.read โ”‚          โ”‚ tool.completeโ”‚
          โ”‚ lang_used  โ”‚          โ”‚ file.edit   โ”‚
          โ”‚ plan.mode  โ”‚          โ”‚ session.*   โ”‚
          โ”‚ ...        โ”‚          โ”‚ agent.spawn โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ•ฒ            โ•ฑ
                     event.log  โ† both write here
                          โ”‚
                     engine.poll()
                          โ”‚
                     state.json
                          โ”‚
                     Dashboard

Project Structure

src/
โ”œโ”€โ”€ main.ts                  # MCP Server entry (STDIO)
โ”œโ”€โ”€ tool-registry.ts         # Central tool registration
โ”œโ”€โ”€ cli/
โ”‚   โ”œโ”€โ”€ index.ts             # Unified CLI entry (27 commands)
โ”‚   โ”œโ”€โ”€ hook.ts              # Hook CLI (track + poll + auto modes)
โ”‚   โ”œโ”€โ”€ init.ts              # Interactive install wizard
โ”‚   โ”œโ”€โ”€ dashboard.ts         # Dashboard launcher
โ”‚   โ”œโ”€โ”€ doctor.ts            # System diagnostic
โ”‚   โ””โ”€โ”€ ...                  # 22 more CLI commands
โ”œโ”€โ”€ engine/
โ”‚   โ”œโ”€โ”€ engine.ts            # Core engine (track / poll / stats)
โ”‚   โ”œโ”€โ”€ evaluator.ts         # 12 condition type evaluators
โ”‚   โ”œโ”€โ”€ store.ts             # JSONL event log + state persistence
โ”‚   โ”œโ”€โ”€ types.ts             # TypeScript interfaces
โ”‚   โ””โ”€โ”€ yaml-parser.ts       # YAML achievement definition parser
โ”œโ”€โ”€ dashboard/
โ”‚   โ”œโ”€โ”€ server.ts            # HTTP server + API routes
โ”‚   โ”œโ”€โ”€ api.ts               # Card data, stats aggregation
โ”‚   โ”œโ”€โ”€ public/              # Zero-framework HTML/CSS/JS frontend
โ”‚   โ””โ”€โ”€ customize-api.ts     # Self-customize endpoint
โ”œโ”€โ”€ tools/                   # MCP tool definitions (7 tools)
โ”œโ”€โ”€ utils/                   # notify, validate, profile, pixel-art, battery, etc.
โ”œโ”€โ”€ verify/
โ”‚   โ””โ”€โ”€ auditor.ts           # Achievement verification logic
โ”œโ”€โ”€ config.ts                # Global configuration
โ””โ”€โ”€ helpers.ts               # Shared utilities

pixel-art-output/            # Logo images (README)
achievement-definitions.yaml   # 217 achievement definitions (authoritative)
scripts/                     # dev tools (logo gen, pixel art gen, sounds)

๐Ÿ”’ Security & Privacy

  • Local-first โ€” All event data stays in ~/.agent-achievements/. No telemetry, no cloud sync, no network calls at runtime.
  • Auditable โ€” The engine is pure TypeScript functions operating on JSONL files. No obfuscation, no binary blobs.
  • Minimal dependencies โ€” 5 runtime dependencies (@modelcontextprotocol/sdk, yaml, zod, figlet, tsx) โ€” all widely audited.
  • STDIO isolation โ€” The MCP server communicates via standard I/O only. No HTTP endpoints exposed.
  • Hook sandbox โ€” The Hook CLI runs as a sub-millisecond subprocess โ€” it cannot persist state or access the network.
  • Supply chain โ€” No native modules, no postinstall scripts, no binary downloads at install time.

To report a vulnerability, see SECURITY.md.

๐Ÿ‘ฅ Contributing

We welcome contributions! Whether it's an achievement pack, a Dashboard improvement, a new tool integration, or an engine fix โ€” there's a path for every skill level.

๐ŸŒ Environment Variables

VariableDescriptionDefaultValues
AGPA_PROFILEActive profile namedefaultany string
AGPA_LANGInterface languageenen, zh
AGPA_ENABLED_CATEGORIESFilter which achievement categories are activeallcomma-separated (e.g. onboarding,tool_mastery)
AGPA_DEBUGEnable verbose debug loggingfalsetrue
AGPA_SOUNDOverride sound effectsconfig settingon, off, true, false
AGPA_SIMPLE_ANIMATIONSUse simplified terminal animationsfalsetrue
AGPA_BANNER_THEMECLI startup banner styleArcadeNeon, Arcade, Gold
AGPA_TELEMETRYEnable anonymous usage telemetryfalsetrue, false
AGPA_TELEMETRY_SERVERCustom telemetry endpoint URL'' (none)URL string
AGPA_TOOL_SOURCEOverride tool source identifierauto-detectedclaude-code, hermes, openclaw, etc.
AGPA_MODELCurrent AI model name (for achievements)autoany model string

[!TIP] Environment variables override config.json settings. Set them in your shell profile or agent configuration for persistent overrides.

FAQ

Q: Does this slow down my agent? A: No. The Hook CLI is a sub-millisecond subprocess. The MCP server runs on STDIO with zero network overhead.

Q: Can I use it with multiple agents? A: Yes. The init wizard auto-detects Claude Code, Kilo Code, OpenCode, Hermes, and OpenClaw. Each can have its own profile.

Q: My achievements aren't unlocking? A: Run agpa doctor โ€” it diagnoses tracking status, hook registration, and event coverage.

Q: How is this different from WakaTime or coding activity trackers? A: WakaTime tells you what you did โ€” hours, languages, projects. AGPA makes it fun โ€” XP, levels, achievements, streaks, and Steam-style dopamine hits. It's gamification layered on top of your existing workflow, not another dashboard to check. Think of it as the difference between a fitness tracker's raw step count and a Pokรฉmon Go badge โ€” same data, different experience.

Q: Can I customize achievement names? A: Yes. /customize page in the dashboard lets you rename any achievement.

Troubleshooting

[!IMPORTANT] First step for any issue: Run agpa doctor โ€” it diagnoses tracking status, hook registration, event coverage, and configuration problems in one shot.

SymptomLikely CauseFix
Achievements not unlockingHook/MCP not registeredRun agpa doctor to check hook registration + event coverage
Dashboard won't startPort 3867 already in useagpa dashboard 8080 (or any free port)
agpa init failsAgent tool not detectedCheck supported tools list; use manual MCP JSON config as fallback
No macOS notificationsterminal-notifier missingRun brew install terminal-notifier, or agpa init auto-installs it
Sound not playingAudio context blocked by browserClick anywhere on the dashboard page to enable audio
Profile switching not workingProfile doesn't existagpa profile list to see available profiles, then agpa profile switch <name>
Hook CLI errors in agent logsstdin pipe is empty (expected for first run)Normal โ€” hooks are short-lived subprocesses; errors are logged to ~/.agent-achievements/error.log

For persistent issues, check ~/.agent-achievements/error.log or open an issue.

Star History

Star History Chart

License

MIT โ€” see LICENSE