Skip to content

Commit 9a19f4a

Browse files
committed
Rename project from "proxymcp" to "omproxy", update versioning in pyproject.toml, and add CI/CD workflows for testing and release. Introduce new CLI and proxy modules for improved functionality.
1 parent 3f433a7 commit 9a19f4a

File tree

9 files changed

+274
-32
lines changed

9 files changed

+274
-32
lines changed

.github/workflows/ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
PYTHON_VERSION: "3.10"
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ env.PYTHON_VERSION }}
22+
23+
- name: Install uv
24+
run: |
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
27+
28+
- name: Cache uv dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cache/uv
33+
.venv
34+
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
35+
restore-keys: |
36+
${{ runner.os }}-uv-
37+
38+
- name: Install dependencies
39+
run: |
40+
uv venv
41+
source .venv/bin/activate
42+
uv sync
43+
44+
- name: Run tests
45+
run: |
46+
source .venv/bin/activate
47+
pytest tests/
48+
49+
lint:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ env.PYTHON_VERSION }}
58+
59+
- name: Install uv
60+
run: |
61+
curl -LsSf https://astral.sh/uv/install.sh | sh
62+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
63+
64+
- name: Cache uv dependencies
65+
uses: actions/cache@v4
66+
with:
67+
path: |
68+
~/.cache/uv
69+
.venv
70+
key: ${{ runner.os }}-uv-lint-${{ hashFiles('pyproject.toml') }}
71+
restore-keys: |
72+
${{ runner.os }}-uv-lint-
73+
74+
- name: Install dependencies
75+
run: |
76+
uv venv
77+
source .venv/bin/activate
78+
uv sync --only-dev
79+
80+
- name: Run linters
81+
run: |
82+
source .venv/bin/activate
83+
ruff check .
84+
ruff format --check .
85+
86+
build:
87+
needs: [test, lint]
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- name: Set up Python
93+
uses: actions/setup-python@v5
94+
with:
95+
python-version: ${{ env.PYTHON_VERSION }}
96+
97+
- name: Install uv
98+
run: |
99+
curl -LsSf https://astral.sh/uv/install.sh | sh
100+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
101+
102+
- name: Build package
103+
run: |
104+
uv venv
105+
source .venv/bin/activate
106+
uv sync --no-dev
107+
uv build
108+
109+
- name: Upload artifact
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: dist
113+
path: dist/
114+
retention-days: 7

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
PYTHON_VERSION: "3.10"
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
# Needed for PyPI trusted publishing
15+
id-token: write
16+
# Needed for uploading to GitHub releases
17+
contents: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ env.PYTHON_VERSION }}
26+
27+
- name: Install uv
28+
run: |
29+
curl -LsSf https://astral.sh/uv/install.sh | sh
30+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31+
32+
- name: Build package
33+
run: |
34+
uv venv
35+
source .venv/bin/activate
36+
uv sync --no-dev
37+
uv build
38+
39+
- name: Check version matches tag
40+
run: |
41+
PKG_VERSION=$(uv run python -c "from odmcp import __version__; print(__version__)")
42+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
43+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
44+
echo "Version mismatch: Package version ($PKG_VERSION) does not match tag version ($TAG_VERSION)"
45+
exit 1
46+
fi
47+
48+
- name: Upload to GitHub Release
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
files: dist/*
54+
55+
- name: Publish to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: dist/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ An open source proxy for MCP servers.
44

55
## Usage
66

7-
Replace the mcp server command with `uvx proxymcp` followed by the command.
7+
Replace the mcp server command with `uvx omproxy` followed by the command.
88

99
For example:
1010

@@ -26,7 +26,7 @@ with:
2626
{
2727
"mcpServers":{
2828
"server1":{
29-
"command":"uvx proxymcp uv runpython src/example_server.py"
29+
"command":"uvx omproxy uv runpython src/example_server.py"
3030
}
3131
}
3232
}

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
2-
name = "proxymcp"
3-
version = "0.1.0"
2+
name = "omproxy"
3+
dynamic = ["version"]
44
description = "An open source proxy for MCP servers"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -9,8 +9,11 @@ dependencies = [
99
"mcp>=1.1.0",
1010
]
1111

12+
[tool.hatch.version]
13+
path = "src/omproxy/__init__.py"
14+
1215
[project.scripts]
13-
proxymcp = "proxymcp.cli:main"
16+
omproxy = "omproxy.cli:main"
1417

1518
[dependency-groups]
1619
dev = [
@@ -25,3 +28,7 @@ addopts = [
2528
]
2629
asyncio_mode = "auto"
2730
asyncio_default_fixture_loop_scope = "function"
31+
32+
[build-system]
33+
requires = ["hatchling"]
34+
build-backend = "hatchling.build"

scripts/bump_version.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env python
2+
import re
3+
import sys
4+
import subprocess
5+
from pathlib import Path
6+
7+
8+
def run_command(command):
9+
try:
10+
subprocess.run(command, check=True, shell=True)
11+
except subprocess.CalledProcessError as e:
12+
print(f"Error executing command: {command}")
13+
print(f"Error: {e}")
14+
sys.exit(1)
15+
16+
17+
def bump_version(version_type):
18+
init_file = Path("src/odmcp/__init__.py")
19+
20+
# Read current version
21+
content = init_file.read_text()
22+
current_version = re.search(r'__version__ = ["\']([^"\']+)["\']', content).group(1)
23+
major, minor, patch = map(int, current_version.split("."))
24+
25+
# Update version based on argument
26+
if version_type == "major":
27+
new_version = f"{major + 1}.0.0"
28+
elif version_type == "minor":
29+
new_version = f"{major}.{minor + 1}.0"
30+
elif version_type == "patch":
31+
new_version = f"{major}.{minor}.{patch + 1}"
32+
else:
33+
print("Invalid version type. Use 'major', 'minor', or 'patch'")
34+
sys.exit(1)
35+
36+
# Update __init__.py
37+
new_content = re.sub(
38+
r'__version__ = ["\']([^"\']+)["\']', f'__version__ = "{new_version}"', content
39+
)
40+
init_file.write_text(new_content)
41+
42+
# Git operations
43+
run_command("git add src/odmcp/__init__.py")
44+
run_command(f'git commit -m "release {new_version}: version bump commit"')
45+
run_command("git push")
46+
run_command(f"git tag v{new_version}")
47+
run_command("git push --tags")
48+
49+
# Create GitHub release using gh CLI
50+
run_command(
51+
f'gh release create v{new_version} --title "Release {new_version}" --generate-notes'
52+
)
53+
54+
print(f"Version bumped from {current_version} to {new_version}")
55+
print(f"Git operations completed and GitHub release v{new_version} created")
56+
57+
58+
if __name__ == "__main__":
59+
if len(sys.argv) != 2:
60+
print("Usage: bump_version.py <major|minor|patch>")
61+
sys.exit(1)
62+
63+
bump_version(sys.argv[1])
File renamed without changes.

uv.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)