Skip to content

Commit b514001

Browse files
committed
git commit -m "chore: release 1.0.0" -m "Release-As: 1.0.0"
0 parents  commit b514001

File tree

6 files changed

+280
-0
lines changed

6 files changed

+280
-0
lines changed

.github/workflows/lint-pr.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
pr-check:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Lint PR
22+
uses: amannn/action-semantic-pull-request@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
wip: false # needs write access if enabled
27+
requireScope: false
28+
subjectPattern: ^(?![A-Z]).+$
29+
subjectPatternError: |
30+
The subject "{subject}" found in the pull request title "{title}"
31+
didn't match the configured pattern. Please ensure that the subject
32+
starts with a lowercase character.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
name: release-please
10+
env:
11+
ACTION_NAME: release-please-action
12+
jobs:
13+
release-please-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
id: release
18+
with:
19+
token: ${{ secrets.RP_SECRET }}
20+
release-type: simple
21+
skip-github-pull-request: true
22+
- uses: actions/checkout@v4
23+
- name: tag major and minor versions
24+
run: |
25+
git config user.name github-actions[bot]
26+
git config user.email github-actions[bot]@users.noreply.github.com
27+
git tag -d v${{ steps.release.outputs.major }} || true
28+
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
29+
git push origin :v${{ steps.release.outputs.major }} || true
30+
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
31+
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
32+
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
33+
git push origin v${{ steps.release.outputs.major }}
34+
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
35+
if: ${{ steps.release.outputs.release_created }}
36+
release-please-pr:
37+
runs-on: ubuntu-latest
38+
needs:
39+
- release-please-release
40+
steps:
41+
- id: release-pr
42+
uses: googleapis/release-please-action@v4
43+
with:
44+
token: ${{ secrets.RP_SECRET }}
45+
release-type: simple
46+
fork: false
47+
skip-github-release: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_store

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Rust MCP Stack (mcp-discovery-action)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
20+
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# MCP Discovery Action
2+
3+
A GitHub Action to run the [MCP Discovery](https://github.com/rust-mcp-stack/mcp-discovery) CLI for creating, updating or printing MCP server capability details in a Markdown or other formatted file.
4+
5+
## Overview
6+
7+
This action runs the [MCP Discovery](https://github.com/rust-mcp-stack/mcp-discovery) CLI to discover MCP server capabilities and create/update a file with MCP server details (`create` or `update` commands). It supports all CLI options, including built-in templates (`md`, `md-plain`, `html`, `txt`), custom Handlebars template files, or template strings.
8+
9+
The action downloads the latest version of the CLI binary by default, but you can specify a specific version using the action's version input.
10+
11+
## Inputs
12+
13+
| Input | Description | Required | Default |
14+
| -------------------- | ------------------------------------------------------------------------------------------------ | -------- | --------------------- |
15+
| `command` | CLI command to run (`create`, `update` or `print`). | Yes | - |
16+
| `mcp-launch-command` | Command and arguments to launch the MCP server (e.g., `java -jar mcp.jar`). | Yes | - |
17+
| `filename` | Output file path for `create`/`update` commands (e.g., `docs/mcp-details.md`). | No | `mcp-discovery.md` |
18+
| `template` | Built-in template for output (`md`, `md-plain`, `html`, `txt`). | No | - |
19+
| `template-file` | Path to a custom Handlebars template file in the repository. | No | - |
20+
| `template-string` | Custom Handlebars template content as a string. | No | - |
21+
| `token` | Optional GitHub token with content write permission. | No | `${{ github.token }}` |
22+
| `version` | Version of the `mcp-discovery` CLI to use (e.g., `v0.1.2`). Use `latest` for the latest release. | No | `latest` |
23+
24+
💡 For more information and command examples, refer to the [MCP Discovery documentation](https://rust-mcp-stack.github.io/mcp-discovery).
25+
26+
## Usage
27+
28+
### Example 1: Create a Markdown File
29+
30+
Create `mcp-discovery.md` with MCP server capabilities and commit it if changed.
31+
32+
```yaml
33+
name: MCP Discovery (create)
34+
on:
35+
push:
36+
branches:
37+
- main
38+
permissions:
39+
contents: write
40+
jobs:
41+
generate-md:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- uses: rust-mcp-stack/mcp-discovery-action@v1
49+
with:
50+
version: 'latest'
51+
command: 'create'
52+
mcp-launch-command: '[THE COMMAND YOU USE TO START YOUR MCP SERVER]'
53+
filename: 'mcp-discovery.md'
54+
```
55+
56+
### Example 2: Update a designated section of the README.md file
57+
58+
💡 For more information about `update` command and template markers, visit [MCP Discovery documentation](https://rust-mcp-stack.github.io/mcp-discovery/#/guide/mcp-discovery-markers).
59+
60+
```yaml
61+
name: MCP Discovery (update)
62+
on:
63+
push:
64+
branches:
65+
- main
66+
permissions:
67+
contents: write
68+
jobs:
69+
generate-md:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
with:
74+
token: ${{ secrets.GITHUB_TOKEN }}
75+
76+
- uses: rust-mcp-stack/mcp-discovery-action@v1
77+
with:
78+
version: 'latest'
79+
command: 'update'
80+
mcp-launch-command: '[THE COMMAND YOU USE TO START YOUR MCP SERVER]'
81+
filename: 'README.md'
82+
```
83+
84+
## Contributing
85+
86+
Contributions are welcome! Please open an issue or pull request in the [mcp-discovery-action repository](https://github.com/rust-mcp-stack/mcp-discovery).
87+
88+
## License
89+
90+
MIT License. See [LICENSE](LICENSE) for details.

action.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: "MCP Discovery Action"
2+
author: "Ali Hashemi"
3+
description: "A GitHub Action to run the mcp-discovery CLI for printing, creating, or updating MCP server capability details"
4+
5+
inputs:
6+
token:
7+
description: "GitHub token used for creating or updating output files containing MCP server capabilities. Defaults to the built-in secrets.GITHUB_TOKEN."
8+
required: false
9+
default: ${{ github.token }}
10+
command:
11+
description: "CLI command to run (print, create, or update)"
12+
required: true
13+
mcp-launch-command:
14+
description: "Command and arguments to launch the MCP server (e.g., rust-mcp-filesystem . )"
15+
required: true
16+
filename:
17+
description: "Output file path for create/update commands"
18+
default: "mcp-discovery.md"
19+
required: false
20+
template:
21+
description: "Built-in template for output (md, md-plain, html, txt)"
22+
required: false
23+
template-file:
24+
description: "Path to a custom Handlebars template file"
25+
required: false
26+
template-string:
27+
description: "Custom Handlebars template content as a string"
28+
required: false
29+
version:
30+
description: "CLI version (e.g., latest or v0.1.2)"
31+
required: true
32+
default: "latest"
33+
34+
runs:
35+
using: "composite"
36+
steps:
37+
- name: Set mcp-discovery CLI version
38+
id: set-url
39+
shell: bash
40+
run: |
41+
if [ "${{ inputs.version }}" = "latest" ]; then
42+
echo "INSTALLER_URL=https://github.com/rust-mcp-stack/mcp-discovery/releases/latest/download/mcp-discovery-installer.sh" >> $GITHUB_ENV
43+
else
44+
echo "INSTALLER_URL=https://github.com/rust-mcp-stack/mcp-discovery/releases/download/${{ inputs.version }}/mcp-discovery-installer.sh" >> $GITHUB_ENV
45+
fi
46+
- name: Install mcp-discovery CLI
47+
shell: bash
48+
run: |
49+
curl --proto '=https' --tlsv1.2 -LsSf $INSTALLER_URL | sh
50+
51+
- name: Run mcp-discovery CLI
52+
shell: bash
53+
env:
54+
CLI_COMMAND: ${{ inputs.command }}
55+
MCP_LAUNCH_COMMAND: ${{ inputs.mcp-launch-command }}
56+
FILENAME: ${{ inputs.filename }}
57+
TEMPLATE: ${{ inputs.template }}
58+
TEMPLATE_FILE: ${{ inputs.template-file }}
59+
TEMPLATE_STRING: ${{ inputs.template-string }}
60+
run: |
61+
# Build CLI arguments
62+
ARGS=""
63+
[ -n "$FILENAME" ] && ARGS="$ARGS --filename \"$FILENAME\""
64+
[ -n "$TEMPLATE" ] && ARGS="$ARGS --template \"$TEMPLATE\""
65+
[ -n "$TEMPLATE_FILE" ] && ARGS="$ARGS --template-file \"$GITHUB_WORKSPACE/$TEMPLATE_FILE\""
66+
[ -n "$TEMPLATE_STRING" ] && ARGS="$ARGS --template-string \"$TEMPLATE_STRING\""
67+
# Run CLI
68+
echo "Running: mcp-discovery $CLI_COMMAND $ARGS -- $MCP_LAUNCH_COMMAND"
69+
eval "mcp-discovery $CLI_COMMAND $ARGS -- $MCP_LAUNCH_COMMAND"
70+
71+
- name: Commit changes
72+
if: ${{ inputs.filename != '' }}
73+
shell: bash
74+
env:
75+
FILENAME: ${{ inputs.filename }}
76+
GITHUB_TOKEN: ${{ inputs.token }}
77+
run: |
78+
git config user.name "GitHub Action"
79+
git config user.email "[email protected]"
80+
git add "$FILENAME"
81+
if git diff --staged --quiet; then
82+
echo "No changes to $FILENAME"
83+
else
84+
git commit -m "Update $FILENAME via mcp-discovery [skip ci]"
85+
git push
86+
fi
87+
branding:
88+
icon: "link"
89+
color: "blue"

0 commit comments

Comments
 (0)