Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] main from github:main#65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pull merged 5 commits intocodingwatching:mainfromgithub:main
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletioncmd/mcpcurl/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@ The `--stdio-server-cmd` flag is required for all commands and specifies the com

### Examples

List available tools inAnthropic's MCP server:
List available tools inGithub's MCP server:

```console
% ./mcpcurl --stdio-server-cmd "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github" tools --help
Expand Down
35 changes: 14 additions & 21 deletionse2e/e2e_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,6 @@ package e2e_test

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
Expand DownExpand Up@@ -508,17 +507,14 @@ func TestFileDeletion(t *testing.T) {
require.NoError(t, err, "expected to call 'get_file_contents' tool successfully")
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))

textContent, ok = resp.Content[0].(mcp.TextContent)
require.True(t, ok, "expected content to be of typeTextContent")
embeddedResource, ok:= resp.Content[1].(mcp.EmbeddedResource)
require.True(t, ok, "expected content to be of typeEmbeddedResource")

var trimmedGetFileText struct {
Content string `json:"content"`
}
err = json.Unmarshal([]byte(textContent.Text), &trimmedGetFileText)
require.NoError(t, err, "expected to unmarshal text content successfully")
b, err := base64.StdEncoding.DecodeString(trimmedGetFileText.Content)
require.NoError(t, err, "expected to decode base64 content successfully")
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), string(b), "expected file content to match")
// raw api
textResource, ok := embeddedResource.Resource.(mcp.TextResourceContents)
require.True(t, ok, "expected embedded resource to be of type TextResourceContents")

require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), textResource.Text, "expected file content to match")

// Delete the file
deleteFileRequest := mcp.CallToolRequest{}
Expand DownExpand Up@@ -703,17 +699,14 @@ func TestDirectoryDeletion(t *testing.T) {
require.NoError(t, err, "expected to call 'get_file_contents' tool successfully")
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))

textContent, ok = resp.Content[0].(mcp.TextContent)
require.True(t, ok, "expected content to be of typeTextContent")
embeddedResource, ok:= resp.Content[1].(mcp.EmbeddedResource)
require.True(t, ok, "expected content to be of typeEmbeddedResource")

var trimmedGetFileText struct {
Content string `json:"content"`
}
err = json.Unmarshal([]byte(textContent.Text), &trimmedGetFileText)
require.NoError(t, err, "expected to unmarshal text content successfully")
b, err := base64.StdEncoding.DecodeString(trimmedGetFileText.Content)
require.NoError(t, err, "expected to decode base64 content successfully")
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), string(b), "expected file content to match")
// raw api
textResource, ok := embeddedResource.Resource.(mcp.TextResourceContents)
require.True(t, ok, "expected embedded resource to be of type TextResourceContents")

require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), textResource.Text, "expected file content to match")

// Delete the directory containing the file
deleteFileRequest := mcp.CallToolRequest{}
Expand Down
2 changes: 1 addition & 1 deletioninternal/toolsnaps/toolsnaps.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,7 +60,7 @@ func Test(toolName string, tool any) error {
diff := toolNode.Diff(snapNode, jd.SET).Render()
if diff != "" {
// If there is a difference, we return an error with the diff
return fmt.Errorf("tool schema for %s has changed unexpectedly:\n%s", toolName, diff)
return fmt.Errorf("tool schema for %s has changed unexpectedly:\n%s\nrun with `UPDATE_TOOLSNAPS=true` if this is expected", toolName, diff)
}

return nil
Expand Down
9 changes: 9 additions & 0 deletionsinternal/toolsnaps/toolsnaps_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,9 @@ func TestSnapshotDoesNotExistNotInCI(t *testing.T) {

func TestSnapshotDoesNotExistInCI(t *testing.T) {
withIsolatedWorkingDir(t)
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
// UPDATE_TOOLSNAPS=true go test ./...
t.Setenv("UPDATE_TOOLSNAPS", "false")

// Given we are running in CI
t.Setenv("GITHUB_ACTIONS", "true")
Expand DownExpand Up@@ -74,6 +77,9 @@ func TestSnapshotExistsMatch(t *testing.T) {

func TestSnapshotExistsDiff(t *testing.T) {
withIsolatedWorkingDir(t)
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
// UPDATE_TOOLSNAPS=true go test ./...
t.Setenv("UPDATE_TOOLSNAPS", "false")

// Given a non-matching snapshot file exists
require.NoError(t, os.MkdirAll("__toolsnaps__", 0700))
Expand DownExpand Up@@ -109,6 +115,9 @@ func TestUpdateToolsnaps(t *testing.T) {

func TestMalformedSnapshotJSON(t *testing.T) {
withIsolatedWorkingDir(t)
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
// UPDATE_TOOLSNAPS=true go test ./...
t.Setenv("UPDATE_TOOLSNAPS", "false")

// Given a malformed snapshot file exists
require.NoError(t, os.MkdirAll("__toolsnaps__", 0700))
Expand Down
35 changes: 35 additions & 0 deletionspkg/github/__toolsnaps__/add_issue_comment.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
{
"annotations": {
"title": "Add comment to issue",
"readOnlyHint": false
},
"description": "Add a comment to a specific issue in a GitHub repository.",
"inputSchema": {
"properties": {
"body": {
"description": "Comment content",
"type": "string"
},
"issue_number": {
"description": "Issue number to comment on",
"type": "number"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"issue_number",
"body"
],
"type": "object"
},
"name": "add_issue_comment"
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
{
"annotations": {
"title": "Add comment to the requester's latest pending pull request review",
"readOnlyHint": false
},
"description": "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).",
"inputSchema": {
"properties": {
"body": {
"description": "The text of the review comment",
"type": "string"
},
"line": {
"description": "The line of the blob in the pull request diff that the comment applies to. For multi-line comments, the last line of the range",
"type": "number"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"path": {
"description": "The relative path to the file that necessitates a comment",
"type": "string"
},
"pullNumber": {
"description": "Pull request number",
"type": "number"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"side": {
"description": "The side of the diff to comment on. LEFT indicates the previous state, RIGHT indicates the new state",
"enum": [
"LEFT",
"RIGHT"
],
"type": "string"
},
"startLine": {
"description": "For multi-line comments, the first line of the range that the comment applies to",
"type": "number"
},
"startSide": {
"description": "For multi-line comments, the starting side of the diff that the comment applies to. LEFT indicates the previous state, RIGHT indicates the new state",
"enum": [
"LEFT",
"RIGHT"
],
"type": "string"
},
"subjectType": {
"description": "The level at which the comment is targeted",
"enum": [
"FILE",
"LINE"
],
"type": "string"
}
},
"required": [
"owner",
"repo",
"pullNumber",
"path",
"body",
"subjectType"
],
"type": "object"
},
"name": "add_pull_request_review_comment_to_pending_review"
}
31 changes: 31 additions & 0 deletionspkg/github/__toolsnaps__/assign_copilot_to_issue.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
{
"annotations": {
"title": "Assign Copilot to issue",
"readOnlyHint": false,
"idempotentHint": true
},
"description": "Assign Copilot to a specific issue in a GitHub repository.\n\nThis tool can help with the following outcomes:\n- a Pull Request created with source code changes to resolve the issue\n\n\nMore information can be found at:\n- https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot\n",
"inputSchema": {
"properties": {
"issueNumber": {
"description": "Issue number",
"type": "number"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"issueNumber"
],
"type": "object"
},
"name": "assign_copilot_to_issue"
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
{
"annotations": {
"title": "Create and submit a pull request review without comments",
"readOnlyHint": false
},
"description": "Create and submit a review for a pull request without review comments.",
"inputSchema": {
"properties": {
"body": {
"description": "Review comment text",
"type": "string"
},
"commitID": {
"description": "SHA of commit to review",
"type": "string"
},
"event": {
"description": "Review action to perform",
"enum": [
"APPROVE",
"REQUEST_CHANGES",
"COMMENT"
],
"type": "string"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"pullNumber": {
"description": "Pull request number",
"type": "number"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"pullNumber",
"body",
"event"
],
"type": "object"
},
"name": "create_and_submit_pull_request_review"
}
34 changes: 34 additions & 0 deletionspkg/github/__toolsnaps__/create_branch.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
{
"annotations": {
"title": "Create branch",
"readOnlyHint": false
},
"description": "Create a new branch in a GitHub repository",
"inputSchema": {
"properties": {
"branch": {
"description": "Name for new branch",
"type": "string"
},
"from_branch": {
"description": "Source branch (defaults to repo default)",
"type": "string"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"branch"
],
"type": "object"
},
"name": "create_branch"
}
52 changes: 52 additions & 0 deletionspkg/github/__toolsnaps__/create_issue.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
{
"annotations": {
"title": "Open new issue",
"readOnlyHint": false
},
"description": "Create a new issue in a GitHub repository.",
"inputSchema": {
"properties": {
"assignees": {
"description": "Usernames to assign to this issue",
"items": {
"type": "string"
},
"type": "array"
},
"body": {
"description": "Issue body content",
"type": "string"
},
"labels": {
"description": "Labels to apply to this issue",
"items": {
"type": "string"
},
"type": "array"
},
"milestone": {
"description": "Milestone number",
"type": "number"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"title": {
"description": "Issue title",
"type": "string"
}
},
"required": [
"owner",
"repo",
"title"
],
"type": "object"
},
"name": "create_issue"
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp