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
| Name | Type | Description |
|---|---|---|
owner required | string | The account owner of the repository. The name is not case… |
repo required | string | The name of the repository without the .git extension. The… |
pull_number required | integer | The number that identifies the pull request. |
location | string | The requested location for a new codespace. Best efforts are made to respect… |
geo | EuropeWest | SoutheastAsia | UsEast | UsWest | The geographic area for this codespace. If not specified, the value is… |
client_ip | string | IP for location auto-detection when proxying a request |
machine | string | Machine type to use for this codespace |
devcontainer_path | string | Path to devcontainer.json config to use for this codespace |
multi_repo_permissions_opt_out | boolean | Whether to authorize requested permissions from devcontainer.json |
working_directory | string | Working directory for this codespace |
idle_timeout_minutes | integer | Time in minutes before codespace stops from inactivity |
display_name | string | Display name for this codespace |
retention_period_minutes | integer | Duration 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:
{
"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:
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 ….