Skip to content

Commit 1fc5cc9

Browse files
feature: work on publishing, rename repo
add makefile target to validate public docker image Add some more sanity checking and validation for docker, details about mcp in general rename project to ephemeris-mcp
1 parent da83e15 commit 1fc5cc9

29 files changed

Lines changed: 659 additions & 108 deletions

.cursorrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cursor Rules for AstroMCP
1+
# Cursor Rules for EphemerisMCP
22

33
## Stack
44
- Python 3.11 (strict)

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Funding options for AstroMCP
1+
# Funding options for EphemerisMCP
22
# Uncomment and configure as needed:
33
github: [scottchronicity]
44
patreon: scottchronicity
5-
# open_collective: astro-mcp
5+
# open_collective: ephemeris-mcp
66
# ko_fi: username
77
# custom: ['https://your-link.com']

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ What actually happened.
2323
## Environment
2424
- OS:
2525
- Python version:
26-
- astro-mcp version:
26+
- ephemeris-mcp version:
2727

2828
## Additional Context
2929
Any other relevant information.

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# GitHub Copilot Instructions for AstroMCP
1+
# GitHub Copilot Instructions for Ephemeris MCP
22

33
## What This Project Does
4-
AstroMCP is an MCP (Model Context Protocol) server that calculates planetary positions using the Swiss Ephemeris. It provides AI agents with ground-truth astrological data in Tropical Zodiac coordinates.
4+
Ephemeris MCP is an MCP (Model Context Protocol) server that calculates planetary positions using the Swiss Ephemeris. It provides AI agents with precision astronomical ephemeris data in Tropical Zodiac coordinates.
55

66
## Architecture
77
- `server.py`: FastMCP server exposing `get_planetary_positions` tool

