-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 2.48 KB
/
setup.yml
File metadata and controls
64 lines (55 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Template Setup
on:
push:
branches: [main]
# Deny-by-default at workflow level; the `setup` job opts into `issues: write` only.
permissions:
contents: read
jobs:
setup:
if: github.run_number == 1
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v6
- name: Check if template
id: check
run: |
NAME=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['name'])")
if [ "$NAME" = "my-mcp-server" ]; then
echo "is_template=true" >> "$GITHUB_OUTPUT"
else
echo "is_template=false" >> "$GITHUB_OUTPUT"
fi
- name: Create setup checklist
if: steps.check.outputs.is_template == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh issue create \
--title "Setup: Configure your Python MCP server" \
--body "$(cat <<'EOF'
Welcome! You've created a new project from **python-mcp-server-starter**.
## Required
- [ ] Update `pyproject.toml` — change `name`, `description`, `authors`, `[project.scripts]` entry
- [ ] Rename `src/my_mcp_server/` package directory to match your project name
- [ ] Update imports and `pyproject.toml` scripts after rename
- [ ] Replace the inline `greet` example in `src/<your_pkg>/server.py` with your own tools (or split into modules — see `resources/` and `prompts/` for the `register(mcp)` pattern)
- [ ] Set safety annotations on each tool (readOnly, destructive, idempotent, openWorld)
- [ ] Update tests in `tests/`
## PyPI Publishing (OIDC — no tokens needed)
- [ ] Create a PyPI account at [pypi.org](https://pypi.org)
- [ ] Configure a PyPI [Trusted Publisher](https://docs.pypi.org/trusted-publishers/) pointing to this repo's `cd.yml`
- [ ] Create GitHub Environment named `pypi`
## Testing Locally
- [ ] Install editable: `pip install -e ".[dev]"`
- [ ] Run: `python -m my_mcp_server`
- [ ] Test with MCP Inspector: `npx @modelcontextprotocol/inspector python -m my_mcp_server`
- [ ] Add to Claude Desktop config (see README)
## Recommended
- [ ] Add environment variables to `.env` if your tools need API keys
- [ ] Write comprehensive tests for all tools
- [ ] Delete this issue when done
EOF
)"