Skip to main content
Glama

deploy_project

Deploy web projects to live branded URLs on AICre8 platform by providing project files and ID for instant hosting.

Instructions

Deploy the project to a live branded URL (e.g. my-project.aicre8.app). Pass a map of file paths to contents. Use b64 prefix for binary file content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID (UUID or url_id)
filesYesMap of file paths to content. Binary files: prefix content with "__b64__" followed by base64 data.

Implementation Reference

  • The deployProject method is the core handler that executes the tool logic by making an HTTP POST request to /projects/${projectId}/deploy with the files payload, returning deployment details including deploy_id, site_id, url, and status.
    async deployProject(
      projectId: string,
      files: Record<string, string>,
    ): Promise<{
      deploy_id: string;
      site_id: string;
      url: string;
      netlify_url: string;
      status: string;
      files_uploaded: number;
      files_total: number;
    }> {
      return this.request('POST', `/projects/${projectId}/deploy`, { files });
    }
  • Input validation schema using Zod that defines the tool parameters: project_id (string UUID or url_id) and files (record mapping file paths to content, with special __b64__ prefix support for binary files).
    {
      project_id: z.string().describe('Project ID (UUID or url_id)'),
      files: z
        .record(z.string(), z.string())
        .describe(
          'Map of file paths to content. Binary files: prefix content with "__b64__" followed by base64 data.',
        ),
    },
  • src/index.ts:227-253 (registration)
    Registration of the deploy_project tool with the MCP server using server.tool(), including the tool name, description, input schema, and the async handler that calls client.deployProject and formats the response.
    server.tool(
      'deploy_project',
      'Deploy the project to a live branded URL (e.g. my-project.aicre8.app). Pass a map of file paths to contents. Use __b64__ prefix for binary file content.',
      {
        project_id: z.string().describe('Project ID (UUID or url_id)'),
        files: z
          .record(z.string(), z.string())
          .describe(
            'Map of file paths to content. Binary files: prefix content with "__b64__" followed by base64 data.',
          ),
      },
      async (params) => {
        try {
          const result = await client.deployProject(params.project_id, params.files);
          return {
            content: [
              {
                type: 'text' as const,
                text: `Deployed successfully!\n\nURL: ${result.url}\nFiles uploaded: ${result.files_uploaded}/${result.files_total}\nStatus: ${result.status}`,
              },
            ],
          };
        } catch (err: any) {
          return { content: [{ type: 'text' as const, text: `Error: ${err.message}` }], isError: true };
        }
      },
    );
  • The private request method is a supporting utility that handles HTTP requests with proper authentication headers, JSON serialization, and error handling for all API calls including the deployProject operation.
    private async request<T>(
      method: string,
      path: string,
      body?: unknown,
    ): Promise<T> {
      const url = `${this.baseUrl}${path}`;
    
      const res = await fetch(url, {
        method,
        headers: this.headers,
        body: body ? JSON.stringify(body) : undefined,
      });
    
      if (!res.ok) {
        const error = await res.json().catch(() => ({ error: res.statusText }));
        throw new Error(
          `AICre8 API error ${res.status}: ${(error as any).error || res.statusText}`,
        );
      }
    
      return res.json() as Promise<T>;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AICre8dev/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server