|
@@ -201,6 +201,13 @@ GOGS_MCP_PATH=/data/gogs-mcp/dist/index.js # Path to gogs-mcp server for headle
|
|
|
|
|
|
|
|
The `GOGS_MCP_PATH` environment variable configures the location of the gogs-mcp server used by Claude Code in headless mode for issue automation. The handle-issue.sh script dynamically generates the MCP configuration file (.mcp-gogs.json) using this path at runtime, making it environment-specific.
|
|
The `GOGS_MCP_PATH` environment variable configures the location of the gogs-mcp server used by Claude Code in headless mode for issue automation. The handle-issue.sh script dynamically generates the MCP configuration file (.mcp-gogs.json) using this path at runtime, making it environment-specific.
|
|
|
|
|
|
|
|
|
|
+**SSL Certificate Configuration:**
|
|
|
|
|
+```env
|
|
|
|
|
+NODE_EXTRA_CA_CERTS=/home/claude/.config/agent-manager/certs/extra-ca.pem
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+When the Gogs server uses a certificate with an incomplete chain (e.g., missing Let's Encrypt intermediate), Node.js and curl will fail SSL verification. The `NODE_EXTRA_CA_CERTS` variable points to a PEM bundle containing the missing intermediate and root certificates. The server propagates `.env` values to `process.env` so child processes (the TypeScript client, gogs-mcp) inherit them automatically. The client's `gogs-helper.ts` also uses the extra CA bundle with curl via `--cacert`.
|
|
|
|
|
+
|
|
|
### 2. Command Configuration (`commands.json`)
|
|
### 2. Command Configuration (`commands.json`)
|
|
|
|
|
|
|
|
Copy from `commands.json.example` and configure commands for each event type.
|
|
Copy from `commands.json.example` and configure commands for each event type.
|
|
@@ -264,6 +271,8 @@ Copy from `commands.json.example` and configure commands for each event type.
|
|
|
10. **Shell & Node Execution**: Commands can be shell scripts or Node.js scripts
|
|
10. **Shell & Node Execution**: Commands can be shell scripts or Node.js scripts
|
|
|
11. **Email Notifications**: Optional callback-based email notifications with condition matching
|
|
11. **Email Notifications**: Optional callback-based email notifications with condition matching
|
|
|
12. **File Logging**: Automatic file logging with rotation (enabled by default for systemd services)
|
|
12. **File Logging**: Automatic file logging with rotation (enabled by default for systemd services)
|
|
|
|
|
+13. **Environment Propagation**: Server propagates `.env` values to `process.env` so child processes inherit them (critical for `NODE_EXTRA_CA_CERTS`, `GOGS_MCP_PATH`, etc.)
|
|
|
|
|
+14. **SSL CA Bundle**: Extra CA certificates stored at `~/.config/agent-manager/certs/extra-ca.pem` for servers with incomplete certificate chains
|
|
|
|
|
|
|
|
## Extending with Callbacks
|
|
## Extending with Callbacks
|
|
|
|
|
|
|
@@ -616,8 +625,12 @@ The client supports flexible MCP server configuration with three priority levels
|
|
|
"gogs": {
|
|
"gogs": {
|
|
|
"type": "stdio",
|
|
"type": "stdio",
|
|
|
"command": "node",
|
|
"command": "node",
|
|
|
- "args": ["/data/gogs-mcp/dist/index.js"],
|
|
|
|
|
- "env": {}
|
|
|
|
|
|
|
+ "args": ["${GOGS_MCP_PATH}"],
|
|
|
|
|
+ "env": {
|
|
|
|
|
+ "GOGS_SERVER_URL": "${GOGS_SERVER_URL}",
|
|
|
|
|
+ "GOGS_ACCESS_TOKEN": "${GOGS_ACCESS_TOKEN}",
|
|
|
|
|
+ "NODE_EXTRA_CA_CERTS": "${NODE_EXTRA_CA_CERTS}"
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
"custom-mcp": {
|
|
"custom-mcp": {
|
|
|
"type": "stdio",
|
|
"type": "stdio",
|
|
@@ -631,6 +644,8 @@ The client supports flexible MCP server configuration with three priority levels
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+**Important**: MCP servers are spawned as child processes by the Claude Agent SDK. The `env` section must explicitly include any environment variables the server needs (e.g., `GOGS_SERVER_URL`, `GOGS_ACCESS_TOKEN`, `NODE_EXTRA_CA_CERTS`). Use `${VAR_NAME}` syntax for substitution from the loaded environment.
|
|
|
|
|
+
|
|
|
**Security**: Configuration files are stored outside repositories in `~/.config/agent-manager/mcp/` with restricted permissions to protect secrets like API keys and JWT tokens.
|
|
**Security**: Configuration files are stored outside repositories in `~/.config/agent-manager/mcp/` with restricted permissions to protect secrets like API keys and JWT tokens.
|
|
|
|
|
|
|
|
See `examples/MCP-CONFIG.md` for detailed configuration guide and examples.
|
|
See `examples/MCP-CONFIG.md` for detailed configuration guide and examples.
|
|
@@ -680,6 +695,7 @@ The client supports a two-tier environment variable configuration system to elim
|
|
|
- `GOGS_ACCESS_TOKEN` or `GOGS_TOKEN` - Gogs API authentication token
|
|
- `GOGS_ACCESS_TOKEN` or `GOGS_TOKEN` - Gogs API authentication token
|
|
|
- `GOGS_BASE_URL` - Gogs server URL (e.g., `https://git.smartbotics.ai`)
|
|
- `GOGS_BASE_URL` - Gogs server URL (e.g., `https://git.smartbotics.ai`)
|
|
|
- `GOGS_MCP_PATH` - Path to gogs-mcp server (defaults to `/data/gogs-mcp/dist/index.js`)
|
|
- `GOGS_MCP_PATH` - Path to gogs-mcp server (defaults to `/data/gogs-mcp/dist/index.js`)
|
|
|
|
|
+- `NODE_EXTRA_CA_CERTS` - Path to extra CA certificates PEM bundle (for incomplete SSL chains)
|
|
|
|
|
|
|
|
**Setup Global Configuration**:
|
|
**Setup Global Configuration**:
|
|
|
```bash
|
|
```bash
|