diff --git a/PLAN.md b/PLAN.md deleted file mode 100644 index 59f78dd..0000000 --- a/PLAN.md +++ /dev/null @@ -1,552 +0,0 @@ -# Ghost MCP Implementation Plan - -This document outlines the comprehensive implementation plan for the Ghost MCP server, distributed across multiple phases with research steps and clear success criteria. - -## Overview - -The Ghost MCP server will provide complete Ghost CMS functionality through the Model Context Protocol, supporting both read (Content API) and write (Admin API) operations with 44+ tools covering all Ghost REST API endpoints. - -## Phase Distribution - -- **Phase 0**: Research & Setup (1-2 days) -- **Phase 1**: Core Infrastructure (2-3 days) -- **Phase 2**: Content API Implementation (2-3 days) -- **Phase 3**: Admin API Core (3-4 days) -- **Phase 4**: Advanced Admin Features (3-4 days) -- **Phase 5**: Advanced Features (Stubs) (2-3 days) -- **Phase 6**: Testing & Documentation (2-3 days) - -**Total Estimated Time**: 15-22 days - ---- - -## Phase 0: Research & Setup - -### Objectives -- Deep research into Ghost API authentication and patterns -- Set up development environment with Ghost instance -- Create project scaffolding and initial configuration - -### Tasks - -#### 0.1 Ghost API Research -- **Task**: Research Ghost Admin API JWT authentication flow - - Investigate JWT token generation process - - Document authentication headers and token refresh - - Test Admin API endpoints with different authentication methods -- **Task**: Research Ghost Content API authentication - - Document query parameter authentication - - Test rate limiting and caching behavior -- **Task**: Research Ghost API error response formats - - Document all possible error codes and formats - - Map Ghost errors to appropriate MCP error responses -- **Task**: Research Ghost filtering syntax - - Document basic and advanced filtering options - - Test filter combinations and edge cases - - Plan Phase 1 vs Phase 2 filtering implementation - -#### 0.2 Development Environment Setup -- **Task**: Create Docker Compose setup - - Set up Ghost with MySQL - - Create admin account and obtain API keys - - Test both Content and Admin API access -- **Task**: Initialize Node.js project - - Set up TypeScript configuration - - Install core dependencies (@modelcontextprotocol/sdk, axios, etc.) - - Configure development tools (eslint, prettier, etc.) - -#### 0.3 Project Scaffolding -- **Task**: Create project structure according to SPEC.md - - Set up directory structure (src/tools/content, src/tools/admin, etc.) - - Create placeholder files for all major components - - Set up package.json with all required dependencies - -### Research Questions to Answer -1. How exactly does Ghost Admin API JWT authentication work? -2. What are the specific error response formats for different failure scenarios? -3. What are the rate limits and best practices for Ghost API usage? -4. How does Ghost handle concurrent requests and connection pooling? -5. What are the exact file upload requirements and limitations? - -### Success Criteria -- [ ] Local Ghost instance running and accessible -- [ ] Both Content and Admin API keys obtained and tested -- [ ] Project structure created with all placeholder files -- [ ] All dependencies installed and TypeScript compiling -- [ ] Research documentation completed for authentication flows -- [ ] Clear understanding of Ghost API error handling - -### Dependencies -- Docker and Docker Compose installed -- Node.js v18+ installed -- Access to Ghost documentation - ---- - -## Phase 1: Core Infrastructure - -### Objectives -- Implement configuration system with precedence (env vars → .env → defaults) -- Set up authentication for both Content and Admin APIs -- Implement comprehensive logging system -- Create error handling infrastructure - -### Tasks - -#### 1.1 Configuration System -- **Task**: Implement configuration loading with precedence - - Create config loader that reads .env file first, then environment variables - - Implement validation for required vs optional configuration - - Add support for operation modes (readonly, readwrite, auto) -- **Task**: Create configuration types and validation - - Define TypeScript interfaces for all configuration options - - Implement Zod schemas for runtime validation - - Add configuration validation on startup - -#### 1.2 Authentication Infrastructure -- **Task**: Implement Content API authentication - - Create Content API client with query parameter authentication - - Add automatic retry logic for authentication failures -- **Task**: Implement Admin API JWT authentication - - Research and implement JWT token generation - - Create token refresh mechanism - - Handle token expiration gracefully -- **Task**: Create unified Ghost client - - Abstract both Content and Admin API access - - Implement automatic API selection based on operation and available keys - - Add connection pooling and request optimization - -#### 1.3 Logging System -- **Task**: Set up structured logging - - Configure Winston or Pino for structured JSON logging - - Implement log levels (DEBUG, INFO, WARN, ERROR) - - Create log formatters with required fields (timestamp, tool_name, operation, etc.) -- **Task**: Add request ID tracking - - Generate unique request IDs for all operations - - Thread request IDs through all log messages - - Add request/response logging for Ghost API calls - -#### 1.4 Error Handling Infrastructure -- **Task**: Create comprehensive error types - - Define error classes for all error categories (network, auth, API, MCP, file upload) - - Map Ghost API errors to appropriate MCP error responses - - Implement error serialization for logging -- **Task**: Implement retry logic - - Add exponential backoff for transient errors - - Respect rate limit headers from Ghost API - - Implement authentication retry after token refresh - -### Success Criteria -- [ ] Configuration loads correctly with proper precedence -- [ ] Content API authentication working -- [ ] Admin API JWT authentication working with refresh -- [ ] Structured logging implemented with all required fields -- [ ] Error handling catches and logs all error categories -- [ ] Request ID tracking working end-to-end -- [ ] Retry logic implemented and tested - -### Dependencies -- Phase 0 completed -- Ghost instance accessible with API keys - ---- - -## Phase 2: Content API Implementation - -### Objectives -- Implement all 13 Content API MCP tools for read-only access -- Add comprehensive parameter validation and filtering -- Implement pagination support - -### Tasks - -#### 2.1 Content API Tools - Posts -- **Task**: Implement `ghost_list_posts` - - Add parameter validation (limit, page, filter, include, fields) - - Implement basic filtering support - - Add pagination metadata handling -- **Task**: Implement `ghost_get_post_by_id` - - Add ID validation and error handling - - Support include and fields parameters -- **Task**: Implement `ghost_get_post_by_slug` - - Add slug validation and URL encoding - - Handle not found scenarios - -#### 2.2 Content API Tools - Pages -- **Task**: Implement `ghost_list_pages` -- **Task**: Implement `ghost_get_page_by_id` -- **Task**: Implement `ghost_get_page_by_slug` - -#### 2.3 Content API Tools - Tags -- **Task**: Implement `ghost_list_tags` -- **Task**: Implement `ghost_get_tag_by_id` -- **Task**: Implement `ghost_get_tag_by_slug` - -#### 2.4 Content API Tools - Authors -- **Task**: Implement `ghost_list_authors` -- **Task**: Implement `ghost_get_author_by_id` -- **Task**: Implement `ghost_get_author_by_slug` - -#### 2.5 Content API Tools - Other -- **Task**: Implement `ghost_list_tiers` -- **Task**: Implement `ghost_get_settings` - -#### 2.6 Parameter Validation & Utilities -- **Task**: Create Zod schemas for all Content API parameters -- **Task**: Implement parameter validation middleware -- **Task**: Add response formatting utilities -- **Task**: Create filtering helper functions (Phase 1 basic filters) - -### Success Criteria -- [ ] All 13 Content API tools implemented and functional -- [ ] Parameter validation working for all tools -- [ ] Basic filtering working (featured:true, status:published, etc.) -- [ ] Pagination working with proper metadata -- [ ] Include and fields parameters working -- [ ] Error handling working for all error scenarios -- [ ] Comprehensive logging for all operations - -### Dependencies -- Phase 1 completed -- Content API authentication working - ---- - -## Phase 3: Admin API Core - -### Objectives -- Implement core Admin API CRUD operations for posts, pages, and tags -- Add create, update, copy, and delete functionality -- Implement proper Admin API authentication and error handling - -### Tasks - -#### 3.1 Admin API Tools - Posts -- **Task**: Implement `ghost_admin_list_posts` - - Support draft and published post filtering - - Add Admin API specific parameters -- **Task**: Implement `ghost_admin_get_post` -- **Task**: Implement `ghost_admin_create_post` - - Add comprehensive parameter validation for post creation - - Handle mobiledoc, lexical, and HTML content formats - - Support tag and author associations -- **Task**: Implement `ghost_admin_update_post` - - Add updated_at requirement for conflict resolution - - Support partial updates -- **Task**: Implement `ghost_admin_copy_post` -- **Task**: Implement `ghost_admin_delete_post` - -#### 3.2 Admin API Tools - Pages -- **Task**: Implement `ghost_admin_list_pages` -- **Task**: Implement `ghost_admin_get_page` -- **Task**: Implement `ghost_admin_create_page` -- **Task**: Implement `ghost_admin_update_page` -- **Task**: Implement `ghost_admin_copy_page` -- **Task**: Implement `ghost_admin_delete_page` - -#### 3.3 Admin API Tools - Tags -- **Task**: Implement `ghost_admin_list_tags` -- **Task**: Implement `ghost_admin_get_tag` -- **Task**: Implement `ghost_admin_create_tag` -- **Task**: Implement `ghost_admin_update_tag` -- **Task**: Implement `ghost_admin_delete_tag` - -#### 3.4 Admin API Infrastructure -- **Task**: Research and implement proper content creation workflows - - Understand Ghost's content format requirements - - Test different content input formats (HTML, Markdown, Lexical) - - Implement content validation -- **Task**: Add Admin API specific error handling - - Handle permission errors - - Handle resource conflicts (updated_at mismatches) - - Handle validation errors from Ghost - -### Research Areas -1. What are the exact requirements for Ghost content creation? -2. How does Ghost handle different content formats (HTML vs Lexical vs Mobiledoc)? -3. What validation does Ghost perform on create/update operations? -4. How should we handle resource relationships (posts ↔ tags, posts ↔ authors)? - -### Success Criteria -- [ ] All core CRUD operations working for posts, pages, tags -- [ ] Content creation working with proper validation -- [ ] Update operations handling conflicts correctly -- [ ] Delete operations working with proper confirmation -- [ ] Copy operations creating proper duplicates -- [ ] Admin API authentication working reliably -- [ ] Comprehensive error handling for all Admin API scenarios - -### Dependencies -- Phase 2 completed -- Admin API authentication working - ---- - -## Phase 4: Advanced Admin Features - -### Objectives -- Implement member management tools -- Add media upload functionality -- Implement tiers and webhook management -- Add advanced content features - -### Tasks - -#### 4.1 Member Management -- **Task**: Implement `ghost_admin_list_members` -- **Task**: Implement `ghost_admin_get_member` -- **Task**: Implement `ghost_admin_create_member` -- **Task**: Implement `ghost_admin_update_member` - -#### 4.2 Media Management -- **Task**: Research Ghost media upload requirements - - Understand file format requirements and size limits - - Test image and media upload processes - - Document upload response formats -- **Task**: Implement `ghost_admin_upload_image` - - Add file validation (size, format) - - Handle base64 and file input - - Add upload progress if applicable -- **Task**: Implement `ghost_admin_upload_media` - -#### 4.3 Tiers Management -- **Task**: Implement `ghost_admin_list_tiers` -- **Task**: Implement `ghost_admin_get_tier` -- **Task**: Implement `ghost_admin_create_tier` -- **Task**: Implement `ghost_admin_update_tier` - -#### 4.4 Webhook Management -- **Task**: Implement `ghost_admin_list_webhooks` -- **Task**: Implement `ghost_admin_create_webhook` -- **Task**: Implement `ghost_admin_update_webhook` -- **Task**: Implement `ghost_admin_delete_webhook` - -#### 4.5 Theme Management -- **Task**: Research Ghost theme upload process - - Understand theme package requirements - - Test theme upload and activation -- **Task**: Implement `ghost_admin_upload_theme` -- **Task**: Implement `ghost_admin_activate_theme` - -### Research Areas -1. What are Ghost's exact file upload requirements and limitations? -2. How does Ghost handle theme uploads and validation? -3. What are the webhook event types and payload formats? -4. How do tier pricing and currency settings work? - -### Success Criteria -- [ ] Member CRUD operations working -- [ ] Image and media uploads working -- [ ] Tier management working with pricing -- [ ] Webhook management working -- [ ] Theme upload and activation working -- [ ] File validation preventing invalid uploads -- [ ] Progress tracking for large uploads - -### Dependencies -- Phase 3 completed -- File upload research completed - ---- - -## Phase 5: Advanced Features (Stubs) - -### Objectives -- Implement stub versions of advanced features -- Create extensible architecture for future enhancement -- Provide basic functionality for complex operations - -### Tasks - -#### 5.1 Content Search (Stub) -- **Task**: Implement `ghost_admin_search_content` - - Create basic pass-through to Ghost API search - - Add parameter validation for search queries - - Format results consistently - -#### 5.2 Bulk Operations (Stub) -- **Task**: Implement `ghost_admin_bulk_operation` - - Create framework for bulk operations - - Implement basic bulk delete as proof of concept - - Add operation validation and safety checks - -#### 5.3 Analytics (Stub) -- **Task**: Research Ghost analytics capabilities - - Investigate what analytics data Ghost API provides - - Test analytics endpoints if available -- **Task**: Implement `ghost_admin_site_analytics` - - Create stub that returns available analytics - - Add parameter validation for date ranges and metrics - -#### 5.4 Import/Export (Stub) -- **Task**: Research Ghost import/export formats - - Understand Ghost export file formats - - Test import/export API endpoints -- **Task**: Implement `ghost_admin_export_content` -- **Task**: Implement `ghost_admin_import_content` - -#### 5.5 Stub Architecture -- **Task**: Create extensible stub framework - - Design pattern for upgrading stubs to full implementations - - Add logging for stub usage - - Create documentation for future enhancement - -### Success Criteria -- [ ] All 5 advanced feature stubs implemented -- [ ] Stubs provide basic functionality -- [ ] Clear upgrade path documented for each stub -- [ ] Analytics working if Ghost provides data -- [ ] Import/export working with basic formats -- [ ] Search providing usable results - -### Dependencies -- Phase 4 completed -- Research into Ghost advanced capabilities completed - ---- - -## Phase 6: Testing & Documentation - -### Objectives -- Comprehensive testing of all functionality -- Create thorough documentation -- Prepare for deployment and distribution - -### Tasks - -#### 6.1 Testing Infrastructure -- **Task**: Set up testing framework - - Configure Jest or similar testing framework - - Set up test Ghost instance with sample data - - Create test utilities and helpers -- **Task**: Unit testing - - Test all individual tools - - Test authentication flows - - Test error handling scenarios - - Test parameter validation -- **Task**: Integration testing - - Test end-to-end workflows - - Test with real Ghost instance - - Test all API combinations - -#### 6.2 Error Scenario Testing -- **Task**: Test all error scenarios - - Network failures - - Authentication failures - - Invalid parameters - - Rate limiting - - Ghost API errors -- **Task**: Test configuration scenarios - - Different operation modes - - Missing API keys - - Invalid configuration - -#### 6.3 Documentation -- **Task**: Create comprehensive README - - Installation instructions - - Configuration guide - - Usage examples - - Troubleshooting guide -- **Task**: Create API documentation - - Document all 44+ MCP tools - - Provide examples for each tool - - Document error responses -- **Task**: Create development guide - - How to extend functionality - - How to upgrade stubs - - Architecture overview - -#### 6.4 Performance & Optimization -- **Task**: Performance testing - - Test with large datasets - - Test concurrent operations - - Test memory usage -- **Task**: Optimization - - Optimize API calls - - Implement caching where appropriate - - Optimize error handling paths - -#### 6.5 Deployment Preparation -- **Task**: Create deployment scripts -- **Task**: Create Docker image (optional) -- **Task**: Create release package -- **Task**: Create security audit checklist - -### Success Criteria -- [ ] 95%+ test coverage -- [ ] All error scenarios tested -- [ ] Comprehensive documentation -- [ ] Performance benchmarks established -- [ ] Ready for production deployment -- [ ] Security review completed - -### Dependencies -- All previous phases completed - ---- - -## Risk Mitigation - -### Technical Risks -1. **Ghost API changes**: Monitor Ghost releases and maintain compatibility -2. **Authentication complexity**: Thorough research in Phase 0 -3. **File upload limitations**: Research and test early in Phase 4 -4. **Performance issues**: Regular testing throughout development - -### Schedule Risks -1. **Research taking longer**: Buffer time allocated in each phase -2. **Complex integrations**: Stub approach allows for iterative improvement -3. **Testing revealing issues**: Continuous testing throughout phases - -### Quality Risks -1. **Incomplete error handling**: Comprehensive error testing in Phase 6 -2. **Security vulnerabilities**: Security review in final phase -3. **Poor performance**: Performance testing integrated throughout - ---- - -## Success Metrics - -### Functionality -- [ ] All 44+ MCP tools implemented and working -- [ ] Both Content and Admin API operations functional -- [ ] Complete error handling coverage -- [ ] Comprehensive logging implemented - -### Quality -- [ ] 95%+ test coverage -- [ ] All error scenarios handled gracefully -- [ ] Performance meets requirements -- [ ] Security audit passed - -### Documentation -- [ ] Complete API documentation -- [ ] Installation and usage guides -- [ ] Development and extension guides -- [ ] Troubleshooting documentation - -### Deployment Readiness -- [ ] Package ready for distribution -- [ ] Docker image available (optional) -- [ ] Configuration examples provided -- [ ] Production deployment tested - ---- - -## Phase Dependencies - -``` -Phase 0 (Research & Setup) - ↓ -Phase 1 (Core Infrastructure) - ↓ -Phase 2 (Content API) ←→ Phase 3 (Admin API Core) - ↓ ↓ -Phase 4 (Advanced Admin Features) - ↓ -Phase 5 (Advanced Features - Stubs) - ↓ -Phase 6 (Testing & Documentation) -``` - -**Note**: Phases 2 and 3 can be developed in parallel after Phase 1 is complete, as they use different authentication methods and API endpoints. \ No newline at end of file diff --git a/README-DOCKER.md b/README-DOCKER.md deleted file mode 100644 index 9c9074a..0000000 --- a/README-DOCKER.md +++ /dev/null @@ -1,161 +0,0 @@ -# Ghost MCP - Docker Development Setup - -This guide helps you set up a Ghost instance for Ghost MCP development and API investigation. - -## Quick Start - -1. **Copy environment file**: - ```bash - cp .env.example .env - ``` - -2. **Start Ghost and MySQL**: - ```bash - docker compose up -d - ``` - -3. **Access Ghost**: - - Ghost Admin: http://localhost:2368/ghost - - Ghost Site: http://localhost:2368 - - phpMyAdmin (optional): http://localhost:8080 - -## Services - -### Ghost (Main Service) -- **Image**: `ghost:5-alpine` -- **Port**: 2368 -- **URL**: http://localhost:2368 -- **Admin**: http://localhost:2368/ghost - -### MySQL Database -- **Image**: `mysql:8.0` -- **Database**: `ghost_dev` (configurable via .env) -- **User**: `ghost` (configurable via .env) - -### phpMyAdmin (Optional Debug Tool) -- **Image**: `phpmyadmin/phpmyadmin:latest` -- **Port**: 8080 -- **Access**: http://localhost:8080 - -To start with phpMyAdmin for database debugging: -```bash -docker compose --profile debug up -d -``` - -## Initial Setup - -### 1. First-time Ghost Setup -1. Start the services: `docker compose up -d` -2. Wait for Ghost to initialize (check logs: `docker compose logs ghost`) -3. Visit http://localhost:2368/ghost -4. Create your admin account -5. Complete the Ghost setup wizard - -### 2. Obtain API Keys -1. In Ghost Admin, go to Settings → Integrations -2. Click "Add custom integration" -3. Give it a name (e.g., "MCP Development") -4. Copy both API keys: - - **Content API Key**: For read-only operations - - **Admin API Key**: For read/write operations - -### 3. Update Environment (Optional) -Add the API keys to your `.env` file: -```bash -GHOST_CONTENT_API_KEY=your_content_api_key_here -GHOST_ADMIN_API_KEY=your_admin_api_key_here -``` - -## API Testing - -### Content API (Read-only) -Test the Content API with curl: -```bash -# Get all posts -curl "http://localhost:2368/ghost/api/content/posts/?key=YOUR_CONTENT_API_KEY" - -# Get site settings -curl "http://localhost:2368/ghost/api/content/settings/?key=YOUR_CONTENT_API_KEY" -``` - -### Admin API (Read/Write) -The Admin API requires JWT authentication. You'll need to generate a JWT token using your Admin API key. - -## Management Commands - -### Start services -```bash -docker compose up -d -``` - -### Stop services -```bash -docker compose down -``` - -### View logs -```bash -# All services -docker compose logs - -# Ghost only -docker compose logs ghost - -# Follow logs -docker compose logs -f ghost -``` - -### Reset everything (⚠️ Destroys all data) -```bash -docker compose down -v -docker volume rm ghost_mcp_content ghost_mcp_mysql -``` - -### Backup data -```bash -# Create backup of Ghost content -docker run --rm -v ghost_mcp_content:/data -v $(pwd):/backup alpine tar czf /backup/ghost-content-backup.tar.gz -C /data . - -# Create backup of MySQL data -docker run --rm -v ghost_mcp_mysql:/data -v $(pwd):/backup alpine tar czf /backup/mysql-backup.tar.gz -C /data . -``` - -## Troubleshooting - -### Ghost won't start -1. Check if MySQL is healthy: `docker compose ps` -2. Check Ghost logs: `docker compose logs ghost` -3. Verify environment variables in `.env` - -### Can't access Ghost admin -1. Ensure Ghost is running: `docker compose ps` -2. Check if port 2368 is available: `netstat -an | grep 2368` -3. Try accessing directly: http://localhost:2368/ghost - -### Database connection issues -1. Check MySQL health: `docker compose logs ghost-db` -2. Verify database credentials in `.env` -3. Ensure database has started before Ghost - -### API requests failing -1. Verify API keys are correct -2. Check Content API: should work with query parameter -3. Check Admin API: requires proper JWT token generation - -## Development Notes - -- Ghost data persists in named Docker volumes -- Database is accessible via phpMyAdmin at localhost:8080 -- All Ghost content (themes, images, etc.) is stored in the `ghost_content` volume -- MySQL data is stored in the `ghost_mysql` volume -- Environment variables are loaded from `.env` file - -## Next Steps - -Once Ghost is running, you can: -1. Create test content (posts, pages, tags) -2. Test API endpoints -3. Begin MCP server development -4. Investigate Ghost API authentication flows - -For MCP development, see the main project documentation. \ No newline at end of file diff --git a/verify-setup.sh b/verify-setup.sh deleted file mode 100755 index d8e1b3b..0000000 --- a/verify-setup.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/bash - -# Ghost MCP Setup Verification Script -# This script verifies that the Ghost Docker setup is working correctly - -set -e - -echo "🔍 Ghost MCP Setup Verification" -echo "================================" - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# Function to print status -print_status() { - if [ $1 -eq 0 ]; then - echo -e "${GREEN}✅ $2${NC}" - else - echo -e "${RED}❌ $2${NC}" - return 1 - fi -} - -print_warning() { - echo -e "${YELLOW}⚠️ $1${NC}" -} - -print_info() { - echo -e "ℹ️ $1" -} - -# Check if Docker Compose is available -echo "1. Checking Docker Compose..." -if command -v docker &> /dev/null && docker compose version &> /dev/null; then - print_status 0 "Docker Compose is available" -else - print_status 1 "Docker Compose is not available" - exit 1 -fi - -# Check if containers are running -echo -e "\n2. Checking container status..." -if docker compose ps | grep -q "ghost-mcp-dev.*Up"; then - print_status 0 "Ghost container is running" -else - print_status 1 "Ghost container is not running" - echo " Run: docker compose up -d" - exit 1 -fi - -if docker compose ps | grep -q "ghost-db-dev.*Up.*healthy"; then - print_status 0 "MySQL database is running and healthy" -else - print_status 1 "MySQL database is not running or unhealthy" - echo " Check logs: docker compose logs ghost-db" - exit 1 -fi - -# Check if Ghost is responding -echo -e "\n3. Checking Ghost accessibility..." - -# Test main site -if curl -s -f http://localhost:2368/ > /dev/null; then - print_status 0 "Ghost main site is accessible (http://localhost:2368)" -else - print_status 1 "Ghost main site is not accessible" - exit 1 -fi - -# Test admin interface -if curl -s -f http://localhost:2368/ghost/ > /dev/null; then - print_status 0 "Ghost admin interface is accessible (http://localhost:2368/ghost)" -else - print_status 1 "Ghost admin interface is not accessible" - exit 1 -fi - -# Test Content API (should return auth error, which means it's working) -content_api_response=$(curl -s http://localhost:2368/ghost/api/content/settings/ 2>/dev/null || echo "") -if echo "$content_api_response" | grep -q "Authorization failed"; then - print_status 0 "Ghost Content API is responding (authentication required)" -elif echo "$content_api_response" | grep -q "posts\|settings"; then - print_status 0 "Ghost Content API is responding (no auth required - dev mode?)" -else - print_status 1 "Ghost Content API is not responding correctly" - echo " Response: $content_api_response" - exit 1 -fi - -# Check volumes -echo -e "\n4. Checking data persistence..." -if docker volume ls | grep -q "ghost_mcp_content"; then - print_status 0 "Ghost content volume exists" -else - print_status 1 "Ghost content volume missing" -fi - -if docker volume ls | grep -q "ghost_mcp_mysql"; then - print_status 0 "MySQL data volume exists" -else - print_status 1 "MySQL data volume missing" -fi - -# Check if setup is completed -echo -e "\n5. Checking Ghost setup status..." -setup_response=$(curl -s http://localhost:2368/ghost/api/admin/site/ 2>/dev/null || echo "") -if echo "$setup_response" | grep -q '"setup":false'; then - print_warning "Ghost setup is not completed yet" - print_info "Visit http://localhost:2368/ghost to complete the initial setup" - print_info "After setup, create a custom integration to get API keys" -elif echo "$setup_response" | grep -q '"setup":true'; then - print_status 0 "Ghost setup appears to be completed" - print_info "Visit http://localhost:2368/ghost to access admin panel" - print_info "Go to Settings > Integrations to create API keys" -else - print_warning "Could not determine Ghost setup status" - print_info "Visit http://localhost:2368/ghost to check setup" -fi - -echo -e "\n🎉 Setup Verification Complete!" -echo "================================" -echo "" -echo "Next steps:" -echo "1. Visit http://localhost:2368/ghost to complete Ghost setup (if not done)" -echo "2. Create a custom integration to get API keys:" -echo " - Go to Settings → Integrations → Add custom integration" -echo " - Copy both Content API Key and Admin API Key" -echo "3. Test the APIs using the keys" -echo "" -echo "Useful commands:" -echo "• View logs: docker compose logs -f ghost" -echo "• Stop services: docker compose down" -echo "• Restart services: docker compose restart" -echo "• Reset everything: docker compose down -v" -echo "" - -# Show running containers summary -echo "Currently running containers:" -docker compose ps --format table - -exit 0 \ No newline at end of file