.github/workflows/cd-release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,31 @@ jobs:
6262
tags: |
6363
ghcr.io/${{ github.repository }}:v${{ needs.release.outputs.version }}
6464
ghcr.io/${{ github.repository }}:latest
65+
66+
pypi:
67+
needs: release
68+
if: needs.release.outputs.released == 'true'
69+
runs-on: ubuntu-latest
70+
environment:
71+
name: pypi
72+
url: https://pypi.org/p/ephemeris-mcp
73+
permissions:
74+
id-token: write
75+
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
ref: v${{ needs.release.outputs.version }}
79+
80+
- name: Install uv
81+
uses: astral-sh/setup-uv@v4
82+
with:
83+
version: "latest"
84+
85+
- name: Set up Python
86+
run: uv python install 3.11
87+
88+
- name: Build package
89+
run: uv build
90+
91+
- name: Publish to PyPI
92+
uses: pypa/gh-action-pypi-publish@release/v1

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Debug MCP Server",
99
"type": "debugpy",
1010
"request": "launch",
11-
"module": "astro_mcp.server",
11+
"module": "ephemeris_mcp.server",
1212
"console": "integratedTerminal",
1313
"justMyCode": false,
1414
"env": {

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
55
## Project Overview
66

7-
AstroMCP is a Model Context Protocol (MCP) server providing precision astrological calculations via the Swiss Ephemeris.
7+
Ephemeris MCP is a Model Context Protocol (MCP) server providing precision astronomical ephemeris calculations via the Swiss Ephemeris.
88

99
## Codebase Map
1010

1111
| Path | Purpose |
1212
|------|---------|
13-
| `src/astro_mcp/server.py` | MCP server interface (FastMCP) |
14-
| `src/astro_mcp/engine.py` | Physics calculation engine (Flatlib/Swiss Ephemeris) |
13+
| `src/ephemeris_mcp/server.py` | MCP server interface (FastMCP) |
14+
| `src/ephemeris_mcp/engine.py` | Physics calculation engine (Flatlib/Swiss Ephemeris) |
1515
| `tests/test_engine.py` | Unit tests for calculation engine |
1616
| `docs/adr/` | Architecture Decision Records |
1717

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Contributing to AstroMCP
1+
# Contributing to EphemerisMCP
22

33
Thank you for your interest in contributing!
44

55
## Getting Started
66

77
1. Fork the repository
8-
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/astro-mcp.git`
8+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/ephemeris-mcp.git`
99
3. Install dependencies: `make install`
1010
4. Create a branch: `git checkout -b feat/your-feature`
1111

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ ENV PATH="/app/.venv/bin:$PATH"
3636
ENV PYTHONPATH="/app/src"
3737

3838
# Run the MCP server
39-
CMD ["python", "-m", "astro_mcp.server"]
39+
CMD ["python", "-m", "ephemeris_mcp.server"]

Makefile

Lines changed: 82 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Makefile for AstroMCP
1+
# Makefile for EphemerisMCP
22

33
# Variables
4-
IMAGE_NAME := astro-mcp
4+
IMAGE_NAME := ephemeris-mcp
55
VERSION := 0.1.0
66
PYTHON_VERSION := 3.11
77

8-
.PHONY: all help install format lint test build clean docker-build docker-run act
8+
.PHONY: all help install format lint test build clean docker-build docker-run docker-happycase-public docker-happycase-mcp act
99

1010
all: install format lint test
1111

1212
help:
13-
@echo "AstroMCP Development Commands"
14-
@echo "============================="
13+
@echo "Ephemeris MCP Development Commands"
14+
@echo "==================================="
1515
@echo "make install - Sync dependencies (uses Python $(PYTHON_VERSION))"
1616
@echo "make format - Format code using Ruff"
1717
@echo "make format-check - Check code formatting without modifying"
@@ -22,6 +22,8 @@ help:
2222
@echo "make docker-build - Build the Docker image"
2323
@echo "make docker-run - Run the Docker container interactively"
2424
@echo "make docker-happycase - Test the Docker image with a simple query"
25+
@echo "make docker-happycase-public - Test the public GHCR image with a simple query"
26+
@echo "make docker-happycase-mcp - Test the MCP server interface (agent-style)"
2527
@echo "make docker-dev - Full Docker dev workflow (validate, build, test)"
2628
@echo "make docker-clean - Remove Docker images"
2729
@echo "make validate-happycase - Test engine locally with a simple query"
@@ -30,6 +32,13 @@ help:
3032
@echo "make audit - Audit dependencies"
3133
@echo "make act-ci - Run CI workflow locally with act"
3234
@echo "make act-release - Run Release workflow locally with act (dry-run)"
35+
@echo ""
36+
@echo "PyPI Publishing:"
37+
@echo "make build - Build distribution packages (wheel + sdist)"
38+
@echo "make test-pypi-local - Test local build installation"
39+
@echo "make validate-happycase-pypi - Test PyPI installed version"
40+
@echo "make publish-test - Publish to TestPyPI (requires API token)"
41+
@echo "make publish - Publish to PyPI (requires API token)"
3342

3443
# --- Development ---
3544

@@ -39,7 +48,7 @@ lock:
3948

4049
sync: lock
4150
@echo "📦 Syncing dependencies with Python $(PYTHON_VERSION)..."
42-
uv sync --python $(PYTHON_VERSION)
51+
uv sync --all-groups --python $(PYTHON_VERSION)
4352

4453
install: sync
4554
@echo "✅ Dependencies installed."
@@ -71,7 +80,7 @@ validate-dev:
7180
validate-happycase:
7281
@echo "🧪 Testing engine locally with planetary positions query..."
7382
@echo "📍 Querying: 2025-12-16T15:28:00Z at New York (40.7128, -74.0060)"
74-
@uv run python -c "from astro_mcp.engine import calculate_chart; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ Engine working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
83+
@uv run python -c "from ephemeris_mcp.engine import calculate_chart; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ Engine working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
7584
@echo "\n✅ Happy case test passed!"
7685

7786
validate-dev-full: validate-dev
@@ -104,9 +113,21 @@ docker-run:
104113
docker-happycase:
105114
@echo "🧪 Testing Docker image with planetary positions query..."
106115
@echo "📍 Querying: 2025-12-16T15:28:00Z at New York (40.7128, -74.0060)"
107-
@docker run --rm $(IMAGE_NAME):latest python -c "from astro_mcp.engine import calculate_chart; import json; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ Docker image working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
116+
@docker run --rm $(IMAGE_NAME):latest python -c "from ephemeris_mcp.engine import calculate_chart; import json; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ Docker image working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
108117
@echo "\n✅ Docker test passed!"
109118

119+
docker-happycase-public:
120+
@echo "🧪 Testing public GHCR image with planetary positions query..."
121+
@echo "📦 Pulling ghcr.io/scottchronicity/ephemeris-mcp:latest..."
122+
@docker pull ghcr.io/scottchronicity/ephemeris-mcp:latest
123+
@echo "📍 Querying: 2025-12-16T15:28:00Z at New York (40.7128, -74.0060)"
124+
@docker run --rm ghcr.io/scottchronicity/ephemeris-mcp:latest python -c "from ephemeris_mcp.engine import calculate_chart; import json; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ Public image working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
125+
@echo "\n✅ Public image test passed!"
126+
127+
docker-happycase-mcp:
128+
@echo "🧪 Testing MCP server interface (agent-style)..."
129+
@python3 test_mcp_client.py
130+
110131
docker-dev: validate-dev docker-build docker-happycase
111132
@echo "✅ Full Docker dev workflow complete!"
112133
@echo "📦 Image ready: $(IMAGE_NAME):$(VERSION)"
@@ -138,4 +159,56 @@ act-ci:
138159

139160
act-release:
140161
@echo "🎬 Running Release workflow locally with act (dry-run)..."
141-
act push --container-architecture linux/amd64 -W .github/workflows/cd-release.yml --dryrun
162+
act push --container-architecture linux/amd64 -W .github/workflows/cd-release.yml --dryrun
163+
# --- PyPI Publishing ---
164+
165+
build:
166+
@echo "📦 Building distribution packages..."
167+
uv build
168+
@echo "✅ Build complete! Check dist/ directory"
169+
@ls -lh dist/
170+
171+
test-pypi-local:
172+
@echo "🧪 Testing local build installation..."
173+
@echo "Creating fresh virtual environment for testing..."
174+
@rm -rf /tmp/ephemeris-mcp-test-env
175+
@uv venv /tmp/ephemeris-mcp-test-env
176+
@echo "Installing from local build..."
177+
@uv pip install --python /tmp/ephemeris-mcp-test-env dist/*.whl
178+
@echo "Testing import..."
179+
@/tmp/ephemeris-mcp-test-env/bin/python -c "from ephemeris_mcp.engine import calculate_chart; print('✅ Import successful')"
180+
@echo "Testing entry point exists..."
181+
@test -f /tmp/ephemeris-mcp-test-env/bin/ephemeris-mcp && echo "✅ CLI entry point installed" || echo "❌ Entry point missing"
182+
@echo "Testing engine with sample query..."
183+
@/tmp/ephemeris-mcp-test-env/bin/python -c "from ephemeris_mcp.engine import calculate_chart; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print(f'✅ Engine working! Sun in {result[\"bodies\"][\"Sun\"][\"sign\"]}')"
184+
@echo "✅ Local build test passed!"
185+
@rm -rf /tmp/ephemeris-mcp-test-env
186+
187+
validate-happycase-pypi:
188+
@echo "🧪 Testing PyPI installed version..."
189+
@echo "Creating fresh virtual environment..."
190+
@rm -rf /tmp/ephemeris-mcp-pypi-test
191+
@uv venv /tmp/ephemeris-mcp-pypi-test
192+
@echo "Installing from PyPI..."
193+
@uv pip install --python /tmp/ephemeris-mcp-pypi-test ephemeris-mcp
194+
@echo "📍 Querying: 2025-12-16T15:28:00Z at New York (40.7128, -74.0060)"
195+
@/tmp/ephemeris-mcp-pypi-test/bin/python -c "from ephemeris_mcp.engine import calculate_chart; result = calculate_chart('2025-12-16T15:28:00Z', 40.7128, -74.0060); print('✅ PyPI version working!\n'); print('🌟 BODIES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}° ({data[\"motion\"]})') for name, data in result['bodies'].items()]; print('\n🏠 HOUSES:'); [print(f' {name:18} {data[\"sign\"]:10} {data[\"sign_degrees\"]:6.2f}°') for name, data in result['houses'].items()]"
196+
@echo "\n✅ PyPI happy case test passed!"
197+
@rm -rf /tmp/ephemeris-mcp-pypi-test
198+
199+
publish-test:
200+
@echo "🚀 Publishing to TestPyPI..."
201+
@echo "⚠️ Requires TWINE_PASSWORD env var with TestPyPI token"
202+
@uv build
203+
@uv run twine upload --repository testpypi dist/* --username __token__
204+
205+
publish:
206+
@echo "🚀 Publishing to PyPI..."
207+
@echo "⚠️ Requires TWINE_PASSWORD env var with PyPI token"
208+
@echo "⚠️ This will publish to production PyPI!"
209+
@read -p "Are you sure? [y/N] " -n 1 -r; echo; \
210+
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
211+
uv build && uv run twine upload dist/* --username __token__; \
212+
else \
213+
echo "Cancelled."; \
214+
fi

0 commit comments

Comments
 (0)