Skip to content

Commit 55ec0b5

Browse files
authored
Merge branch 'main' into dependabot/github_actions/goreleaser/goreleaser-action-6.4.0
2 parents 30c2bce + af534df commit 55ec0b5

19 files changed

+920
-62
lines changed

.github/workflows/code-scanning.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
language: ${{ matrix.language }}
6565
- name: Setup Go
66-
uses: actions/setup-go@v5
66+
uses: actions/setup-go@v6
6767
if: matrix.language == 'go' && fromJSON(steps.resolve-environment.outputs.environment).configuration.go.version
6868
with:
6969
go-version: ${{ fromJSON(steps.resolve-environment.outputs.environment).configuration.go.version }}

.github/workflows/docker-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ on:
1414
tags: ["v*.*.*"]
1515
pull_request:
1616
branches: ["main", "next"]
17+
workflow_dispatch:
18+
inputs:
19+
description:
20+
required: false
21+
description: "Description of the run."
22+
type: string
23+
default: "Manual run"
1724

1825
env:
1926
# Use docker.io for Docker Hub if empty
@@ -39,7 +46,7 @@ jobs:
3946
# https://github.com/sigstore/cosign-installer
4047
- name: Install cosign
4148
if: github.event_name != 'pull_request'
42-
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
49+
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 #v3.10.0
4350
with:
4451
cosign-release: "v2.2.4"
4552

.github/workflows/docs-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v5
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v5
20+
uses: actions/setup-go@v6
2121
with:
2222
go-version-file: 'go.mod'
2323

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/checkout@v5
1919

2020
- name: Set up Go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version-file: "go.mod"
2424

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v5
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v5
20+
uses: actions/setup-go@v6
2121
with:
2222
go-version-file: "go.mod"
2323

.github/workflows/license-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v5
1515

1616
- name: Set up Go
17-
uses: actions/setup-go@v5
17+
uses: actions/setup-go@v6
1818
with:
1919
go-version-file: "go.mod"
2020
- name: check licenses

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v5
17-
- uses: actions/setup-go@v5
17+
- uses: actions/setup-go@v6
1818
with:
1919
go-version: stable
2020
- name: golangci-lint
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to MCP Registry
2+
3+
on:
4+
push:
5+
tags: ["v*"] # Triggers on version tags like v1.0.0
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Required for OIDC authentication
13+
contents: read
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Fetch tags
20+
run: git fetch --tags
21+
22+
- name: Install MCP Publisher
23+
run: |
24+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
25+
26+
- name: Update server.json version
27+
run: |
28+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
29+
# Use the tag that triggered the workflow
30+
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
31+
echo "Using triggered tag: ${{ github.ref_name }}"
32+
else
33+
# Fallback to latest tag (for manual triggers)
34+
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
35+
if [ -z "$LATEST_TAG" ]; then
36+
echo "❌ No release tag found. Cannot determine version."
37+
exit 1
38+
fi
39+
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
40+
echo "Using latest tag: $LATEST_TAG"
41+
fi
42+
sed -i "s/\${VERSION}/$TAG_VERSION/g" server.json
43+
echo "Updated server.json version to $TAG_VERSION"
44+
45+
- name: Login to MCP Registry
46+
run: ./mcp-publisher login github-oidc
47+
48+
- name: Publish to MCP Registry
49+
run: ./mcp-publisher publish

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,19 @@ The following sets of tools are available (all are on by default):
658658

659659
<summary>Projects</summary>
660660

661+
- **get_project** - Get project
662+
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
663+
- `owner_type`: Owner type (string, required)
664+
- `project_number`: The project's number (number, required)
665+
666+
- **list_project_fields** - List project fields
667+
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
668+
- `owner_type`: Owner type (string, required)
669+
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
670+
- `projectNumber`: The project's number. (string, required)
671+
661672
- **list_projects** - List projects
662-
- `after`: Cursor for items after (forward pagination) (string, optional)
663-
- `before`: Cursor for items before (backwards pagination) (string, optional)
664-
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == organization it is the name of the organization. The name is not case sensitive. (string, required)
673+
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
665674
- `owner_type`: Owner type (string, required)
666675
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
667676
- `query`: Filter projects by a search query (matches title and description) (string, optional)
@@ -1017,6 +1026,17 @@ The following sets of tools are available (all are on by default):
10171026

10181027
</details>
10191028

1029+
<details>
1030+
1031+
<summary>Copilot Spaces</summary>
1032+
1033+
- **get_copilot_space** - Get Copilot Space
1034+
- `owner`: The owner of the space. (string, required)
1035+
- `name`: The name of the space. (string, required)
1036+
1037+
- **list_copilot_spaces** - List Copilot Spaces
1038+
</details>
1039+
10201040
#### Specifying Toolsets
10211041

10221042
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:

internal/ghmcp/server.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ func NewMCPServer(cfg MCPServerConfig) (*server.MCPServer, error) {
105105
},
106106
}
107107

108-
ghServer := github.NewServer(cfg.Version, server.WithHooks(hooks))
109-
110108
enabledToolsets := cfg.EnabledToolsets
111109
if cfg.DynamicToolsets {
112110
// filter "all" from the enabled toolsets
@@ -118,6 +116,14 @@ func NewMCPServer(cfg MCPServerConfig) (*server.MCPServer, error) {
118116
}
119117
}
120118

119+
// Generate instructions based on enabled toolsets
120+
instructions := github.GenerateInstructions(enabledToolsets)
121+
122+
ghServer := github.NewServer(cfg.Version,
123+
server.WithInstructions(instructions),
124+
server.WithHooks(hooks),
125+
)
126+
121127
getClient := func(_ context.Context) (*gogithub.Client, error) {
122128
return restClient, nil // closing over client
123129
}

0 commit comments

Comments
 (0)