strava-activity-mcp-server 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl

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.
@@ -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. Open this URL in a browser to get the code."""
13
- return str(f"https://www.strava.com/oauth/authorize?client_id={client_id}&response_type=code&redirect_uri=https://developers.strava.com/oauth2-redirect/&approval_prompt=force&scope=read,activity:read_all")
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) -> dict:
84
- """Retrieve athlete activities (last 30) using an access token."""
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
- return json.dumps(response.json(), indent=2)
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
@@ -1,15 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: strava-activity-mcp-server
3
- Version: 0.1.1
4
- Summary: Add your description here
3
+ Version: 0.1.3
4
+ Summary: Trying to implement environment variables for client_id
5
5
  License-File: LICENSE
6
- Requires-Python: >=3.13
6
+ Requires-Python: >=3.10
7
7
  Requires-Dist: build>=1.3.0
8
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
- # strava-activity-mcp-server
12
+ # Strava Activity MCP Server
13
+ ![Image 1: Python Package](https://pypi-camo.freetls.fastly.net/0ecf904318113383d77ec39a9c48b8ba0d2baf38/68747470733a2f2f6769746875622e636f6d2f746f6d656b6b6f7262616b2f7374726176612d6d63702d7365727665722f776f726b666c6f77732f507974686f6e2532305061636b6167652f62616467652e737667)[![Image 2: License: GNU](https://pypi-camo.freetls.fastly.net/8de17537dd1659a5a076ce547de301e27c839e67/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c76332d626c75652e737667)](https://opensource.org/licenses/gpl-3-0)[![Image 3: Python 3.13](https://pypi-camo.freetls.fastly.net/e4930d5d2a7b16dfd9891ecb7396975ef462cff3/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f696e6a782e7376673f6c6f676f3d707974686f6e266c6f676f436f6c6f723d7768697465)](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 `ref/mcp_pypi_example.md` for an example MCP configuration
138
+ - Documentation note: see `README.md` for an example MCP configuration
139
+
140
+
@@ -0,0 +1,8 @@
1
+ strava_activity_mcp_server/__init__.py,sha256=NgXC8CeBg0qFRHdZJJKjQlX9_RwSETJ9O6PNy0leOTI,107
2
+ strava_activity_mcp_server/__main__.py,sha256=SAdVoObdjb5UP4MY-Y2_uCXpnthB6hgxlb1KNVNgOrc,58
3
+ strava_activity_mcp_server/strava_activity_mcp_server.py,sha256=rZgRFH4esSiOY-ouceIR046hzTpOeN6xDE_eRZPY07U,3836
4
+ strava_activity_mcp_server-0.1.3.dist-info/METADATA,sha256=uavNysuFJgKieRxztWtYi6C6Lc7MidtCp3BG9odCAh0,6043
5
+ strava_activity_mcp_server-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ strava_activity_mcp_server-0.1.3.dist-info/entry_points.txt,sha256=F6PO_DBSThhtmX2AC-tu2MIiCJkGi31LCaQJxfUzZ5g,79
7
+ strava_activity_mcp_server-0.1.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
8
+ strava_activity_mcp_server-0.1.3.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- strava_activity_mcp_server/__init__.py,sha256=NgXC8CeBg0qFRHdZJJKjQlX9_RwSETJ9O6PNy0leOTI,107
2
- strava_activity_mcp_server/__main__.py,sha256=SAdVoObdjb5UP4MY-Y2_uCXpnthB6hgxlb1KNVNgOrc,58
3
- strava_activity_mcp_server/strava_activity_mcp_server.py,sha256=1Xvo763lIP9m9lBoAYZ2Al86KXw2ozdMSkF_bWl_JxM,3245
4
- strava_activity_mcp_server-0.1.1.dist-info/METADATA,sha256=4H0iet9CoT4KkKhLTV36M9q9Q1zRAgTaCHdJ2-exCbA,5189
5
- strava_activity_mcp_server-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- strava_activity_mcp_server-0.1.1.dist-info/entry_points.txt,sha256=F6PO_DBSThhtmX2AC-tu2MIiCJkGi31LCaQJxfUzZ5g,79
7
- strava_activity_mcp_server-0.1.1.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
8
- strava_activity_mcp_server-0.1.1.dist-info/RECORD,,