Spaces:
Running
license: mit
title: FocusFlow AI
sdk: docker
emoji: π
colorFrom: indigo
colorTo: blue
short_description: FocusFlow is AI productivity helper + task tracker MCP
tags:
- mcp-in-action-track-consumer
- mcp-in-action-track-creative
- building-mcp-track-consumer
- building-mcp-track-creative
- anthropic
- gemini
- openai
- elevenlabs
thumbnail: >-
https://cdn-uploads.huggingface.co/production/uploads/64e5b6b857d6d38e126ca802/6MD7sz2ThFOglZ2D6ZEve.png
π¦ FocusFlow - AI Productivity Accountability Agent
Your Duolingo-style AI buddy that keeps you focused while coding.
Link to demo video: YouTube Link to LinkedIn post: LInkedIn Link to X: X
π― The Problem
"I'll just check Reddit for 5 minutes while wait for inspiration..." -> 3 hours later.
Developers and creators often struggle with:
- Task Paralysis: Overwhelmed by big projects.
- Context Switching: Getting lost in unrelated rabbit holes.
- Lack of Accountability: No one to gently nudge you back to work.
- "Busy" vs. Productive: Doing work that doesn't actually move the needle.
β¨ The Solution
FocusFlow is an AI-powered productivity partner that monitors your actual work (file changes, git commits) and gently nudges you when you drift off track. It's not a micromanager; it's a friendly companion that helps you maintain momentum.
- Breaks down projects into 5-8 micro-tasks (15-30 min each)
- Monitors your workspace in real-time (file changes or text input)
- Provides Duolingo-style nudges when you get distracted or idle
- Tracks focus metrics with streaks, scores, and visualizations
- Integrates with LLMs via MCP (Model Context Protocol) for natural language task management
- Integrates with Linear MCP for project management
π Features
| Feature | Description |
|---|---|
| π¦ Duolingo-style Nudges | Friendly, personality-driven reminders to stay on track. |
| π MCP Integration | Connects with tools like Claude Desktop for natural language task execution and management. |
| π Linear Sync | Import projects and tasks directly from Linear (via API). |
| ποΈ Focus Monitoring | Real-time file system monitoring to detect actual work. |
| π‘οΈ Privacy First | Support for local LLMs (Ollama) or private API keys. |
| π Pomodoro Timer | Built-in timer with break reminders and audio alerts. |
| π Productivity Stats | Track streaks, focus scores, and daily progress. |
| π£οΈ Voice Feedback | (Optional) ElevenLabs integration for spoken encouragement. |
ποΈ Architecture
+----------------+ +------------------+ +----------------+
| Claude Desktop | <--> | FocusFlow (MCP) | <--> | Linear API |
| (MCP Client) | | (Gradio App) | | (Task Source) |
+----------------+ +------------------+ +----------------+
^ |
| v
| +------------------+
| | Local File Sys |
| | (Watchdog) |
| +------------------+
| |
| v
+----------------+ +------------------+
| User Workspace | <--> | AI Agent Logic |
| (Code/Docs) | | (LLM / Mock) |
+----------------+ +------------------+
focusflow/
βββ app.py # Main Gradio application
βββ agent.py # AI focus agent (OpenAI/Anthropic/Mock)
βββ storage.py # Task manager with SQLite
βββ monitor.py # File monitoring with watchdog
βββ metrics.py # Productivity tracking
βββ mcp_tools.py # MCP tools and resources
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
βββ README.md # This file
β‘ Quick Start
1. Installation
Option A: Hugging Face Spaces (Try it now!) Click the "Try It" button above to run the demo version in your browser.
Option B: Local Setup (Recommended for full features)
# Clone the repository
git clone https://github.com/Rebell-Leader/FocusFlow.git
cd FocusFlow
# Install dependencies
pip install -r requirements.txt
# Run the app
python app.py
2. Onboarding
- Open
http://localhost:5000. - Home Tab: Check your AI provider status.
- Onboarding Tab: Describe your project (e.g., "Build a React Native weather app") or import from Linear.
- Task Manager: See your decomposed micro-tasks.
- Monitor: Start working! FocusFlow will watch your file changes and update your status.
π‘οΈ Privacy & AI Providers
FocusFlow gives you full control over your data.
| Mode | Description | Best For |
|---|---|---|
| Local (Ollama/vLLM) | Runs 100% on your machine. No data leaves your network. | π Maximum Privacy |
| Cloud (OpenAI/Anthropic/Gemini) | Uses external APIs for smarter reasoning. | π§ Best Performance |
| Mock AI | Uses predefined responses. No API keys needed. | π§ͺ Testing / Demos |
To configure, set AI_PROVIDER in your .env file (see below).
π MCP Server Documentation
FocusFlow implements the Model Context Protocol (MCP), allowing you to control it directly from Claude Desktop or other MCP clients.
Connection Guide (Claude Desktop)
- Prerequisite: Ensure FocusFlow is running (
python app.py). - Locate Config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Add Server:
{
"mcpServers": {
"focusflow": {
"url": "http://<YOUR_LOCAL_IP>:5000/gradio_api/mcp"
}
}
}
Note: If running on WSL, you may need to use the SSE endpoint URL instead.
"mcpServers": {
"focusflow": {
"command": "npx",
"args": [
"mcp-remote",
"http://172.30.9.188:5000/gradio_api/mcp",
"--allow-http"
]
}
}
Replace <YOUR_LOCAL_IP> with the IP address of your local machine or WSL (e.g., 172.x.x.x).
Exposed Tools
| Tool | Signature | Description |
|---|---|---|
add_task |
(title: str, description: str, duration: int) |
Create a new task. |
get_current_task |
() |
Get the currently active task details. |
start_task |
(task_id: int) |
Mark a task as 'In Progress'. |
mark_task_done |
(task_id: int) |
Complete a task. |
get_all_tasks |
() |
List all tasks and statuses. |
get_productivity_stats |
() |
Get focus scores and streaks. |
Exposed Resources
focusflow://tasks/all: JSON list of all tasks.focusflow://tasks/active: JSON details of active task.focusflow://stats: Current productivity metrics.
API Response Format
Tools return strings that are formatted for human/LLM reading, but resources return JSON.
Example get_current_task response:
π Current Active Task:
- ID: 12
- Title: Implement Auth
- Status: In Progress
Example focusflow://tasks/active resource:
{
"id": 12,
"title": "Implement Auth",
"status": "In Progress",
"estimated_duration": "30 min"
}
Error Handling
All tools return descriptive error messages starting with β if something goes wrong.
- Task Not Found:
β Task 99 not found. Use get_all_tasks() to see available tasks. - Invalid Status:
β Failed to start task. Task is already marked as Done. - System Error:
β Error creating task: [Error Details]
Example Usage (Claude)
User: "What should I be working on?"
Claude: (Calls
get_current_task) "You are currently working on 'Implement Auth Middleware'. You've been focused for 15 minutes."
User: "Add a task to fix the login bug."
Claude: (Calls
add_task) "Added 'Fix login bug' to your list."
π Linear Integration
FocusFlow integrates with Linear via their GraphQL API to sync your projects and tasks.
Setup
- Get your Linear API Key: https://linear.app/settings/api
- Add it to your
.envfile:LINEAR_API_KEY=lin_api_...
How it Works
- Import: In the "Onboarding" tab, FocusFlow fetches your Linear projects using
viewer { projects }. - Sync: It pulls active issues using
project { issues }. - Create: You can create new tasks in FocusFlow, which pushes them to Linear via
issueCreate.
(Screenshots of Linear import flow would go here)
βοΈ Configuration
Copy .env.example to .env and configure your preferences:
# .env example
# --- Launch Mode ---
# 'local': Monitors file system changes (Best for personal use)
# 'demo': Text-area simulation (Best for Hugging Face Spaces)
LAUNCH_MODE=local
# --- AI Provider ---
# Options: openai, anthropic, gemini, vllm, mock
AI_PROVIDER=anthropic
# --- API Keys ---
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
LINEAR_API_KEY=lin_api_...
# --- MCP ---
ENABLE_MCP=true
π€ Contributing
Contributions are welcome!
- Fork the repo.
- Create a feature branch.
- Submit a Pull Request.
π License
MIT License. See LICENSE for details.
π Acknowledgments
- Built for the Gradio MCP Hackathon - competing for Track 1: Building MCP
- Voice integration powered by ElevenLabs - competing for $2,000 Best Use of ElevenLabs sponsor award
- Inspired by Duolingo's encouraging UX
- Uses Model Context Protocol for LLM integration
Made with β€οΈ for the Gradio MCP Hackathon. Hoot hoot! π¦