mcp-server
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"eureka-tasks": {
"args": [
"tsx",
"/Users/yourname/workspace/eurekalabo/mcp-server/src/index.ts"
],
"command": "npx",
"env": {
"EUREKA_API_KEY": "pk_live_...",
"EUREKA_API_URL": "https://eurekalabo.162-43-92-100.nip.io"
}
}
}
}
服务介绍
Eureka Labo MCP Server
Model Context Protocol (MCP) server for Eureka Labo task management with automated git change tracking.
Features
- Task Management - List, create, update tasks via MCP
- Work Sessions - Track development work with git integration
- Change Logging - Automatically capture and log file changes
- React Diff Support - Generate diffs compatible with react-diff-viewer
- API Key Auth - Secure project-scoped access
Prerequisites
- Node.js 18+
- Git repository for workspace
- Eureka Labo API access with generated API key
Installation
cd /path/to/eurekalabo/mcp-server
npm install
Configuration
1. Generate API Key
- Open your project in Eureka Labo UI
- Go to Project Settings API Keys
- Click "Create API Key"
- Select permissions:
read:projectread:taskswrite:tasksassign:tasksread:members
- Copy the key (shown only once!)
Important: The API key is project-scoped, meaning it automatically grants access to the specific project it was created for. The MCP server will automatically detect which project you're working with.
2. Create Environment File
cp .env.example .env
Edit .env:
# Your Eureka Labo API URL (production URL with HTTPS)
EUREKA_API_URL=https://eurekalabo.162-43-92-100.nip.io
# Your project-specific API key (starts with pk_live_)
EUREKA_API_KEY=pk_live_your_personal_api_key_here
# WORKSPACE_PATH is optional - automatically uses Claude Code's current directory
# Only uncomment if you need to override:
# WORKSPACE_PATH=/path/to/your/git/repository
3. Configure Claude Code
Add to ~/.claude/mcp.json:
{
"mcpServers": {
"eureka-tasks": {
"command": "npx",
"args": [
"tsx",
"/Users/yourname/workspace/eurekalabo/mcp-server/src/index.ts"
],
"env": {
"EUREKA_API_URL": "https://eurekalabo.162-43-92-100.nip.io",
"EUREKA_API_KEY": "pk_live_..."
}
}
}
}
Note:
- The MCP server automatically uses the directory where Claude Code is opened. No need to specify
WORKSPACE_PATH! - The project ID is automatically fetched from your API key on initialization, so you don't need to configure it manually.
Usage
Task Management
# List all tasks
@eureka-tasks list_tasks
# Filter by status
@eureka-tasks list_tasks {"status": "todo"}
# Get specific task
@eureka-tasks get_task {"taskId": "cmXXXXXXXXXXX"}
# Create task
@eureka-tasks create_task {
"title": "Implement JWT authentication",
"description": "Add JWT token verification middleware",
"priority": "high"
}
# Update task
@eureka-tasks update_task {
"taskId": "cmXXXXXXXXXXX",
"status": "in_progress"
}
Development Workflow
# 1. Start work on a task (captures git baseline)
@eureka-tasks start_work_on_task {"taskId": "cmXXXXXXXXXXX"}
# 2. Do your development work (edit files)
# Note: 不要未変更自動的
# 3. Complete work (captures all changes and logs to task)
@eureka-tasks complete_task_work {
"taskId": "cmXXXXXXXXXXX",
"summary": "bcrypt使用JWT認証実装"
}
# This will:
# - Capture all changes from baseline (includes uncommitted changes!)
# - Store full diffs in task metadata (for react-diff-viewer in UI)
# - Update task description with formatted change summary in Japanese
# - Update task status to "done"
重要変更点:
- 不要: 未変更自動的
- 変更: working directory現在状態取得
- 柔軟性: 動作
説明完了後
## 実装概要
bcrypt使用JWT認証実装
## 変更統計
- **変更数**: 3個
- **追加行数**: +243行
- **削除行数**: -12行
- ****: `feature/auth`
- ****: `def456g`
## 変更一覧
`src/middleware/auth.ts` (+45/-12)
`tests/auth.test.ts` (+78/0)
`docs/auth.md` (+120/0)
---
*詳細差分保存UIreact-diff-viewer使用表示*
Utilities
# List project members (for task assignment)
@eureka-tasks list_project_members {"projectId": "cmXXXXXXXXXXX"}
# Upload file attachment
@eureka-tasks upload_task_attachment {
"taskId": "cmXXXXXXXXXXX",
"filePath": "/path/to/file.pdf"
}
# Check active work sessions
@eureka-tasks get_active_sessions
# Cancel work session
@eureka-tasks cancel_work_session {"taskId": "cmXXXXXXXXXXX"}
Work Session Flow
Complete Workflow Example
1. 開発者UI作成: "認証追加"
2. Claude Code作業開始:
Claude> @eureka-tasks start_work_on_task {"taskId": "cm123"}
Response: Started work session (baseline: abc123)
3. Claude Code編集:
- src/middleware/auth.ts
- tests/auth.test.ts
- docs/auth.md
4. 不要
# 未変更自動的
# 場合OK
git add .
git commit -m "Add JWT authentication"
5. Claude Code作業完了:
Claude> @eureka-tasks complete_task_work {
"taskId": "cm123",
"summary": "包括的含JWT認証実装"
}
Response: 作業完了
- 変更: 3個
- 追加: +243行
- 削除: -12行
説明更新
6. Eureka Labo UI表示:
- : "完了"
- 説明: 日本語概要 + 一覧 + 統計
- : react-diff-viewer用完全差分
oldValue: 変更前全体
newValue: 変更後全体working directory取得
unifiedDiff: git unified diff形式
- 変更: 付並列差分表示
Change Log Format
Changes are stored in relational tables WorkSession and WorkSessionChange:
-- WorkSession table
CREATE TABLE "WorkSession" (
"id" TEXT PRIMARY KEY,
"taskId" TEXT REFERENCES "Task"(id) ON DELETE CASCADE,
"sessionId" TEXT UNIQUE,
"startedAt" TIMESTAMP NOT NULL,
"completedAt" TIMESTAMP,
"summary" TEXT,
"gitBaseline" TEXT NOT NULL,
"gitFinal" TEXT NOT NULL,
"branch" TEXT NOT NULL,
"statistics" JSONB NOT NULL, -- { filesChanged, linesAdded, linesRemoved }
"createdAt" TIMESTAMP DEFAULT NOW(),
"updatedAt" TIMESTAMP DEFAULT NOW()
);
-- WorkSessionChange table
CREATE TABLE "WorkSessionChange" (
"id" TEXT PRIMARY KEY,
"workSessionId" TEXT REFERENCES "WorkSession"(id) ON DELETE CASCADE,
"file" TEXT NOT NULL,
"changeType" TEXT NOT NULL, -- 'added' | 'modified' | 'deleted'
"linesAdded" INTEGER NOT NULL,
"linesRemoved" INTEGER NOT NULL,
"language" TEXT NOT NULL,
"oldValue" TEXT NOT NULL, -- Full old file content
"newValue" TEXT NOT NULL, -- Full new file content
"unifiedDiff" TEXT NOT NULL, -- Git unified diff
"createdAt" TIMESTAMP DEFAULT NOW()
);
Example Data:
// WorkSession record
{
"id": "cm123abc456",
"taskId": "cmXXXXXXXXXXX",
"sessionId": "session_1738051200000",
"startedAt": "2025-01-28T10:00:00Z",
"completedAt": "2025-01-28T10:45:00Z",
"summary": "Implemented JWT authentication",
"gitBaseline": "abc123def",
"gitFinal": "def456ghi",
"branch": "feature/auth",
"statistics": {
"filesChanged": 3,
"linesAdded": 243,
"linesRemoved": 12
},
"changes": [
// WorkSessionChange records (joined)
{
"id": "cmCHG001",
"workSessionId": "cm123abc456",
"file": "src/middleware/auth.ts",
"changeType": "modified",
"linesAdded": 45,
"linesRemoved": 12,
"language": "typescript",
"oldValue": "// full old file content",
"newValue": "// full new file content",
"unifiedDiff": "@@ -10,5 +10,8 @@ ..."
}
]
}
Supported Languages
Automatic syntax highlighting for:
- TypeScript/JavaScript (.ts, .tsx, .js, .jsx)
- Python (.py)
- Go (.go)
- Rust (.rs)
- Java (.java)
- C/C++ (.c, .cpp, .h, .hpp)
- Ruby (.rb)
- PHP (.php)
- And 20+ more languages
Troubleshooting
"Workspace is not a git repository"
cd /path/to/your/project
git init
git add .
git commit -m "Initial commit"
"変更検出"
# 以下確認
# 1. 実際編集
# 2. 正作業git内
# 3. start_work_on_task 実行編集
#
git status # 変更確認
git diff # 差分確認
"Authentication failed"
- Check API key is correct in
.env - Verify key hasn't expired in Eureka Labo UI
- Ensure key has required permissions
"No active work session found"
complete_task_work実行前必start_work_on_task実行
# 正順序
@eureka-tasks start_work_on_task {"taskId": "..."} # 1. 開始
# 編集 # 2. 作業
@eureka-tasks complete_task_work {"taskId": "...", "summary": "..."} # 3. 完了
Development
# Run in development mode
npm run dev
# Build for production
npm run build
# Start production build
npm start
Architecture
mcp-server/
src/
index.ts # MCP server entry point
config.ts # Environment configuration
api/
client.ts # Eureka API wrapper
tools/
task-tools.ts # Task CRUD operations
work-session.ts # Work session management
tracking/
git-tracker.ts # Git diff capture
package.json
tsconfig.json
.env
License
MIT