Stu Mason
Stu Mason

Activity

StuMason/progress
stumason.dev
TypeScript
Pull Request Merged

PR #21 merged: Add API v1 endpoints and MCP server for Progress data

Summary

  • Adds authenticated REST API endpoints for querying activities and articles
  • Introduces MCP (Model Context Protocol) server so AI assistants like Claude Code can directly query Progress data
  • Adds Sanctum token support to User model

API Endpoints

All endpoints require auth:sanctum middleware:

MethodEndpointDescription
GET/api/v1/activitiesList activities with filtering (from, to, type, limit)
GET/api/v1/activities/{uid}Get single activity by UID
GET/api/v1/articlesList articles with filtering (from, to, status, limit)
GET/api/v1/articles/{slug}Get single article by slug
GET/api/v1/summaryAggregated stats (counts by type, repos, date range)

MCP Server

Exposes 5 read-only tools at /mcp/progress:

  • ListActivitiesTool - Query activities with date/type filtering
  • GetActivityTool - Get single activity by UID
  • ListArticlesTool - Query articles with date/status filtering
  • GetArticleTool - Get single article by slug
  • ActivitySummaryTool - Aggregated stats for date range

Other Changes

  • Add HasApiTokens trait to User model for Sanctum API tokens
  • Improve FeedItem::scopeForUser to properly check repository pivot table
  • Create ArticleData DTO following existing patterns
  • Flesh out ArticleFactory with proper defaults

Test plan

  • 22 new feature tests for all API endpoints
  • Existing Feed tests still pass (30 tests)
  • Manual test with MCP inspector: php artisan mcp:inspector mcp/progress
  • Test API with curl using Sanctum token

šŸ¤– Generated with Claude Code

+1281
additions
-3
deletions
22
files changed