Files
Chris Farhood 935abf86d4
build-image / build (push) Failing after 18s
Fork intervals-mcp-server: native OAuth + streamable-HTTP, no monkeypatch
- Bump mcp[cli] 1.22 -> 1.28.1 (negotiates MCP protocol 2025-11-25, matching
  current Claude clients; the old 2025-06-18 server never got a tools/list on
  the connector surface).
- Bake transport config into code: stateless_http + json_response for HTTP
  (single JSON body instead of a 34KB SSE stream, which the connector pipeline
  handles far more reliably).
- Bake Authentik OAuth (AuthSettings + JWT TokenVerifier) into intervals_mcp_server.auth,
  configured from MCP_ISSUER/MCP_RESOURCE/MCP_JWKS_URI/MCP_CLIENT_ID — removes the
  runtime FastMCP.__init__ monkeypatch from the k8s deployment command.
- Accept token audience with/without trailing slash (RFC 8707 clients use the
  slash-normalised resource metadata value).
- Dockerfile CMD runs the module (transport via MCP_TRANSPORT); add .gitea CI to
  build+push the image to git.farh.net/farhoodlabs/intervalsicu-mcp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 15:07:46 -04:00

55 lines
2.0 KiB
Plaintext

---
description:
globs:
alwaysApply: true
---
# Development Workflow Guide
## Environment Setup
1. **Use uv for package management**: This project uses [uv](mdc:https:/github.com/astral-sh/uv) instead of pip
```bash
uv venv --python 3.12
source .venv/bin/activate
uv sync --all-extras
```
2. **Environment Configuration**: Copy [.env.example](mdc:.env.example) to `.env` and configure:
- `API_KEY` - Your Intervals.icu API key
- `ATHLETE_ID` - Your athlete ID (digits or i-prefixed)
## Running the Server
- **Manual Testing**: `mcp run src/intervals_mcp_server/server.py`
- **Claude Desktop Integration**: Use `mcp install` command as documented in [README.md](mdc:README.md)
## Code Quality Checks
Before committing, ensure all three checks pass:
1. **Linting**: `ruff .` - Uses default ruff rules, config in [pyproject.toml](mdc:pyproject.toml)
2. **Type Checking**: `mypy src tests` - Static type analysis
3. **Testing**: `pytest` - Unit tests in [tests/](mdc:tests) directory
## Code Organization
- **Main Logic**: All MCP tools are implemented in [src/intervals_mcp_server/server.py](mdc:src/intervals_mcp_server/server.py)
- **Utilities**: Helper functions in [src/intervals_mcp_server/utils/](mdc:src/intervals_mcp_server/utils)
- **API Communication**: `make_intervals_request()` function handles all Intervals.icu API calls
- **Error Handling**: Comprehensive HTTP error handling with user-friendly messages
## Adding New MCP Tools
1. Create async function decorated with `@mcp.tool()`
2. Add proper type hints and docstrings
3. Use `make_intervals_request()` for API calls
4. Add formatting utilities to [src/intervals_mcp_server/utils/formatting.py](mdc:src/intervals_mcp_server/utils/formatting.py) if needed
5. Write unit tests in [tests/](mdc:tests)
## Commit Guidelines
- Use concise commit messages
- Title PRs as `[intervals-mcp-server] <brief description>`
- Ensure `ruff`, `mypy`, and `pytest` all pass
- Document manual testing steps in PR description