strava-activity-mcp-server 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/PKG-INFO +7 -4
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/README.md +5 -2
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/pyproject.toml +2 -2
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/src/strava_activity_mcp_server/strava_activity_mcp_server.py +24 -7
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/uv.lock +1 -1
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/.gitignore +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/.python-version +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/.vscode/settings.json +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/LICENSE +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/ref/mcp_pypi_example.md +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/requirements.txt +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/src/strava_activity_mcp_server/__init__.py +0 -0
- {strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/src/strava_activity_mcp_server/__main__.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: strava-activity-mcp-server
|
3
|
-
Version: 0.1.
|
4
|
-
Summary:
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: Trying to implement environment variables for client_id
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.13
|
7
7
|
Requires-Dist: build>=1.3.0
|
@@ -9,7 +9,8 @@ Requires-Dist: mcp[cli]>=1.16.0
|
|
9
9
|
Requires-Dist: twine>=6.2.0
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
|
12
|
-
#
|
12
|
+
# Strava Activity MCP Server
|
13
|
+
[](https://opensource.org/licenses/gpl-3-0)[](https://www.python.org/downloads/release/python-3130/)
|
13
14
|
|
14
15
|
A small Model Context Protocol (MCP) server that exposes your Strava athlete data to language-model tooling.
|
15
16
|
|
@@ -134,4 +135,6 @@ This project is licensed under the GNU GENERAL PUBLIC LICENSE — see the `LICEN
|
|
134
135
|
## Links
|
135
136
|
|
136
137
|
- Source: repository root
|
137
|
-
- Documentation note: see `
|
138
|
+
- Documentation note: see `README.md` for an example MCP configuration
|
139
|
+
|
140
|
+
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# Strava Activity MCP Server
|
2
|
+
[](https://opensource.org/licenses/gpl-3-0)[](https://www.python.org/downloads/release/python-3130/)
|
2
3
|
|
3
4
|
A small Model Context Protocol (MCP) server that exposes your Strava athlete data to language-model tooling.
|
4
5
|
|
@@ -123,4 +124,6 @@ This project is licensed under the GNU GENERAL PUBLIC LICENSE — see the `LICEN
|
|
123
124
|
## Links
|
124
125
|
|
125
126
|
- Source: repository root
|
126
|
-
- Documentation note: see `
|
127
|
+
- Documentation note: see `README.md` for an example MCP configuration
|
128
|
+
|
129
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
[project]
|
2
2
|
name = "strava-activity-mcp-server"
|
3
|
-
version = "0.1.
|
4
|
-
description = "
|
3
|
+
version = "0.1.2"
|
4
|
+
description = "Trying to implement environment variables for client_id"
|
5
5
|
readme = "README.md"
|
6
6
|
requires-python = ">=3.13"
|
7
7
|
dependencies = [
|
@@ -8,9 +8,26 @@ import urllib.parse
|
|
8
8
|
|
9
9
|
@mcp.tool("strava://auth/url")
|
10
10
|
|
11
|
-
def get_auth_url(client_id):
|
12
|
-
"""Return the Strava OAuth authorization URL.
|
13
|
-
|
11
|
+
def get_auth_url(client_id: int | None = None):
|
12
|
+
"""Return the Strava OAuth authorization URL. If client_id is not provided,
|
13
|
+
read it from the STRAVA_CLIENT_ID environment variable."""
|
14
|
+
if client_id is None:
|
15
|
+
client_id_env = os.getenv("STRAVA_CLIENT_ID")
|
16
|
+
if not client_id_env:
|
17
|
+
return {"error": "STRAVA_CLIENT_ID environment variable is not set"}
|
18
|
+
try:
|
19
|
+
client_id = int(client_id_env)
|
20
|
+
except ValueError:
|
21
|
+
return {"error": "STRAVA_CLIENT_ID must be an integer"}
|
22
|
+
|
23
|
+
params = {
|
24
|
+
"client_id": client_id,
|
25
|
+
"response_type": "code",
|
26
|
+
"redirect_uri": "https://developers.strava.com/oauth2-redirect/",
|
27
|
+
"approval_prompt": "force",
|
28
|
+
"scope": "read,activity:read_all",
|
29
|
+
}
|
30
|
+
return "https://www.strava.com/oauth/authorize?" + urllib.parse.urlencode(params)
|
14
31
|
|
15
32
|
|
16
33
|
|
@@ -80,17 +97,17 @@ def refresh_access_token(
|
|
80
97
|
|
81
98
|
|
82
99
|
@mcp.tool("strava://athlete/stats")
|
83
|
-
def get_athlete_stats(token: str) ->
|
84
|
-
"""Retrieve athlete activities
|
100
|
+
def get_athlete_stats(token: str) -> object:
|
101
|
+
"""Retrieve athlete activities using an access token."""
|
85
102
|
url = "https://www.strava.com/api/v3/athlete/activities?per_page=60"
|
86
103
|
headers = {
|
87
104
|
"accept": "application/json",
|
88
105
|
"authorization": f"Bearer {token}"
|
89
106
|
}
|
90
|
-
import json
|
91
107
|
response = requests.get(url, headers=headers)
|
92
108
|
response.raise_for_status()
|
93
|
-
|
109
|
+
# Return the parsed JSON (dict or list) instead of a JSON string so the return type matches.
|
110
|
+
return response.json()
|
94
111
|
|
95
112
|
if __name__ == "__main__":
|
96
113
|
mcp.run(transport="stdio") # Run the server, using standard input/output for communication
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{strava_activity_mcp_server-0.1.1 → strava_activity_mcp_server-0.1.2}/ref/mcp_pypi_example.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|