stumason.dev
TypeScript
Pull Request Opened
PR #21 opened: 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:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/activities | List activities with filtering (from, to, type, limit) |
| GET | /api/v1/activities/{uid} | Get single activity by UID |
| GET | /api/v1/articles | List articles with filtering (from, to, status, limit) |
| GET | /api/v1/articles/{slug} | Get single article by slug |
| GET | /api/v1/summary | Aggregated stats (counts by type, repos, date range) |
MCP Server
Exposes 5 read-only tools at /mcp/progress:
ListActivitiesTool- Query activities with date/type filteringGetActivityTool- Get single activity by UIDListArticlesTool- Query articles with date/status filteringGetArticleTool- Get single article by slugActivitySummaryTool- Aggregated stats for date range
Other Changes
- Add
HasApiTokenstrait to User model for Sanctum API tokens - Improve
FeedItem::scopeForUserto properly check repository pivot table - Create
ArticleDataDTO following existing patterns - Flesh out
ArticleFactorywith 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