@aibuilders/mcp-coach-server 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +46 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,9 +4,16 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
5
  import dotenv from "dotenv";
6
6
  import { readFile, writeFile, access, mkdir } from "fs/promises";
7
- import { join } from "path";
7
+ import { readFileSync } from "fs";
8
+ import { join, dirname } from "path";
8
9
  import { homedir } from "os";
10
+ import { fileURLToPath } from "url";
9
11
  dotenv.config();
12
+ // Get package version from package.json
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+ const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
16
+ const PACKAGE_VERSION = packageJson.version;
10
17
  const CACHE_DIR = join(homedir(), ".ai-builders-mcp-cache");
11
18
  const DEPLOYMENT_GUIDE_CACHE = join(CACHE_DIR, "deployment_guide_cache.json");
12
19
  async function ensureCacheDir() {
@@ -93,7 +100,7 @@ async function getCachedDeploymentGuide() {
93
100
  }
94
101
  const server = new Server({
95
102
  name: "ai-builder-mcp",
96
- version: "1.0.5",
103
+ version: PACKAGE_VERSION,
97
104
  }, {
98
105
  capabilities: {
99
106
  tools: {},
@@ -116,10 +123,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
116
123
  if (url.startsWith("http")) {
117
124
  baseUrl = url;
118
125
  }
119
- else if (url.startsWith("/")) {
120
- // Relative path: use the backend base URL directly
121
- // Don't append the servers path, use the base URL as-is
122
- baseUrl = "https://space.ai-builders.com/backend";
126
+ else {
127
+ baseUrl = `https://space.ai-builders.com${url}`;
123
128
  }
124
129
  }
125
130
  }
@@ -192,9 +197,42 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
192
197
  "1. Check if a deploy-config.json file exists in the project",
193
198
  "2. If not, help create one with deployment parameters (repo_url, service_name, branch, port) and environment variables",
194
199
  "3. Remind users not to commit sensitive values (passwords, API keys) to Git repositories",
195
- "4. When user says 'deploy', read from deploy-config.json and include env_vars in the API request",
196
- "5. Guide users to maintain their configuration for future deployments"
200
+ "4. Before deploying, help users test the Dockerfile locally:",
201
+ " - Build the Docker image: docker build -t test-image .",
202
+ " - Run the container locally: docker run -p <port>:<port> -e PORT=<port> test-image",
203
+ " - Verify the service starts correctly and responds to requests",
204
+ " - Test with the same environment variables that will be used in production",
205
+ "5. When user says 'deploy', read from deploy-config.json and include env_vars in the API request",
206
+ "6. After deployment, monitor the deployment status. If deployment fails:",
207
+ " - Use GET /v1/deployments/{service_name}/logs to retrieve deployment logs",
208
+ " - Check build logs: GET /v1/deployments/{service_name}/logs?log_type=build",
209
+ " - Check runtime logs: GET /v1/deployments/{service_name}/logs?log_type=runtime",
210
+ " - Filter by stream: GET /v1/deployments/{service_name}/logs?stream=stderr (for errors)",
211
+ " - Help users debug based on log output and fix issues",
212
+ "7. Guide users to maintain their configuration for future deployments"
197
213
  ],
214
+ log_api_info: {
215
+ endpoint: "GET /v1/deployments/{service_name}/logs",
216
+ description: "Retrieve deployment logs from Koyeb for debugging failed deployments",
217
+ parameters: {
218
+ service_name: "Path parameter: The unique service name / subdomain",
219
+ log_type: "Query parameter: 'build' or 'runtime' (default: 'runtime')",
220
+ stream: "Query parameter: Filter by 'stdout', 'stderr', or 'koyeb'",
221
+ timeout: "Query parameter: Seconds to wait for streaming logs (1-300, default: 5)",
222
+ deployment_id: "Query parameter: Optional deployment ID override"
223
+ },
224
+ usage_examples: {
225
+ build_logs: "GET /v1/deployments/my-service/logs?log_type=build",
226
+ runtime_errors: "GET /v1/deployments/my-service/logs?log_type=runtime&stream=stderr",
227
+ all_logs: "GET /v1/deployments/my-service/logs?log_type=runtime&timeout=30"
228
+ },
229
+ when_to_use: [
230
+ "When deployment status shows ERROR, UNHEALTHY, or DEGRADED",
231
+ "To debug why a service is not starting correctly",
232
+ "To check build-time errors during Docker image creation",
233
+ "To monitor runtime errors and application logs"
234
+ ]
235
+ },
198
236
  example_deploy_config: {
199
237
  description: "Example deploy-config.json structure",
200
238
  content: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibuilders/mcp-coach-server",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "AI Builder MCP server for AI Builders platform",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",