configuration management clarification

This commit is contained in:
Luiz Felipe Costa 2025-09-22 23:37:40 -03:00
parent 7d6bab9746
commit 32aa93aaa8

57
SPEC.md
View file

@ -431,7 +431,12 @@ volumes:
## Configuration ## Configuration
The MCP server should support configuration via: The MCP server uses a priority-based configuration system:
### Configuration Precedence (Highest to Lowest)
1. **Environment Variables** - Direct system environment variables
2. **`./.env` File** - Local environment file in project root
3. **Default Values** - Built-in fallback defaults
### Environment Variables ### Environment Variables
- `GHOST_URL`: Ghost instance URL (default: http://localhost:2368) - `GHOST_URL`: Ghost instance URL (default: http://localhost:2368)
@ -440,18 +445,14 @@ The MCP server should support configuration via:
- `GHOST_VERSION`: API version (default: v5.0) - `GHOST_VERSION`: API version (default: v5.0)
- `MCP_GHOST_MODE`: Operation mode - "readonly", "readwrite", or "auto" (default: "auto") - `MCP_GHOST_MODE`: Operation mode - "readonly", "readwrite", or "auto" (default: "auto")
### Configuration File ### .env File Example
Alternative JSON configuration file: Create a `./.env` file in the project root:
```json ```env
{ GHOST_URL=http://localhost:2368
"ghost": { GHOST_CONTENT_API_KEY=your-content-api-key
"url": "http://localhost:2368", GHOST_ADMIN_API_KEY=your-admin-api-key
"contentApiKey": "your-content-api-key", GHOST_VERSION=v5.0
"adminApiKey": "your-admin-api-key", MCP_GHOST_MODE=readwrite
"version": "v5.0",
"mode": "readwrite"
}
}
``` ```
### Operation Modes ### Operation Modes
@ -459,6 +460,13 @@ Alternative JSON configuration file:
- **readwrite**: All tools available (requires both Content and Admin API keys) - **readwrite**: All tools available (requires both Content and Admin API keys)
- **auto**: Automatically detects available keys and enables appropriate tools - **auto**: Automatically detects available keys and enables appropriate tools
### Configuration Loading Process
1. Load built-in default values
2. Read and merge `./.env` file (if exists)
3. Override with environment variables (if set)
4. Validate required configuration is present
5. Initialize appropriate API clients based on available keys
## Implementation Details ## Implementation Details
### Project Structure ### Project Structure
@ -598,13 +606,22 @@ Before proceeding with implementation, please clarify the following:
- **Authentication**: Single retry after token refresh - **Authentication**: Single retry after token refresh
- **Network**: Progressive timeout increases - **Network**: Progressive timeout increases
### 3. Configuration Management ### 3. Configuration Management ✅ RESOLVED
- **Question**: How should the Ghost instance URL and API keys be configured? - **Decision**: Environment variables have priority, then `./.env` file
- **Options**: - **Configuration Precedence** (highest to lowest):
- Environment variables only 1. **Environment Variables** - Direct system environment variables
- Configuration file only 2. **`./.env` File** - Local environment file in project root
- Both (with precedence order) 3. **Default Values** - Fallback defaults for optional settings
- Runtime configuration via MCP parameters
#### Configuration Loading Process:
1. Load default configuration values
2. Read and parse `./.env` file (if exists)
3. Override with actual environment variables
4. Validate required configuration is present
#### Required vs Optional Variables:
- **Required**: `GHOST_URL`, `GHOST_CONTENT_API_KEY` or `GHOST_ADMIN_API_KEY` (at least one)
- **Optional**: `GHOST_VERSION`, `MCP_GHOST_MODE`, logging settings
### 4. Additional Features ### 4. Additional Features
- **Question**: Are there any additional features beyond basic CRUD operations? - **Question**: Are there any additional features beyond basic CRUD operations?