create_project
Generate a new project in a GitHub repository using owner, repo, and name inputs. Add a description to organize tasks, track progress, and manage workflows effectively.
Instructions
Create a new project for a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | The description of the project | |
| name | Yes | The name of the project | |
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name |
Implementation Reference
- src/operations/projects.ts:129-151 (handler)Core handler function that performs the POST request to GitHub API to create a project in a repository.export async function createProject( github_pat: string, owner: string, repo: string, name: string, body?: string ): Promise<z.infer<typeof ProjectSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/projects`, { method: "POST", body: { name, body, }, headers: { "Accept": "application/vnd.github.inertia-preview+json", }, } ); return ProjectSchema.parse(response); }
- src/operations/projects.ts:61-70 (schema)Input schema validation for create_project tool, including public schema and internal version with github_pat.export const CreateProjectSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), name: z.string().describe("The name of the project"), body: z.string().optional().describe("The description of the project"), }); export const _CreateProjectSchema = CreateProjectSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/index.ts:254-258 (registration)MCP tool registration in the server, defining name, description, and input schema.{ name: "create_project", description: "Create a new project for a repository", inputSchema: zodToJsonSchema(projects.CreateProjectSchema), },
- src/index.ts:694-701 (handler)MCP server dispatch handler that validates arguments and delegates to the projects.createProject function.case "create_project": { const args = projects._CreateProjectSchema.parse(params.arguments); const { github_pat, owner, repo, name, body } = args; const result = await projects.createProject(github_pat, owner, repo, name, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }