magicpod-mcp-server 0.1.3 → 0.1.4

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.
package/build/index.js CHANGED
@@ -5,8 +5,6 @@ import { searchMagicpodArticles } from "./tools/search-magicpod-articles.js";
5
5
  import { readMagicpodArticle } from "./tools/read-magicpod-article.js";
6
6
  import { initMagicPodApiProxy } from "./tools/magicpod-web-api.js";
7
7
  import { apiV1_0UploadFileCreate } from "./tools/api-v1-0-upload-file-create.js";
8
- import { apiV1_0GenerateTestCaseCreate } from "./tools/api-v1-0-generate-test-case-create.js";
9
- import { generateTestCase } from "./prompts/generate-test-case.js";
10
8
  const program = new Command();
11
9
  program.option("--api-token <key>", "MagicPod API token to use");
12
10
  program.option("--debug", "For internal debug use");
@@ -21,10 +19,9 @@ async function main() {
21
19
  const baseUrl = baseUrlEnvironmentVariable || "https://app.magicpod.com";
22
20
  const proxy = await initMagicPodApiProxy(baseUrl, options.apiToken, [
23
21
  apiV1_0UploadFileCreate(baseUrl, options.apiToken),
24
- apiV1_0GenerateTestCaseCreate(baseUrl, options.apiToken),
25
22
  searchMagicpodArticles(),
26
23
  readMagicpodArticle(),
27
- ], [generateTestCase()]);
24
+ ]);
28
25
  await proxy.connect(new StdioServerTransport());
29
26
  console.error("MagicPod MCP Server running on stdio");
30
27
  }
@@ -1,20 +1,18 @@
1
1
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
2
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
3
3
  import { OpenAPIToMCPConverter } from "../openapi/parser.js";
4
4
  import { HttpClient, HttpClientError } from "../client/http-client.js";
5
5
  import { zodToJsonSchema } from "openai/_vendor/zod-to-json-schema/index";
6
6
  // import this class, extend and return server
7
7
  export class MCPProxy {
8
8
  otherTools;
9
- prompts;
10
9
  server;
11
10
  httpClient;
12
11
  tools;
13
12
  openApiLookup;
14
- constructor(name, openApiSpec, apiToken, otherTools, prompts) {
13
+ constructor(name, openApiSpec, apiToken, otherTools) {
15
14
  this.otherTools = otherTools;
16
- this.prompts = prompts;
17
- this.server = new Server({ name, version: "0.1.3" }, { capabilities: { tools: {}, prompts: {} } });
15
+ this.server = new Server({ name, version: "0.1.4" }, { capabilities: { tools: {} } });
18
16
  const baseUrl = openApiSpec.servers?.[0].url;
19
17
  if (!baseUrl) {
20
18
  throw new Error("No base URL found in OpenAPI spec");
@@ -31,8 +29,7 @@ export class MCPProxy {
31
29
  const { tools, openApiLookup } = converter.convertToMCPTools();
32
30
  this.tools = tools;
33
31
  this.openApiLookup = openApiLookup;
34
- this.setupPrompts();
35
- this.setupTools();
32
+ this.setupHandlers();
36
33
  }
37
34
  removeDescriptions(obj) {
38
35
  if (Array.isArray(obj)) {
@@ -75,25 +72,7 @@ export class MCPProxy {
75
72
  }
76
73
  return refs;
77
74
  }
78
- setupPrompts() {
79
- this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
80
- return {
81
- prompts: this.prompts.map((p) => ({
82
- name: p.name,
83
- description: p.description,
84
- arguments: p.arguments,
85
- })),
86
- };
87
- });
88
- this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
89
- const prompt = this.prompts.find(p => p.name === request.params.name);
90
- if (prompt == null) {
91
- throw new Error("Unknown prompt");
92
- }
93
- return prompt.handleRequest(request);
94
- });
95
- }
96
- setupTools() {
75
+ setupHandlers() {
97
76
  // Handle tool listing
98
77
  this.server.setRequestHandler(ListToolsRequestSchema, async () => {
99
78
  const tools = [];
@@ -36,7 +36,6 @@ export const apiV1_0UploadFileCreate = (baseUrl, apiToken) => {
36
36
  const response = await axios.post(url, formData, {
37
37
  headers: {
38
38
  ...formData.getHeaders(),
39
- "User-Agent": "magicpod-mcp-server",
40
39
  Authorization: `Token ${apiToken}`,
41
40
  },
42
41
  });
@@ -6,7 +6,7 @@ const getOpenApiSpec = async (schemaUrl) => {
6
6
  if (!response.ok) {
7
7
  throw new Error(`HTTP error! status: ${response.status}`);
8
8
  }
9
- const openApiV2Spec = (await response.json());
9
+ const openApiV2Spec = await response.json();
10
10
  return new Promise((resolve, reject) => {
11
11
  swagger2openapi.convertObj(openApiV2Spec, {}, (err, options) => {
12
12
  if (err) {
@@ -24,14 +24,13 @@ const getOpenApiSpec = async (schemaUrl) => {
24
24
  }
25
25
  };
26
26
  const unsupportedPaths = [
27
- "/v1.0/{organization_name}/{project_name}/batch-runs/{batch_run_number}/screenshots/",
28
- "/v1.0/{organization_name}/{project_name}/screenshots/{batch_task_id}/",
29
- "/v1.0/magicpod-clients/api/{os}/{tag_or_version}/",
30
- "/v1.0/magicpod-clients/local/{os}/{version}/",
31
- "/v1.0/{organization_name}/{project_name}/upload-file/",
32
- "/v1.0/{organization_name}/{project_name}/generate-test-case/",
27
+ '/v1.0/{organization_name}/{project_name}/batch-runs/{batch_run_number}/screenshots/',
28
+ '/v1.0/{organization_name}/{project_name}/screenshots/{batch_task_id}/',
29
+ '/v1.0/magicpod-clients/api/{os}/{tag_or_version}/',
30
+ '/v1.0/magicpod-clients/local/{os}/{version}/',
31
+ '/v1.0/{organization_name}/{project_name}/upload-file/'
33
32
  ];
34
- export const initMagicPodApiProxy = async (baseUrl, apiToken, tools, prompts) => {
33
+ export const initMagicPodApiProxy = async (baseUrl, apiToken, tools) => {
35
34
  const schemaUrl = `${baseUrl}/api/v1.0/doc/?format=openapi`;
36
35
  const openApiSpec = await getOpenApiSpec(schemaUrl);
37
36
  openApiSpec.servers = [{ url: `${baseUrl}/api` }];
@@ -40,6 +39,6 @@ export const initMagicPodApiProxy = async (baseUrl, apiToken, tools, prompts) =>
40
39
  delete openApiSpec.paths[path];
41
40
  }
42
41
  }
43
- const proxy = new MCPProxy("magicpod-mcp-server", openApiSpec, apiToken, tools, prompts);
42
+ const proxy = new MCPProxy("magicpod-mcp-server", openApiSpec, apiToken, tools);
44
43
  return proxy;
45
44
  };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "magicpod-mcp-server",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Model Context Protocol server for MagicPod integration",
5
5
  "type": "module",
6
6
  "bin": {
7
- "magicpod-mcp-server": "build/index.js"
7
+ "magicpod-mcp-server": "./build/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsc && chmod 755 build/index.js",
11
- "publish": "npm run build && npm publish --access public"
11
+ "publish": "npm publish --access public"
12
12
  },
13
13
  "keywords": [
14
14
  "mcp",