feat: CLI, MCP server, Stripe Connect — agent-first course creation platform - #30
Merged
Conversation
…nnect Backend changes for CLI/agent platform: - ApiKey model + CRUD endpoints (gsk_ prefixed, SHA-256 hashed) - ApiKeyGuard for CLI authentication (Bearer gsk_*) - ReviewService with 10 mechanical quality checks (3 fully implemented, 7 stubs) - POST /orgs/:orgId/courses/review — run quality checks on YAML - POST /orgs/:orgId/courses/:courseId/publish — review + flip isPublished - Updated import endpoint to accept publish flag with inline review gate - Stripe Connect: stripeConnectAccountId on Organization model - ConnectService: onboarding, revenue tracking (70/30 split), publish gating - RevenueEvent model for marketplace revenue tracking - Updated webhook handler for account.updated and invoice.paid Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI package with commander.js: - graspful validate — offline schema + DAG validation (auto-detects course/brand/academy) - graspful import — push YAML to API with --publish flag - graspful publish — flip isPublished via API - graspful review — 10 mechanical quality checks offline - graspful create course --scaffold-only — generate course skeleton - graspful create brand --niche — generate brand YAML with theme presets - graspful fill concept — add KP/problem stubs to a concept - graspful describe — course stats (concepts, KPs, problems, graph depth) - graspful login — token-based auth, saves to ~/.graspful/credentials.json - --format json on all commands for agent composability - Auth: GRASPFUL_API_KEY env var (agents) or stored JWT (humans) - API client with get/post/patch methods Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Split docs/adding-a-course.md: moved Step 8 (review-agent pass) and Step 11 (content quality rules) into docs/course-review-gate.md - Added docs/cli-agent-strategy.md (full CLI/agent platform plan) - Created content/brands/ with 5 brand YAML files converted from hardcoded configs: firefighter, electrician, javascript, posthog, graspful - Added content/brands/README.md with format docs and theme presets - Updated adding-a-course.md with CLI references and publishing section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Created llms.txt with behavioral instructions for AI agents - Fixed robots.txt — removed AI crawler blocks, allow public pages - Created /agents marketing page with MCP tools, workflow, pricing - Added /agents to sitemap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MCP server wrapping CLI commands for AI agent consumption: - graspful_scaffold_course, graspful_fill_concept (offline creation) - graspful_validate, graspful_review_course, graspful_describe_course (offline checks) - graspful_create_brand (offline generation) - graspful_import_course, graspful_publish_course, graspful_import_brand (API calls) - graspful_list_courses (API call) - Tool descriptions optimized as standalone documentation - Uses @modelcontextprotocol/sdk with JSON Schema inputs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Critical fixes: - Webhook error response no longer leaks internal error details - Revenue split uses single PLATFORM_FEE_PERCENT constant (no divergence) - CLI credentials file written with 0o600 permissions (owner-only) High fixes: - API key lastUsedAt update is truly fire-and-forget (no timing oracle) - ApiKeyGuard throws UnauthorizedException instead of returning false - Added CreateApiKeyDto with validation (@IsString, @maxlength) - Added ImportCourseDto/ReviewCourseDto with 1MB size limit on YAML - Validate priceId format before sending to Stripe - Replace session.url! with explicit null checks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… agents page 25 new e2e tests: - API key management: CRUD, auth with gsk_ key, invalid key 401 - Course import: draft import, review checks, publish gate, error handling - Billing: subscription status, Connect status, revenue for new orgs - Brands: list, get by slug/domain, 404 cases - Agents page: hero, MCP tools, supported agents, pricing, CTAs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full README covering: what Graspful is, how it works (two-YAML workflow), quick start, tech stack, architecture, CLI commands, MCP server setup, development instructions, 70/30 revenue model, and documentation links. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ful/shared to npm Workflow triggers: - Push v* tag: publishes all three packages - Push cli@*, mcp@*, shared@* tags: publishes specific package - Manual dispatch with package selector and dry-run option Uses bun publish which resolves workspace:* to actual versions. Publishes shared first (cli and mcp depend on it). Requires NPM_TOKEN secret. Also: make @graspful/shared publishable (remove private: true) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation of the Graspful CLI and MCP server — making course creation a callable primitive for AI agents.
What's new
Packages
@graspful/cli— 9 commands: validate, import, publish, review, create course/brand, fill concept, describe, login@graspful/mcp— MCP server with 10 agent-optimized tools@graspful/shared— Zod schemas (course, academy, brand), quality gate interfacesBackend
gsk_prefix, SHA-256 hashed, org-scoped)POST /courses/review— 10 mechanical quality checksPOST /courses/:id/publish— review gate + flip isPublished--publishflag runs review gate inlineRevenueEventtracking, onboarding flowConnectServicewith checkout routing, webhook handlers, payout dashboard endpointsFrontend
/agentsmarketing page with MCP tools, workflow, pricingllms.txtwith behavioral instructions for AI agentsrobots.txt— removed AI crawler blocksDocs & Content
adding-a-course.md→ creation workflow +course-review-gate.mdCI
Security fixes (from code review)
Tests
Test plan
bun run build— all packages compilebun run test— 528 backend tests passnpx next build)npx @graspful/cli --helpafter npm publishNPM_TOKENsecret in repo settings before first publish🤖 Generated with Claude Code