Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/config/feature-flags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface FeatureFlags {
enableAutopilotTasks: boolean;
}

export const featureFlags: FeatureFlags = {
enableAutopilotTasks: false,
};
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { readMagicpodArticle } from "./tools/read-magicpod-article.js";
import { initMagicPodApiProxy } from "./tools/magicpod-web-api.js";
import { apiV1_0UploadFileCreate } from "./tools/api-v1-0-upload-file-create.js";
import { apiV1_0UploadDataPatterns } from "./tools/api-v1-0-upload-data-patterns.js";
import { featureFlags } from "./config/feature-flags.js";
import { apiV1_0CreateAutopilotTasks } from "./tools/api-v1-0-create-autopilot-tasks.js";

const program = new Command();
program.option("--api-token <key>", "MagicPod API token to use");
Expand Down Expand Up @@ -40,6 +42,9 @@ async function main() {
apiV1_0UploadDataPatterns(baseUrl, options.apiToken),
searchMagicpodArticles(),
readMagicpodArticle(),
...(featureFlags.enableAutopilotTasks
? [apiV1_0CreateAutopilotTasks(baseUrl, options.apiToken)]
: []),
]);
await proxy.connect(new StdioServerTransport());
console.error("MagicPod MCP Server running on stdio");
Expand Down
33 changes: 33 additions & 0 deletions src/tools/api-v1-0-create-autopilot-tasks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { z } from "zod";
import { OtherToolDefinition } from "../openapi-mcp-server/mcp/proxy.js";

export const apiV1_0CreateAutopilotTasks = (baseUrl: string, apiToken: string) => {
return {
name: "API-v1_0_create-autopilot-tasks",
description:
"Create autopilot tasks for test case editing. This feature is currently under development.",
inputSchema: z.object({
organizationName: z
.string()
.describe("The organization name"),
projectName: z
.string()
.describe("The project name"),
}),
handleRequest: async ({ organizationName, projectName }) => {
return {
content: [
{
type: "text",
text: JSON.stringify({
status: "under_development",
message: "The autopilot tasks feature is currently under development and not yet available.",
organization: organizationName,
project: projectName,
}),
},
],
};
},
} satisfies OtherToolDefinition<any>;
};
3 changes: 2 additions & 1 deletion src/tools/magicpod-web-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const unsupportedPaths = [
'/v1.0/magicpod-clients/local/{os}/{version}/',
'/v1.0/magicpod-clients/magicpodconnect/{os}/{version}/',
'/v1.0/{organization_name}/{project_name}/upload-file/',
'/v1.0/{organization_name}/{project_name}/test-cases/{test_case_number}/start-upload-data-patterns/'
'/v1.0/{organization_name}/{project_name}/test-cases/{test_case_number}/start-upload-data-patterns/',
'/v1.0/{organization_name}/{project_name}/autopilot-tasks/',
];

export const initMagicPodApiProxy = async (
Expand Down