- Notifications
You must be signed in to change notification settings - Fork3.1k
Description
Describe the feature or problem you'd like to solve
Currently, the discussions toolset only supports read-only operations (list_discussions, get_discussion, get_discussion_comments, list_discussion_categories). While these tools are helpful for reading discussion data, there is no way to actually create new discussions programmatically through MCP tools.
This creates a significant limitation when trying to use AI agents for community management, feedback collection, or automated issue triage workflows. For example, users cannot ask an AI agent to submit feature requests to GitHub Community discussions or create discussion threads in their organization repositories.
Proposed solution
Add a new tool called create_discussion to the discussions toolset that allows creating new discussions in a repository or organization.
The tool should accept the following parameters:
- owner (required): Repository or organization owner
- repo (required): Repository name
- category_id (required): The category ID where the discussion should be created (obtainable via list_discussion_categories)
- title (required): Discussion title
- body (required): Discussion body text in markdown format
The tool would use the GitHub GraphQL API mutation CreateDiscussion, similar to how the existing read operations use GraphQL queries. The implementation would follow the same patterns already established in pkg/github/discussions.go.
This would enable AI agents to fully participate in GitHub Discussions, not just read them.
Example prompts or workflows (for tools/toolsets only)
1. Submitting feature requests to GitHub Community
User: "Submit a feature request to GitHub Community asking for MCP support in GitHub Copilot web interface at github.com/copilot"
Agent:
- Lists categories in community/community using list_discussion_categories
- Identifies the appropriate category (e.g., "Ideas")
- Creates discussion with detailed feature request using create_discussion
- Returns link to the created discussion
2. Automated issue triage to discussions
User: "Convert issue#123 into a discussion in the Ideas category"
Agent:
- Reads issue details using get_issue
- Lists discussion categories to find "Ideas" category
- Creates discussion with issue content using create_discussion
- Adds comment to original issue with discussion link
- Closes the issue
3. Community Q&A automation
User: "Create a Q&A discussion asking the community how they handle rate limiting in their API integrations"
Agent:
- Finds the Q&A category using list_discussion_categories
- Creates discussion with the question using create_discussion
- Optionally subscribes to notifications for answers
4. Release announcement discussions
User: "Create an announcement discussion for the v2.0.0 release"
Agent:
- Reads latest release notes using get_latest_release
- Finds Announcements category using list_discussion_categories
- Creates discussion with release highlights using create_discussion
- Adds labels and links to relevant PRs
5. Bulk discussion migration
User: "Migrate all issues labeled 'question' to discussions"
Agent:
- Lists issues with "question" label
- For each issue, creates a corresponding discussion
- Links back to original issue
- Closes issues after migration
Additional context
The GitHub GraphQL API already has a well-documented CreateDiscussion mutation that supports all necessary fields:
mutation {createDiscussion(input: {repositoryId:"repository_id"categoryId:"category_id"title:"Discussion title"body:"Discussion body" }) {discussion {idnumberurl } }}
The discussions.go file already uses githubv4 for GraphQL queries, so adding the mutation would be straightforward and consistent with the existing codebase patterns.
This feature would complement the existing read-only discussion tools and enable complete discussion management workflows through MCP. It would be particularly valuable for organizations using GitHub Discussions for community feedback, support, and knowledge sharing.