Spaces:
Running
Running
burtenshaw
commited on
Commit
·
c6d1623
1
Parent(s):
f4ec4cf
fix readme name
Browse files- README.md +12 -171
- README.md.1 +0 -12
README.md
CHANGED
|
@@ -1,171 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
### Installation
|
| 15 |
-
|
| 16 |
-
You can easily install Strava MCP with `uvx`:
|
| 17 |
-
|
| 18 |
-
```bash
|
| 19 |
-
uvx strava-mcp
|
| 20 |
-
```
|
| 21 |
-
|
| 22 |
-
### Setting Up Strava Credentials
|
| 23 |
-
|
| 24 |
-
1. **Create a Strava API Application**:
|
| 25 |
-
- Go to [https://www.strava.com/settings/api](https://www.strava.com/settings/api)
|
| 26 |
-
- Create a new application to obtain your Client ID and Client Secret
|
| 27 |
-
- For "Authorization Callback Domain", enter `localhost`
|
| 28 |
-
|
| 29 |
-
2. **Configure Your Credentials**:
|
| 30 |
-
Create a credentials file (e.g., `~/.ssh/strava.sh`):
|
| 31 |
-
|
| 32 |
-
```bash
|
| 33 |
-
export STRAVA_CLIENT_ID=your_client_id
|
| 34 |
-
export STRAVA_CLIENT_SECRET=your_client_secret
|
| 35 |
-
```
|
| 36 |
-
|
| 37 |
-
3. **Configure Claude Desktop**:
|
| 38 |
-
Add the following to your Claude configuration (`/Users/<username>/Library/Application Support/Claude/claude_desktop_config.json`):
|
| 39 |
-
|
| 40 |
-
```json
|
| 41 |
-
"strava": {
|
| 42 |
-
"command": "bash",
|
| 43 |
-
"args": [
|
| 44 |
-
"-c",
|
| 45 |
-
"source ~/.ssh/strava.sh && uvx strava-mcp"
|
| 46 |
-
]
|
| 47 |
-
}
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
### Authentication
|
| 51 |
-
|
| 52 |
-
The first time you use the Strava MCP tools:
|
| 53 |
-
|
| 54 |
-
1. An authentication flow will automatically start
|
| 55 |
-
2. Your browser will open to the Strava authorization page
|
| 56 |
-
3. After authorizing, you'll be redirected back to a local page
|
| 57 |
-
4. Your refresh token will be saved automatically for future use
|
| 58 |
-
|
| 59 |
-
### Available Tools
|
| 60 |
-
|
| 61 |
-
#### Get User Activities
|
| 62 |
-
Retrieves activities for the authenticated user.
|
| 63 |
-
|
| 64 |
-
**Parameters:**
|
| 65 |
-
- `before` (optional): Epoch timestamp for filtering
|
| 66 |
-
- `after` (optional): Epoch timestamp for filtering
|
| 67 |
-
- `page` (optional): Page number (default: 1)
|
| 68 |
-
- `per_page` (optional): Number of items per page (default: 30)
|
| 69 |
-
|
| 70 |
-
#### Get Activity
|
| 71 |
-
Gets detailed information about a specific activity.
|
| 72 |
-
|
| 73 |
-
**Parameters:**
|
| 74 |
-
- `activity_id`: The ID of the activity
|
| 75 |
-
- `include_all_efforts` (optional): Include segment efforts (default: false)
|
| 76 |
-
|
| 77 |
-
#### Get Activity Segments
|
| 78 |
-
Retrieves segments from a specific activity.
|
| 79 |
-
|
| 80 |
-
**Parameters:**
|
| 81 |
-
- `activity_id`: The ID of the activity
|
| 82 |
-
|
| 83 |
-
#### Get Segment Leaderboard
|
| 84 |
-
Gets the leaderboard for a specific segment.
|
| 85 |
-
|
| 86 |
-
**Parameters:**
|
| 87 |
-
- `segment_id`: The ID of the segment
|
| 88 |
-
- Various optional filters (gender, age group, etc.)
|
| 89 |
-
|
| 90 |
-
## Developer Guide
|
| 91 |
-
|
| 92 |
-
### Project Setup
|
| 93 |
-
|
| 94 |
-
1. Clone the repository:
|
| 95 |
-
```bash
|
| 96 |
-
git clone <repository-url>
|
| 97 |
-
cd strava
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
-
2. Install dependencies:
|
| 101 |
-
```bash
|
| 102 |
-
uv install
|
| 103 |
-
```
|
| 104 |
-
|
| 105 |
-
3. Set up environment variables:
|
| 106 |
-
```bash
|
| 107 |
-
export STRAVA_CLIENT_ID=your_client_id
|
| 108 |
-
export STRAVA_CLIENT_SECRET=your_client_secret
|
| 109 |
-
```
|
| 110 |
-
Alternatively, create a `.env` file with these variables.
|
| 111 |
-
|
| 112 |
-
### Running in Development Mode
|
| 113 |
-
|
| 114 |
-
Run the server with MCP CLI:
|
| 115 |
-
```bash
|
| 116 |
-
mcp dev strava_mcp/main.py
|
| 117 |
-
```
|
| 118 |
-
|
| 119 |
-
### Manual Authentication
|
| 120 |
-
|
| 121 |
-
You can get a refresh token manually by running:
|
| 122 |
-
```bash
|
| 123 |
-
python get_token.py
|
| 124 |
-
```
|
| 125 |
-
|
| 126 |
-
### Project Structure
|
| 127 |
-
|
| 128 |
-
- `strava_mcp/`: Main package directory
|
| 129 |
-
- `__init__.py`: Package initialization
|
| 130 |
-
- `config.py`: Configuration settings using pydantic-settings
|
| 131 |
-
- `models.py`: Pydantic models for Strava API entities
|
| 132 |
-
- `api.py`: Low-level API client for Strava
|
| 133 |
-
- `auth.py`: Strava OAuth authentication implementation
|
| 134 |
-
- `oauth_server.py`: Standalone OAuth server implementation
|
| 135 |
-
- `service.py`: Service layer for business logic
|
| 136 |
-
- `server.py`: MCP server implementation
|
| 137 |
-
- `tests/`: Unit tests
|
| 138 |
-
- `strava_mcp/main.py`: Main entry point to run the server
|
| 139 |
-
- `get_token.py`: Utility script to get a refresh token manually
|
| 140 |
-
|
| 141 |
-
### Running Tests
|
| 142 |
-
|
| 143 |
-
```bash
|
| 144 |
-
pytest
|
| 145 |
-
```
|
| 146 |
-
|
| 147 |
-
### Publishing to PyPI
|
| 148 |
-
|
| 149 |
-
#### Building the package
|
| 150 |
-
```bash
|
| 151 |
-
# Build both sdist and wheel
|
| 152 |
-
uv build
|
| 153 |
-
```
|
| 154 |
-
|
| 155 |
-
#### Publishing to PyPI
|
| 156 |
-
```bash
|
| 157 |
-
# Publish to Test PyPI first
|
| 158 |
-
uv publish --index testpypi
|
| 159 |
-
|
| 160 |
-
# Publish to PyPI
|
| 161 |
-
uv publish
|
| 162 |
-
```
|
| 163 |
-
|
| 164 |
-
## License
|
| 165 |
-
|
| 166 |
-
[MIT License](LICENSE)
|
| 167 |
-
|
| 168 |
-
## Acknowledgements
|
| 169 |
-
|
| 170 |
-
- [Strava API](https://developers.strava.com/)
|
| 171 |
-
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Strava Mcp
|
| 3 |
+
emoji: 👁
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.45.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md.1
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Strava Mcp
|
| 3 |
-
emoji: 👁
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.45.0
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|