create_issue
Create a new GitHub issue in a repository, specifying title, body, assignees, milestone, and labels. Streamline issue tracking and project management directly via the GitHub MCP Server Plus.
Instructions
Create a new issue in a GitHub repository
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignees | No | ||
| body | No | ||
| labels | No | ||
| milestone | No | ||
| owner | Yes | ||
| repo | Yes | ||
| title | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"assignees": {
"items": {
"type": "string"
},
"type": "array"
},
"body": {
"type": "string"
},
"labels": {
"items": {
"type": "string"
},
"type": "array"
},
"milestone": {
"type": "number"
},
"owner": {
"type": "string"
},
"repo": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"owner",
"repo",
"title"
],
"type": "object"
}
Implementation Reference
- operations/issues.ts:71-83 (handler)The core handler function that executes the GitHub API POST request to create a new issue in the repository.export async function createIssue( owner: string, repo: string, options: z.infer<typeof CreateIssueOptionsSchema> ) { return githubRequest( `https://api.github.com/repos/${owner}/${repo}/issues`, { method: "POST", body: options, } ); }
- operations/issues.ts:25-29 (schema)The Zod schema for validating the input parameters of the create_issue tool, including owner, repo, and issue options.export const CreateIssueSchema = z.object({ owner: z.string(), repo: z.string(), ...CreateIssueOptionsSchema.shape, });
- operations/issues.ts:17-23 (schema)The Zod schema defining the options for creating an issue, such as title, body, assignees, etc.export const CreateIssueOptionsSchema = z.object({ title: z.string(), body: z.string().optional(), assignees: z.array(z.string()).optional(), milestone: z.number().optional(), labels: z.array(z.string()).optional(), });
- index.ts:99-102 (registration)Registration of the 'create_issue' tool in the MCP server's list of available tools, including name, description, and input schema.name: "create_issue", description: "Create a new issue in a GitHub repository", inputSchema: zodToJsonSchema(issues.CreateIssueSchema), },
- index.ts:267-274 (handler)The dispatcher handler in the main CallToolRequestSchema handler that parses arguments, calls the createIssue function, and formats the response.case "create_issue": { const args = issues.CreateIssueSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; const issue = await issues.createIssue(owner, repo, options); return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], }; }