Home / Servers / GitHub API / codespaces_create_with_pr_for_authenticated_user

Create a codespace from a pull request

An MCP tool from the GitHub API server, hosted on mcp.hjlabs.in.

Create a codespace from a pull request Creates a codespace owned by the authenticated user for the specified pull request. OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint. [POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces]

Name on the gateway: github_api__codespaces_create_with_pr_for_authenticated_user · may change things.

Parameters

NameTypeDescription
owner requiredstringThe account owner of the repository. The name is not case…
repo requiredstringThe name of the repository without the .git extension. The…
pull_number requiredintegerThe number that identifies the pull request.
locationstringThe requested location for a new codespace. Best efforts are made to respect…
geoEuropeWest | SoutheastAsia | UsEast | UsWestThe geographic area for this codespace. If not specified, the value is…
client_ipstringIP for location auto-detection when proxying a request
machinestringMachine type to use for this codespace
devcontainer_pathstringPath to devcontainer.json config to use for this codespace
multi_repo_permissions_opt_outbooleanWhether to authorize requested permissions from devcontainer.json
working_directorystringWorking directory for this codespace
idle_timeout_minutesintegerTime in minutes before codespace stops from inactivity
display_namestringDisplay name for this codespace
retention_period_minutesintegerDuration in minutes after codespace has gone idle in which it will be deleted.…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "github_api__codespaces_create_with_pr_for_authenticated_user",
  "arguments": {
    "owner": "…",
    "repo": "…",
    "pull_number": 0
  }
}

Or connect the GitHub API server directly, which lists 1,221 tools including this one:

Run in your terminal
claude mcp add --transport http hj-github-api https://mcp.hjlabs.in/mcp/github-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the create a codespace from a pull request tool with owner set to ….

More from GitHub API