Skip to content

Commit 807df47

Browse files
authored
Merge branch 'main' into caozhen/event-trace-record
2 parents 09145b7 + b3a7561 commit 807df47

File tree

16 files changed

+3041
-248
lines changed

16 files changed

+3041
-248
lines changed

.github/workflows/auto-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
const branch_name = process.env.branch_name;
124124
125125
// Generate direct PR creation URL
126-
const pr_title = encodeURIComponent(`Add server from issue #${issue_number}`);
126+
const pr_title = encodeURIComponent(`chore: Add server from issue #${issue_number}`);
127127
const pr_url = `https://github.com/${repo.owner}/${repo.repo}/compare/main...${branch_name}?quick_pull=1&title=${pr_title}`;
128128
129129
await github.rest.issues.createComment({

.github/workflows/release.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
id-token: write # Required for PyPI trusted publishing
13+
14+
jobs:
15+
test:
16+
uses: ./.github/workflows/test.yml
17+
18+
release:
19+
name: Release
20+
needs: test
21+
runs-on: ubuntu-latest
22+
environment:
23+
name: pypi
24+
url: https://pypi.org/p/mcpm
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
persist-credentials: false
32+
33+
- name: Generate token
34+
id: generate_token
35+
uses: tibdex/github-app-token@v2
36+
with:
37+
app_id: ${{ secrets.BOT_APP_ID }}
38+
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
39+
40+
- name: Install pnpm
41+
uses: pnpm/action-setup@v4
42+
with:
43+
version: 8
44+
run_install: false
45+
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 'lts/*'
50+
cache: 'pnpm'
51+
52+
- name: Install dependencies
53+
run: pnpm install
54+
55+
- name: Semantic Release
56+
id: semantic
57+
uses: cycjimmy/semantic-release-action@v4
58+
env:
59+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
60+
61+
- name: Install uv with caching
62+
if: steps.semantic.outputs.new_release_published == 'true'
63+
uses: astral-sh/setup-uv@v5
64+
with:
65+
enable-cache: true
66+
cache-dependency-glob: "pyproject.toml"
67+
68+
- name: Build
69+
if: steps.semantic.outputs.new_release_published == 'true'
70+
run: uv build
71+
72+
- name: Publish distribution to PyPI
73+
if: steps.semantic.outputs.new_release_published == 'true'
74+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/semver-check.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Semantic Version Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
semver-check:
9+
name: Validate Semantic Version
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
persist-credentials: false
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 8
26+
run_install: false
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 'lts/*'
32+
cache: 'pnpm'
33+
34+
- name: Install dependencies
35+
run: pnpm install
36+
37+
- name: Check Release
38+
uses: cycjimmy/semantic-release-action@v4
39+
with:
40+
dry_run: true
41+
ci: false
42+
unset_gha_env: true
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Comment PR
47+
if: always()
48+
uses: actions/github-script@v7
49+
with:
50+
script: |
51+
const semanticResult = process.env.SEMANTIC_OUTPUT;
52+
let comment = '## Semantic Version Check\n\n';
53+
54+
if (semanticResult && semanticResult.includes('The next release version is')) {
55+
const versionMatch = semanticResult.match(/The next release version is (.*)/);
56+
if (versionMatch) {
57+
comment += `✅ Valid semantic version changes detected!\n\n`;
58+
comment += `Next version will be: **${versionMatch[1]}**\n`;
59+
}
60+
} else {
61+
comment += `⚠️ No semantic version changes detected.\n\n`;
62+
comment += 'Please ensure your commits follow the [Conventional Commits](https://www.conventionalcommits.org/) format:\n\n';
63+
comment += '- `feat: new feature` (triggers MINOR version bump)\n';
64+
comment += '- `fix: bug fix` (triggers PATCH version bump)\n';
65+
comment += '- `BREAKING CHANGE: description` (triggers MAJOR version bump)\n';
66+
}
67+
68+
github.rest.issues.createComment({
69+
issue_number: context.issue.number,
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
body: comment
73+
});

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test & Validate
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
validate-manifests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Validate Server JSON Files
19+
uses: cardinalby/schema-validator-action@v3
20+
with:
21+
file: 'mcp-registry/servers/*.json'
22+
schema: 'mcp-registry/schema/server-schema.json'
23+
mode: 'default'
24+
fixSchemas: false
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.10'
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v5
36+
with:
37+
enable-cache: true
38+
- name: Run tests
39+
run: |
40+
uv sync --group dev
41+
uv run pytest
42+
43+
lint:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.10'
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v5
53+
with:
54+
enable-cache: true
55+
- name: Check code style with ruff
56+
run: |
57+
uv sync --group dev
58+
uv run ruff check src/ tests/

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,7 @@ _dev/
7373
.DS_Store
7474

7575
# folder
76-
local/
76+
local/
77+
78+
# node
79+
node_modules/

.releaserc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"branches": [
3+
"main",
4+
"master"
5+
],
6+
"plugins": [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
"@semantic-release/changelog",
10+
[
11+
"@semantic-release/exec",
12+
{
13+
"prepareCmd": "echo '__version__ = \"${nextRelease.version}\"' > src/mcpm/version.py"
14+
}
15+
],
16+
[
17+
"@semantic-release/git",
18+
{
19+
"assets": [
20+
"CHANGELOG.md",
21+
"src/mcpm/version.py"
22+
],
23+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
24+
}
25+
]
26+
]
27+
}

dockerfiles/frps/frps.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[common]
22
log_level = trace
33
tcp_mux = true
4-
bind_port = 6276 # 6276 represents MCPM on a T9 keypad (6=M, 2=C, 7=P, 6=M)
4+
# 6276 represents MCPM on a T9 keypad (6=M, 2=C, 7=P, 6=M)
5+
bind_port = 6276
56
dashboard_port = 6277
67
vhost_http_port = 80
78
subdomain_host = my-gpt-wrapper.com

mcp-registry/servers/web-fetch.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"user_agent": {
2323
"description": "Custom user-agent for fetching web content",
2424
"required": false,
25-
"example": "Your User-Agent"
25+
"example": "ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers)"
2626
}
2727
},
2828
"installations": {
@@ -32,7 +32,7 @@
3232
"args": [
3333
"--from",
3434
"git+https://github.com/pathintegral-institute/mcp.science#subdirectory=servers/web-fetch",
35-
"mcp-web-fetch"
35+
"mcp-web-fetch"
3636
],
3737
"description": "Run using uv (recommended)"
3838
},
@@ -94,8 +94,10 @@
9494
}
9595
}
9696
},
97-
"required": ["url"]
97+
"required": [
98+
"url"
99+
]
98100
}
99101
],
100102
"is_official": true
101-
}
103+
}

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "mcpm",
3+
"private": true,
4+
"devDependencies": {
5+
"@semantic-release/changelog": "^6.0.3",
6+
"@semantic-release/commit-analyzer": "^11.1.0",
7+
"@semantic-release/exec": "^6.0.3",
8+
"@semantic-release/git": "^10.0.1",
9+
"@semantic-release/github": "^9.2.6",
10+
"@semantic-release/release-notes-generator": "^12.1.0",
11+
"semantic-release": "^22.0.12"
12+
}
13+
}

0 commit comments

Comments
 (0)