Skip to content

chiKeka/loop-mcp

Repository files navigation

Loop

A persistent learning companion that observes how you grow — across any domain, any tool, any session.

Loop is an MCP server that quietly tracks your learning patterns, detects blind spots, and nudges your development. It works with Claude.ai, Claude Code, mobile, or any MCP-compatible client.

What it does

  • Observes your decisions, struggles, completions, questions, and avoidances
  • Detects blind spots — recurring patterns you might not notice
  • Nudges at the right moment — calibrated to where you are (survival, transitional, or generative mode)
  • Reviews your trajectory weekly — connecting sessions into growth arcs
  • Works across domains — coding, language learning, music, business, anything

Quick Start

Hosted (recommended)

Sign up and get an API key:

curl -X POST https://loop-mcp.fly.dev/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Then connect from Claude.ai, Claude Code, or any MCP client:

Claude Code:

claude mcp add loop --transport http https://loop-mcp.fly.dev/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Claude.ai: Settings > MCP Servers > Add Remote Server

  • URL: https://loop-mcp.fly.dev/mcp
  • Header: Authorization: Bearer YOUR_API_KEY

Local (offline mode)

npx loop-mcp

Or add to Claude Code:

claude mcp add loop -- npx loop-mcp

How it works

  1. Start a session — Loop gives your AI assistant context about your learning trajectory
  2. Work normally — the AI observes your patterns and calls loop_observe in the background
  3. Get nudged — developmental prompts calibrated to where you are
  4. Grow — blind spots surface, patterns emerge, trajectory becomes visible

Sessions auto-group by time. No need to explicitly start or stop — just work.

Configuration

Hosted mode

Set via your dashboard or API:

Setting Default Description
threshold transitional Your developmental stage: survival, transitional, or generative
anthropic_api_key Bring your own key for analysis (optional, server provides fallback)

Local mode

Set via environment variables:

Variable Default Description
ANTHROPIC_API_KEY Enables blind spot analysis, nudges, and weekly reviews
LOOP_DB_PATH ~/.loop/data/loop.db Where your learning data is stored
LOOP_THRESHOLD survival Your developmental stage

API

REST Endpoints (hosted mode)

Endpoint Description
POST /api/auth/signup Create account, get API key
GET /api/profile Your learner profile
PUT /api/profile Update settings (threshold, BYOK key)
GET /api/sessions Session history
GET /api/sessions/:id Session details with observations
GET /api/insights/blind-spots Active blind spots
GET /api/insights/weekly-reviews Weekly trajectory reviews
GET /api/insights/trajectory Current trajectory summary

MCP Tools

Tool Description
loop_ping Health check
loop_session_start Begin a session with developmental context
loop_session_end End session, trigger weekly review if due
loop_observe Record an observation (ambient — session auto-resolves)
loop_get_nudge Get next developmental nudge
loop_reflect On-demand trajectory reflection

MCP Resources

URI Description
loop://learner-profile Your developmental model
loop://blind-spots Active blind spots
loop://weekly-review Latest trajectory review

Architecture

┌──────────────────────────────────────────────┐
│                  Clients                     │
│  Claude.ai · Claude Code · Mobile · Any MCP │
└──────────┬───────────────────────────────────┘
           │  HTTPS (Streamable HTTP + SSE)
┌──────────▼───────────────────────────────────┐
│            Loop Server (Fly.io)              │
│                                              │
│  MCP Tools ── observe, nudge, reflect        │
│  Resources ── profile, blind-spots, reviews  │
│  Analysis ── blind spots, mode detection     │
│  API ── signup, profile, sessions, insights  │
│                                              │
│  Postgres (persistent, multi-user)           │
└──────────────────────────────────────────────┘

Self-hosting

git clone https://github.com/chiKeka/loop-mcp.git
cd loop-mcp
npm install
npm run build

# Local mode (stdio)
npm start

# Hosted mode (HTTP)
DATABASE_URL=postgres://... ANTHROPIC_API_KEY=sk-... npm run start:hosted

Deploy to Fly.io

fly launch
fly postgres create --name loop-db
fly postgres attach loop-db
fly secrets set ANTHROPIC_API_KEY=sk-...
fly deploy

License

MIT

About

Loop. A persistent developmental layer between human agency and AI capability. MCP server that tracks how you learn and grow as a developer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors