@fruition/fcp-mcp-server 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FCP MCP Server
2
2
 
3
- MCP (Model Context Protocol) server that gives Claude Code direct access to the FCP Launch Coordination System.
3
+ MCP (Model Context Protocol) server that gives Claude Code direct access to the FCP Launch Coordination System. Also includes automatic time tracking integration with Unroo.
4
4
 
5
5
  ## Features
6
6
 
@@ -149,3 +149,76 @@ To get an API token for the MCP server:
149
149
  ### Tools not appearing
150
150
  - Restart Claude Code after updating settings
151
151
  - Check Claude Code logs for MCP server errors
152
+
153
+ ---
154
+
155
+ ## Time Tracking with Unroo
156
+
157
+ This package also includes `unroo-heartbeat`, a script that automatically tracks your Claude Code development time in Unroo.
158
+
159
+ ### Quick Setup
160
+
161
+ After installing the package globally (`npm install -g @fruition/fcp-mcp-server`), configure time tracking:
162
+
163
+ #### 1. Set your Unroo API key
164
+
165
+ Add to `~/.bashrc` or `~/.zshrc`:
166
+
167
+ ```bash
168
+ export UNROO_API_KEY="mcp_XXXXXX_your_key_here"
169
+ ```
170
+
171
+ Get your API key from Unroo: Settings → API Keys → Create with "Time Tracking" enabled.
172
+
173
+ #### 2. Configure Claude Code hooks
174
+
175
+ Add to `~/.claude/settings.json`:
176
+
177
+ ```json
178
+ {
179
+ "hooks": {
180
+ "PostToolUse": [
181
+ {
182
+ "matcher": "*",
183
+ "hooks": [
184
+ {
185
+ "type": "command",
186
+ "command": "unroo-heartbeat"
187
+ }
188
+ ]
189
+ }
190
+ ],
191
+ "Stop": [
192
+ {
193
+ "hooks": [
194
+ {
195
+ "type": "command",
196
+ "command": "unroo-heartbeat session_end"
197
+ }
198
+ ]
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ ```
204
+
205
+ #### 3. Restart Claude Code
206
+
207
+ Time tracking is now active. Sessions are automatically mapped to the correct Unroo project based on:
208
+ 1. `.unroo` file in project root (if present)
209
+ 2. Saved repo→project mappings (learned from previous sessions)
210
+ 3. Smart matching by repo name to Jira project key
211
+
212
+ ### Project Configuration (Optional)
213
+
214
+ For repos that don't auto-match, create a `.unroo` file:
215
+
216
+ ```bash
217
+ echo "project_slug=YOUR_JIRA_KEY" > .unroo
218
+ ```
219
+
220
+ The system learns from this and saves the mapping permanently, so you only need to do this once per repo.
221
+
222
+ ### Viewing Time
223
+
224
+ Log in to [Unroo](https://chat.frugpt.com) and check My Day or Timesheet to see your tracked sessions.
@@ -0,0 +1,90 @@
1
+ #!/bin/bash
2
+ # ============================================================================
3
+ # UNROO CLAUDE CODE HEARTBEAT SCRIPT
4
+ # ============================================================================
5
+ # Sends heartbeat signals to UnRoo time tracker API
6
+ # Called by Claude Code hooks on tool use events
7
+ #
8
+ # Usage:
9
+ # unroo-heartbeat.sh [event_type]
10
+ #
11
+ # Event types:
12
+ # tool_end (default) - After tool completes
13
+ # session_end - When Claude Code session ends
14
+ # heartbeat - Periodic heartbeat from watcher
15
+ #
16
+ # Environment variables:
17
+ # UNROO_API_KEY - Required: Your UnRoo API key with time tracking enabled
18
+ # UNROO_API_ENDPOINT - Optional: API base URL (default: https://chat.frugpt.com)
19
+ # TOOL_NAME - Optional: Name of the tool that was used
20
+ # TOOL_DESCRIPTION - Optional: Description of what the tool did
21
+ #
22
+ # Project Configuration:
23
+ # Create a .unroo file in your project root with:
24
+ # project_slug=YOUR_PROJECT_SLUG
25
+ # This maps time to the correct Unroo project (optional - auto-matching works for most repos).
26
+ #
27
+ # Installation:
28
+ # npm install -g @fruition/fcp-mcp-server
29
+ # Then set UNROO_API_KEY in your shell profile and configure Claude Code hooks.
30
+ # ============================================================================
31
+
32
+ # Configuration
33
+ EVENT_TYPE="${1:-tool_end}"
34
+ API_ENDPOINT="${UNROO_API_ENDPOINT:-https://chat.frugpt.com}"
35
+ API_URL="${API_ENDPOINT}/api/unroo/claude-tracker/heartbeat"
36
+
37
+ # Check for API key
38
+ if [ -z "$UNROO_API_KEY" ]; then
39
+ # Silently exit if no API key - don't block Claude Code
40
+ exit 0
41
+ fi
42
+
43
+ # Get git remote URL (if in a git repo)
44
+ GIT_REMOTE=""
45
+ if git rev-parse --git-dir > /dev/null 2>&1; then
46
+ GIT_REMOTE=$(git remote get-url origin 2>/dev/null || echo "")
47
+ fi
48
+
49
+ # Get repo name from current directory
50
+ REPO_NAME=$(basename "$(pwd)")
51
+
52
+ # Check for project-specific config (.unroo file)
53
+ PROJECT_SLUG=""
54
+ if [ -f ".unroo" ]; then
55
+ PROJECT_SLUG=$(grep -E "^project_slug=" .unroo 2>/dev/null | cut -d= -f2)
56
+ fi
57
+
58
+ # Get machine ID (for multi-machine tracking)
59
+ MACHINE_ID=""
60
+ if [ -f /etc/machine-id ]; then
61
+ MACHINE_ID=$(cat /etc/machine-id | head -c 8)
62
+ elif command -v hostid &> /dev/null; then
63
+ MACHINE_ID=$(hostid)
64
+ fi
65
+
66
+ # Build JSON payload
67
+ JSON_PAYLOAD=$(cat <<EOF
68
+ {
69
+ "api_key": "${UNROO_API_KEY}",
70
+ "event_type": "${EVENT_TYPE}",
71
+ "source": "claude-code",
72
+ "git_remote_url": "${GIT_REMOTE}",
73
+ "repo_name": "${REPO_NAME}",
74
+ "machine_id": "${MACHINE_ID}",
75
+ "tool_name": "${TOOL_NAME:-}",
76
+ "tool_description": "${TOOL_DESCRIPTION:-}",
77
+ "project_slug": "${PROJECT_SLUG:-}"
78
+ }
79
+ EOF
80
+ )
81
+
82
+ # Send heartbeat in background to not block Claude Code
83
+ # Redirect all output to /dev/null to avoid any terminal output
84
+ curl -s -X POST "$API_URL" \
85
+ -H "Content-Type: application/json" \
86
+ -d "$JSON_PAYLOAD" \
87
+ > /dev/null 2>&1 &
88
+
89
+ # Exit immediately - don't wait for curl
90
+ exit 0
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSche
13
13
  // Configuration
14
14
  const FCP_API_URL = process.env.FCP_API_URL || 'https://fcp.fru.io';
15
15
  const FCP_API_TOKEN = process.env.FCP_API_TOKEN || '';
16
- const UNROO_API_URL = process.env.UNROO_API_URL || 'https://frugpt.fruition.net';
16
+ const UNROO_API_URL = process.env.UNROO_API_URL || 'https://chat.frugpt.com';
17
17
  const UNROO_API_KEY = process.env.UNROO_API_KEY || '';
18
18
  // API Client
19
19
  class FCPClient {
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@fruition/fcp-mcp-server",
3
- "version": "1.1.0",
4
- "description": "MCP Server for FCP Launch Coordination System - enables Claude Code to interact with FCP launches",
3
+ "version": "1.2.0",
4
+ "description": "MCP Server for FCP Launch Coordination System - enables Claude Code to interact with FCP launches and track development time",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "fcp-mcp-server": "./dist/index.js"
8
+ "fcp-mcp-server": "./dist/index.js",
9
+ "unroo-heartbeat": "./bin/unroo-heartbeat.sh"
9
10
  },
10
11
  "files": [
11
- "dist"
12
+ "dist",
13
+ "bin"
12
14
  ],
13
15
  "scripts": {
14
16
  "build": "tsc",