create_release
Create a new release in a GitHub repository to package and distribute software versions with tags, descriptions, and optional draft or prerelease status.
Instructions
Create a new release in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name | |
| tag_name | Yes | The name of the tag | |
| target_commitish | No | Specifies the commitish value that determines where the Git tag is created from | |
| name | No | The name of the release | |
| body | No | Text describing the release | |
| draft | No | true to create a draft (unpublished) release, false to create a published one | |
| prerelease | No | true to identify the release as a prerelease, false to identify it as a full release | |
| generate_release_notes | No | Whether to automatically generate the name and body for this release |
Implementation Reference
- src/operations/releases.ts:128-143 (handler)The core handler function that executes the create_release tool by sending a POST request to GitHub Releases API and parsing the response.export async function createRelease( github_pat: string, owner: string, repo: string, options: Omit<z.infer<typeof CreateReleaseSchema>, "owner" | "repo" | "github_pat"> ): Promise<z.infer<typeof ReleaseSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/releases`, { method: "POST", body: options, } ); return ReleaseSchema.parse(response); }
- src/operations/releases.ts:55-65 (schema)Input schema for the create_release tool, defining parameters like owner, repo, tag_name, etc.export const CreateReleaseSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), tag_name: z.string().describe("The name of the tag"), target_commitish: z.string().optional().describe("Specifies the commitish value that determines where the Git tag is created from"), name: z.string().optional().describe("The name of the release"), body: z.string().optional().describe("Text describing the release"), draft: z.boolean().optional().describe("true to create a draft (unpublished) release, false to create a published one"), prerelease: z.boolean().optional().describe("true to identify the release as a prerelease, false to identify it as a full release"), generate_release_notes: z.boolean().optional().describe("Whether to automatically generate the name and body for this release") });
- src/index.ts:165-168 (registration)Registration of the create_release tool in the MCP server tool list.name: "create_release", description: "Create a new release in a GitHub repository", inputSchema: zodToJsonSchema(releases.CreateReleaseSchema), },
- src/index.ts:533-540 (handler)Dispatch handler case in the main CallToolRequestSchema handler that parses arguments and calls the createRelease function.case "create_release": { const args = releases._CreateReleaseSchema.parse(params.arguments); const { github_pat, owner, repo, ...options } = args; const result = await releases.createRelease(github_pat, owner, repo, options); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/operations/releases.ts:67-69 (schema)Extended schema including github_pat, used internally for parsing arguments.export const _CreateReleaseSchema = CreateReleaseSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });