Skip to content

Commit 709ee1c

Browse files
authored
Merge branch 'main' into xw/router-no-profile
2 parents 98a0a7f + 4ded28e commit 709ee1c

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

.github/workflows/semver-check.yml renamed to .github/workflows/semantic-check.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
issues: write
11+
712
jobs:
813
semver-check:
914
name: Validate Semantic Version
1015
runs-on: ubuntu-latest
11-
permissions:
12-
contents: read
13-
pull-requests: write
1416

1517
steps:
1618
- name: Checkout
@@ -40,6 +42,13 @@ jobs:
4042
with:
4143
dry_run: true
4244
ci: false
45+
extra_plugins: |
46+
@semantic-release/commit-analyzer
47+
@semantic-release/release-notes-generator
48+
branches: |
49+
[
50+
"${GITHUB_HEAD_REF}"
51+
]
4352
env:
4453
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4554

.releaserc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"branches": [
3-
"main",
4-
"master"
3+
"main"
54
],
65
"plugins": [
76
"@semantic-release/commit-analyzer",

scripts/get_manifest.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
format="%(asctime)s - %(levelname)s - %(message)s")
1919
logger = logging.getLogger(__name__)
2020

21+
_OUTPUT_DIR = "mcp-registry/servers/"
22+
2123

2224
class ManifestGenerator:
2325
"""Generate and manage MCP server manifests from GitHub repositories."""
@@ -857,11 +859,8 @@ def filter_and_sort_installations(installations: dict[str, dict[str, Any]]) -> d
857859
return dict(sorted_installations)
858860

859861

860-
def main(repo_url: str, is_official: bool = False):
862+
def main(repo_url: str, is_official: bool = False, output_dir: str = _OUTPUT_DIR):
861863
try:
862-
# Ensure the target directory exists
863-
os.makedirs("mcp-registry/servers", exist_ok=True)
864-
865864
# Generate the manifest
866865
generator = ManifestGenerator()
867866
manifest = generator.generate_manifest(repo_url)
@@ -873,11 +872,10 @@ def main(repo_url: str, is_official: bool = False):
873872
"Generated manifest is missing a name and/or author name")
874873

875874
# determine the filename
876-
os.makedirs("local/servers", exist_ok=True)
877-
filename = f"local/servers/{manifest['name']}_new.json"
875+
filename = os.path.join(output_dir, f"{manifest['name']}_new.json")
878876
if not is_official:
879877
name = f"@{manifest['author']['name']}/{manifest['name']}"
880-
filename = f"mcp-registry/servers/{manifest['name']}@{manifest['author']['name']}.json"
878+
filename = os.path.join(output_dir, f"{manifest['name']}@{manifest['author']['name']}.json")
881879
manifest["name"] = name
882880

883881
# save the manifest with the determined filename
@@ -901,18 +899,27 @@ def main(repo_url: str, is_official: bool = False):
901899
sys.exit(1)
902900

903901
repo_url = sys.argv[1].strip()
902+
903+
output_dir = _OUTPUT_DIR
904+
if repo_url == "test":
905+
# overwrite global output directory
906+
output_dir = "local/servers/"
907+
908+
os.makedirs(output_dir, exist_ok=True)
909+
904910
if repo_url == "test":
905911
# run through all the test cases
906912
repo_urls = [
907-
# "https://github.com/modelcontextprotocol/servers/tree/main/src/time",
913+
"https://github.com/modelcontextprotocol/servers/tree/main/src/time",
908914
"https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite",
909-
# "https://github.com/modelcontextprotocol/servers/tree/main/src/slack",
910-
# "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",
911-
# "https://github.com/modelcontextprotocol/servers/tree/main/src/sentry"
915+
"https://github.com/modelcontextprotocol/servers/tree/main/src/slack",
916+
"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",
917+
"https://github.com/modelcontextprotocol/servers/tree/main/src/sentry"
912918
]
919+
913920
for repo_url in repo_urls:
914921
logger.info(f"Processing GitHub URL: {repo_url}")
915-
main(repo_url, is_official=True)
922+
main(repo_url, is_official=True, output_dir=output_dir)
916923
else:
917924
# Check if the URL is a simple URL without protocol
918925
if not repo_url.startswith(("http://", "https://")):
@@ -938,4 +945,4 @@ def main(repo_url: str, is_official: bool = False):
938945
# Initialize logger only once to avoid duplicate logs
939946
logger.info(f"Processing GitHub URL: {repo_url}")
940947

941-
main(repo_url, is_official)
948+
main(repo_url, is_official, output_dir)

0 commit comments

Comments
 (0)