517 Commits

Author SHA1 Message Date
Tommaso Moro ee3ab7b23e reduce context usage for get_pull_request_review_comments (#2062) 2026-02-23 14:32:44 +00:00
Tommaso Moro 713848b0eb add minimal types for get_files (#2059) 2026-02-23 13:49:05 +00:00
Sam Morrow 16ff74a0eb feat: move copilot tools to default copilot toolset (#2039)
* feat: move copilot tools to default copilot toolset

Move AssignCopilotToIssue and RequestCopilotReview from the issues and
pull_requests toolsets respectively into a new default-enabled copilot
toolset. This groups all copilot-related tools together and makes them
available by default.

- Set Default: true on ToolsetMetadataCopilot
- Remove copilot from RemoteOnlyToolsets()
- Update AllTools() grouping and tests
- Regenerate docs

Refs: github/copilot-mcp-core#1180

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: move copilot tools to dedicated copilot.go

Extract AssignCopilotToIssue, RequestCopilotReview, AssignCodingAgentPrompt,
and all supporting types/helpers from issues.go and pullrequests.go into
copilot.go and copilot_test.go.

This follows the existing convention where each domain (actions, dependabot,
discussions, gists, etc.) has its own file, and keeps the copilot toolset
implementation cohesive in one place.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 11:38:26 +01:00
Matt Holloway dc3ee11f4c fix for -1 in tailLines (#2047)
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
MCP Server Diff / mcp-diff (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
2026-02-19 15:17:52 +00:00
tommaso-moro c38802ac80 rename to --exclude-tools 2026-02-18 17:13:41 +01:00
tommaso-moro 0b76ca8fd2 add disallowed-tools flag to enable shuting off tools as part of server configuration 2026-02-18 17:13:41 +01:00
Adam Holt 08231a2aeb Add support for custom middleware in the correct order. (#2026)
* Add support for custom middleware in the correct order.

* Switch this up to be more clear on what it's doing
2026-02-18 14:43:59 +01:00
Tommaso Moro 851030c20b Reduce context usage for create_or_update_file tool (#2027)
* optimize context usage

* add assortions and check for nil response

* refactor
2026-02-18 10:26:19 +00:00
e-straight 67b8bf2ed2 Add ProjectV2 status update tools (list, get, create) (#1987)
* Add ProjectV2 status update tools (list, get, create)

Closes https://github.com/github/github-mcp-server/issues/1963

Add three new individual tools and wire them into the consolidated
project tools for managing GitHub ProjectV2 status updates:

- list_project_status_updates / projects_list: List status updates for
  a project with pagination, ordered by creation date descending
- get_project_status_update / projects_get: Fetch a single status
  update by node ID
- create_project_status_update / projects_write: Create a status update
  with optional body, status, start_date, and target_date

New GraphQL types and queries (statusUpdateNode, statusUpdatesUserQuery,
statusUpdatesOrgQuery, statusUpdateNodeQuery) support both user-owned
and org-owned projects. The CreateProjectV2StatusUpdateInput type is
defined locally since the shurcooL/githubv4 library does not include it.

Also includes quality improvements discovered during implementation:

- Extract resolveProjectNodeID helper to deduplicate ~70 lines of
  project ID resolution logic shared between addProjectItem and
  createProjectStatusUpdate
- Add client-side YYYY-MM-DD date format validation for start_date
  and target_date fields before sending to the API
- Fix brittle node type check in getProjectStatusUpdate that relied
  on stringifying a githubv4.ID and comparing to "<nil>"
- Refactor createProjectStatusUpdate to accept typed parameters
  instead of raw args map
- Add deprecated tool aliases for all three new individual tools
- Add ProjectResolveIDFailedError constant for consistent error
  reporting

Test coverage includes 21 subtests covering both user and org paths,
pagination, error handling, input validation, field verification, and
consolidated tool dispatch.

* Fix projects_get required params and harden status update tools

Loosen projects_get schema to only require "method", since
get_project_status_update only needs status_update_id and never uses
owner or project_number. Also use pointer types for optional
statusUpdateNode fields, add owner_type validation for list/create
status updates, clamp negative per_page values, and fix
resolveProjectNodeID to return "" instead of nil on error.

* Resolve conflicts

* Update doc

* Update aliases

* Dont update tool renaming docs

---------

Co-authored-by: e-straight <elijahstr@users.noreply.github.com>
Co-authored-by: JoannaaKL <joannaakl@github.com>
2026-02-18 10:14:40 +01:00
Tommaso Moro 543a1fa019 use minimal types for issue comments to optimize context usage (#2024) 2026-02-17 12:36:28 +00:00
Tommaso Moro dc7e789dc4 Optimize context usage for getting an issue using the issue_read tool (#2022)
* minimize context usage using minimal types for get issue comments

* preserver reactions field

* add back author association
2026-02-17 10:33:15 +00:00
Tommaso Moro f04c137bdd Reduce context usage for getting a Pull Request (#2017)
* introduce minimal pr type

* update to use time.RFC3339

* confine change to single PR
2026-02-17 09:37:59 +00:00
Matt Holloway e83440db58 Add initial PoC for MCP Apps for select tools under Insiders (#1957)
* PoC full flow (hello world example)

* add avatar resource domain

* add postmessage logic and richer UI

* add create issue ui

* update ui for issue creatioon

* fix

* ignore banner

* update docs after rebase

* update toolsnap for get_me

* new UI changes

* update docs

* update workflows that need ui build

* add UI diff

* fix build ui step for windows runners to use git bash

* fix UI diff

* refactor issue creation UI

* add AvatarWithFallback component and update UserCard to use it; enhance CreateIssueApp to manage existing issue data

* fix formatting of button labels

* add create pull request functionality with UI support and insiders

* update docs

* add test for insiders mode handling in ServerTool schema

* remove `show_ui` param for now

* make insiders mode metadata stripping generic

* remove ui diff

* fix CI

* remove redundant mention of old app name

* add node types to fix ide issues for ts code

* remove unused TriangleDownIcon import

* update @primer/behaviors and electron-to-chromium versions in package-lock.json

* add check to ensure base and head are not the same when creating a new PR

* remove old show_ui

* fix gitignore for dist so builds dont break

* add tests for insiders mode handling and metadata stripping in ServerTool

* remove unused state and components from CreatePRApp

* fix ui build

* update docker build to fix npm issue

* remove reference to show_ui

* allow insiders to work for non-ui features

* formalise insiders inventory support

* update docs

* fix overflow issues and replace pull request dropdown with matching UI from dotcom

* fix createpullrequest test

* consolidate fetching tools under `ui_get` tool to remove toolset deps

* fix issue data prefill in issue_write form

* fix link component when updating issue

* fix avatar URL

* fix broken issue update logic

* remove dbg

* fix for new GetFlags

* revert to original required fields for create_pull_request

* fix for UI form submission

* Simplify MCP App UIs for basic branch

Remove advanced features to be kept in mcp-ui-apps-advanced:
- Strip labels, assignees, milestones, issue types, repo picker from issue-write
- Strip repo picker, branch selectors from pr-write
- Delete ui_get tool (ui_tools.go, ui_tools_test.go, ui_get.snap)
- Remove UIGet registration from tools.go

Basic forms retain: title, body, submit with _ui_submitted,
draft/regular split button (PR), MarkdownEditor, and SuccessView.

* Fix header spacing in issue-write and pr-write UIs

Add proper spacing between icon, title text, and repo name in the
header bar for both issue-write and create-pull-request forms.

* fix UI spacing

* Add insiders flag to User-Agent header

When InsidersMode is enabled, append '(insiders)' to the User-Agent
string sent with GitHub API requests, enabling server-side adoption
tracking.

* address ui feedback

* added ui/no-ui support

* improve active state UI for write and preview button. make padding consistent in textarea

* return to prev non ui check

* use hardcoded client name check for ui support

* linter fixes

* merge fix

* linter fix 2

---------

Co-authored-by: tommaso-moro <tommaso-moro@github.com>
2026-02-12 13:03:00 +00:00
Ksenia Bobrova 09d38df96f Use Contents API instead of raw endpoint to fetch file content (#1998)
* Use Contents API instead of raw endpoint to fetch file content

* Address Copilot comment

* Fix linter errors
2026-02-12 13:43:41 +01:00
Oleksandr Redko 505d5dc33a refactor: modernize code with modernize and intrange 2026-02-12 12:58:49 +01:00
JoannaaKL 266bd9311e Gogithub update (#2004)
* Bump google/go-github

* chore: regenerate license files

Auto-generated by license-check workflow

* Fix required block

* Go mod vendor and tidy again

* Remove unused fatih/color dependency to fix CI (#2005)

* Initial plan

* Remove unused github.com/fatih/color dependency

The fatih/color package was listed in go.mod but not actually imported
or used anywhere in the codebase. This caused the CI "go mod tidy -diff"
check to fail. Running go mod tidy removed:
- github.com/fatih/color v1.18.0
- github.com/mattn/go-colorable v0.1.13 (transitive)
- github.com/mattn/go-isatty v0.0.20 (transitive)

Fixes the failing ubuntu-latest workflow build.

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-02-12 11:04:54 +01:00
copilot-swe-agent[bot] 3c53687eb3 Remove old non-consolidated actions and Projects toolsets
This commit removes the old individual tool implementations for
Actions and Projects toolsets that have been superseded by consolidated
tools (actions_list, actions_get, actions_run_trigger, get_job_logs,
projects_list, projects_get, projects_write).

Removed old Actions tools:
- ListWorkflows, ListWorkflowRuns, RunWorkflow, GetWorkflowRun
- GetWorkflowRunLogs, ListWorkflowJobs, GetJobLogs
- RerunWorkflowRun, RerunFailedJobs, CancelWorkflowRun
- ListWorkflowRunArtifacts, DownloadWorkflowRunArtifact
- DeleteWorkflowRunLogs, GetWorkflowRunUsage

Removed old Projects tools:
- ListProjects, GetProject, ListProjectFields, GetProjectField
- ListProjectItems, GetProjectItem, AddProjectItem
- UpdateProjectItem, DeleteProjectItem

Also removed:
- Feature flag constants (FeatureFlagHoldbackConsolidatedActions/Projects)
- FeatureFlagDisable from consolidated tools
- Old toolsnaps for removed tools
- Tests for removed tools
- Unused helper function toNewProjectType

Co-authored-by: mattdholloway <918573+mattdholloway@users.noreply.github.com>
2026-02-10 12:55:24 +01:00
Adam Holt aa302209b0 Add Streamable HTTP mode (#1849)
Adds new `http` command supporting Streamable HTTP support, OAuth Metadata handler and Scope filtering.

Co-authored-by: kerobbi <kerobbi@github.com>
Co-authored-by: Matt Holloway <mattdholloway@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 15:33:41 +01:00
Ilya Kamens a9edf9e04c Add reply to PR comment (#1856)
* Update snapshots

There was a change on `main` before I changed anything

* feat: add add_reply_to_pull_request_comment tool

Add a new tool that allows AI agents to reply to existing pull request comments. This tool uses GitHub's CreateCommentInReplyTo REST API to create threaded conversations on pull requests.

Features:

Reply to any existing PR comment using its ID
Proper error handling for missing parameters and API failures
Comprehensive test coverage (8 test cases)
Follows project patterns and conventions
Registered in pull_requests toolset as a write operation
Parameters:

owner: Repository owner (required)
repo: Repository name (required)
pullNumber: Pull request number (required)
commentId: ID of comment to reply to (required)
body: Reply text content (required)
This tool complements the existing add_comment_to_pending_review tool by enabling responses to already-posted comments, enhancing AI-powered code review workflows.

Closes: #635

* Update README

* fix types

---------

Co-authored-by: tommaso-moro <tommaso-moro@github.com>
Co-authored-by: Tommaso Moro <37270480+tommaso-moro@users.noreply.github.com>
Co-authored-by: plaskowski <1999603+plaskowski@users.noreply.github.com>
Co-authored-by: Rob Emanuele <2320142+lossyrob@users.noreply.github.com>
2026-02-04 17:46:21 +00:00
Roberto Nacu fb53abdbe2 replace context.Background() (#1948)
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
MCP Server Diff / mcp-diff (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
2026-02-03 15:42:14 +00:00
tonytrg 7af51a079a adding correct insiders-mode name 2026-01-26 16:28:36 +01:00
Matt Holloway 60a8c21b8a remove old flags 2026-01-26 16:02:20 +01:00
Matt Holloway 0a62aabc94 default to consolidated actions/projects toolsets and add hold back flag 2026-01-26 15:07:38 +01:00
Tommaso Moro 15e66b3df3 Generate server instructions in Inventory (#1869)
* carry over from https://github.com/github/github-mcp-server/pull/1863

* remove unused inv

* update toolsnap

---------

Co-authored-by: Sam Morrow <info@sam-morrow.com>
2026-01-23 09:57:47 +00:00
Sam Morrow 5e5ff27486 Address PR review feedback
- Extract dual-fetch logic into listProjectsFromBothOwnerTypes helper
- Rename addProjectItemWithResolution to addProjectItem (old function removed)
- Add GraphQL test coverage for add_project_item using githubv4mock
- Tests cover both org/issue and user/pull_request success paths
2026-01-22 23:27:21 +01:00
copilot-swe-agent[bot] eaaf1ea833 Update consolidated projects tools: make owner_type optional and fix add_project_item
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>

Fix tests and update toolsnaps for consolidated projects tools

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-22 23:27:21 +01:00
Sam Morrow a663a6b1f8 feat: add progress notifications during PR polling in assign_copilot_to_issue
Add MCP progress notifications during the PR polling loop to provide
real-time status updates while waiting for Copilot to create a PR.

Changes:
- Use the request parameter to access the ServerSession for notifications
- Send an initial progress notification when polling starts
- Send progress updates on each polling attempt with attempt count
- Only send notifications when progressToken is provided by the client

This aligns with the behavior in create_pull_request_with_copilot tool
and improves the user experience during the waiting period.
2026-01-16 11:37:26 +01:00
Sam Morrow f1d33d51f6 refactor: use GraphQLFeaturesTransport internally
Replace inline GraphQL-Features header logic in bearerAuthTransport with
the exported GraphQLFeaturesTransport. This removes code duplication and
ensures the transport is actually used, not just exported.
2026-01-16 11:37:26 +01:00
Sam Morrow d3ff0a2d07 fix: address review feedback
- Document GraphQLFeaturesTransport is for library consumers
- Convert githubv4.Int/String to native Go types in result map
- Remove misleading log comment since tool handlers lack logger access
2026-01-16 11:37:26 +01:00
Sam Morrow 92d8d51f08 fix: remove tool name reference from pending note message 2026-01-16 11:37:26 +01:00
Sam Morrow bece2b54cc fix: filter PRs by timestamp to avoid returning stale results
When polling for a linked PR after assigning Copilot to an issue,
we now capture the assignment time before the mutation and filter
to only return PRs created after that time. This prevents the tool
from incorrectly returning old PRs from previous Copilot assignments.
2026-01-16 11:37:26 +01:00
Sam Morrow 09adfc71ba feat: poll for linked PR after assigning Copilot to issue
Enhances the assign_copilot_to_issue tool to automatically poll for
the PR created by the Copilot coding agent after assignment.

Changes:
- Add findLinkedCopilotPR() to query issue timeline for CrossReferencedEvent
  items from PRs authored by copilot-swe-agent
- Add polling loop (9 attempts, 1s delay) matching remote server latency
- Return structured JSON with PR details when found, or helpful note otherwise
- Add PollConfig for configurable polling (used in tests to disable)
- Add GraphQLFeaturesTransport for feature flag header support

The returned response now includes:
- issue_number, issue_url, owner, repo
- pull_request object (if found during polling)
- Note with instructions to use get_copilot_job_status if PR not yet created
2026-01-16 11:37:26 +01:00
Tony Truong 3af1129c6b adding feature flag on dependency level (#1801)
* wip injecting ff function into tool as dep

* remove debug

* fix linter

* add better test

* adding compile time check

* move experimental to seperate config/ff value

* adding test var

* fixing test

* adding flag and possibility to call feature checker

* fixing name
2026-01-16 11:22:39 +01:00
copilot-swe-agent[bot] ccf519177e Fix dismiss_notification to accept HTTP 204 No Content response
- Add http.StatusNoContent (204) to the list of accepted success status codes
- Add test case for 204 response when marking notification as done
- Retain existing test for 200 response for backwards compatibility

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-16 11:16:11 +01:00
copilot-swe-agent[bot] d88eb83a4f Add custom_instructions parameter to assign_copilot_to_issue tool
- Added optional custom_instructions parameter to tool schema
- Updated implementation to pass custom instructions to agent assignment
- Added test case to verify custom_instructions works correctly
- Updated toolsnaps and documentation

The custom_instructions parameter allows users to provide additional
context, constraints, or guidance to the Copilot agent beyond what's
in the issue body, addressing the issue where additional context
would otherwise be lost.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 18:09:34 +01:00
Tommaso Moro 19beb33c3f Bug fix: invalid tool should error out (#1776)
* get it working

* clean up approach by moving cleantools inside builder, this simplifies remote server too

* add tests for trimming and deduplication

* error out in the builder if there are unrecognized tools

---------

Co-authored-by: Sam Morrow <info@sam-morrow.com>
2026-01-15 17:37:06 +01:00
copilot-swe-agent[bot] 0bf791a4ce Regenerate toolsnaps with deterministic sorting
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 17:33:22 +01:00
copilot-swe-agent[bot] 87a1110c15 Implement recursive JSON key sorting for toolsnaps
Sort all JSON object keys alphabetically at every level in toolsnaps by
unmarshaling and remarshaling. This leverages Go's built-in behavior where
json.Marshal automatically sorts map keys alphabetically, ensuring
consistent field ordering and eliminating noop churn in diffs.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 16:15:39 +01:00
copilot-swe-agent[bot] d18f26e559 Add GraphQL-Features header support for agent assignment API
- Add context-based GraphQL feature flag support
- Modify bearerAuthTransport to read features from context and add GraphQL-Features header
- Use issues_copilot_assignment_api_support feature flag for updateIssue mutation
- Export GetGraphQLFeatures function for use in HTTP transport layer

This allows the assign_copilot_to_issue tool to work with the non-GA agent assignment API
by sending the required GraphQL-Features header.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 15:45:58 +01:00
copilot-swe-agent[bot] 88d117bd82 Add base_ref support to assign_copilot_to_issue tool
- Add optional base_ref parameter to tool schema
- Change from replaceActorsForAssignable to updateIssue mutation with agentAssignment
- Add AgentAssignmentInput and UpdateIssueInput structs for new GraphQL mutation
- Update all tests to use new mutation structure
- Add test case for base_ref functionality
- Update toolsnaps and documentation

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 15:45:58 +01:00
Sam Morrow 676956faf3 Fix resource handler to use deps from context
The RepositoryResourceContentsHandler was using closure-captured deps
instead of retrieving them from context at call time. This causes issues
on the remote server which injects per-request deps via context.

Changed to use MustDepsFromContext(ctx) pattern consistent with tool
handlers in NewTool and NewToolFromHandler.
2026-01-12 14:05:19 +01:00
Sam Morrow cc9e8645c1 Fix nil pointer dereference in completion handler
The CompleteParams.Context field is optional (marked omitempty) and can be
nil when clients don't send it. The code was accessing Context.Arguments
directly without checking if Context was nil first, causing a panic.

This fix adds a nil check for Context before accessing Arguments.
2026-01-07 15:44:58 +00:00
Matt Holloway 71862a93e4 update tests to use new mock pattern 2026-01-06 17:38:12 +00:00
Matt Holloway a57b4726e5 add http resp code checking for getProjectItem 2026-01-06 17:38:12 +00:00
Matt Holloway be5a449e48 fix project tools to add scope to newtool init 2026-01-06 17:38:12 +00:00
Matt Holloway 099f995615 revert "hold-bac feature flag" 2026-01-06 17:38:12 +00:00
Matt Holloway 304f07401e hold-bac feature flag 2026-01-06 17:38:12 +00:00
Matt Holloway 3cd0be2af2 update tool aliases 2026-01-06 17:38:12 +00:00
Matt Holloway 66a01645f8 initial projects consolidation 2026-01-06 17:38:12 +00:00
Copilot 80b0306557 Replace go-github-mock with stretchr/testify for actions/issues/projects tests (#1737)
* Initial plan

* migrate tests from go-github-mock to internal testify-based mock

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* address feedback in testmock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* tweak testmock path matching edge case

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* refine testmock options and path matching

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* simplify matchPath and document delete endpoint

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* fix tests and lint after mock cleanup

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Remove import completely

* Partial removal in repositories_test.go

* Final removal

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
Co-authored-by: JoannaaKL <joannaakl@github.com>
2026-01-06 10:45:29 +01:00