Skip to main content
POST
/
api
/
projects
/
{id}
/
build
Start build for project via API key
curl --request POST \
  --url https://api.leanmcp.com/api/projects/{id}/build \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.leanmcp.com/api/projects/{id}/build"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.leanmcp.com/api/projects/{id}/build', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leanmcp.com/api/projects/{id}/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.leanmcp.com/api/projects/{id}/build"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.leanmcp.com/api/projects/{id}/build")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.leanmcp.com/api/projects/{id}/build")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454",
  "projectId": "a1b2c3d4-5678-90ab-cdef-11111111111",
  "awsBuildId": "mcp-docker-build-2:12345678-1234-5678-abcd-12345678abcd",
  "status": "in_progress",
  "s3SourceLocation": "s3-mcp-dev/1f04e1ec-8ff0-4bd6-8195-e58f0dd57326/project-id/file.zip",
  "startTime": "2023-01-01T00:00:00.000Z",
  "createdAt": "2023-01-01T00:00:00.000Z",
  "updatedAt": "2023-01-01T00:10:00.000Z",
  "ecrRepository": "ecr-mcp-dev/project-id",
  "logGroupName": "/aws/codebuild/mcp-docker-build-2",
  "logStreamName": "12345678-1234-5678-abcd-12345678abcd",
  "currentPhase": "BUILD",
  "endTime": "2023-01-01T00:10:00.000Z"
}

Authorizations

Authorization
string
header
required

Enter your LeanMCP API key

Path Parameters

id
string
required

Project ID

Example:

"proj_123456789"

Response

Build started successfully

id
string
required

Unique ID of the build

Example:

"f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"

projectId
string
required

ID of the project this build belongs to

Example:

"a1b2c3d4-5678-90ab-cdef-11111111111"

awsBuildId
string
required

AWS CodeBuild ID

Example:

"mcp-docker-build-2:12345678-1234-5678-abcd-12345678abcd"

status
enum<string>
required

Current status of the build

Available options:
pending,
in_progress,
succeeded,
failed,
stopped
Example:

"in_progress"

s3SourceLocation
string
required

S3 location of the source code

Example:

"s3-mcp-dev/1f04e1ec-8ff0-4bd6-8195-e58f0dd57326/project-id/file.zip"

startTime
string
required

Build start time

Example:

"2023-01-01T00:00:00.000Z"

createdAt
string
required

Build creation time

Example:

"2023-01-01T00:00:00.000Z"

updatedAt
string
required

Build last update time

Example:

"2023-01-01T00:10:00.000Z"

ecrRepository
string

ECR repository name

Example:

"ecr-mcp-dev/project-id"

logGroupName
string

CloudWatch log group name

Example:

"/aws/codebuild/mcp-docker-build-2"

logStreamName
string

CloudWatch log stream name

Example:

"12345678-1234-5678-abcd-12345678abcd"

currentPhase
string

Current phase of the build

Example:

"BUILD"

endTime
string

Build end time

Example:

"2023-01-01T00:10:00.000Z"