eulerian-marketing-platform 0.2.6__py3-none-any.whl → 0.2.8__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.
@@ -4,7 +4,7 @@ This package provides a Model Context Protocol (MCP) server that enables
4
4
  AI assistants to interact with Eulerian Marketing Platform APIs.
5
5
  """
6
6
 
7
- __version__ = "0.2.6"
7
+ __version__ = "0.2.8"
8
8
  __author__ = "Eulerian Technologies"
9
9
  __all__ = []
10
10
 
@@ -103,11 +103,7 @@ def forward_request(request_data: dict) -> dict:
103
103
  # Handle HTTP 204 No Content (common for notifications)
104
104
  if response.status_code == 204:
105
105
  logger.info(" HTTP 204 No Content - creating empty success response")
106
- return {
107
- "jsonrpc": "2.0",
108
- "id": request_id,
109
- "result": {}
110
- }
106
+ return None
111
107
 
112
108
  if response.status_code != 200:
113
109
  error_msg = f"HTTP {response.status_code}: {response.reason_phrase}"
@@ -142,37 +138,13 @@ def forward_request(request_data: dict) -> dict:
142
138
  elif method == "tools/list":
143
139
  tools = result.get("tools", [])
144
140
  logger.info(f" Tools available: {len(tools)} tools")
145
- for i, tool in enumerate(tools):
146
- tool_name = tool.get("name", "unnamed")
147
- tool_desc = tool.get("description", "no description")[:50]
148
- logger.info(f" Tool {i+1}: {tool_name} - {tool_desc}")
149
- # Log input schema info
150
- input_schema = tool.get("inputSchema", {})
151
- if "properties" in input_schema:
152
- props = list(input_schema["properties"].keys())[:3]
153
- logger.info(f" Input properties: {props}")
154
141
 
155
142
  elif method == "resources/list":
156
143
  resources = result.get("resources", [])
157
144
  logger.info(f" Resources available: {len(resources)} resources")
158
- for i, resource in enumerate(resources[:3]):
159
- res_uri = resource.get("uri", "no uri")
160
- res_name = resource.get("name", "unnamed")
161
- logger.info(f" Resource {i+1}: {res_name} ({res_uri})")
162
- if len(resources) > 3:
163
- logger.info(f" ... and {len(resources) - 3} more resources")
164
145
 
165
146
  elif method.startswith("tools/call"):
166
147
  logger.info(f" Tool call result keys: {list(result.keys())}")
167
- if "content" in result:
168
- content = result["content"]
169
- if isinstance(content, list) and len(content) > 0:
170
- logger.info(f" Tool returned {len(content)} content items")
171
- first_item = content[0]
172
- if isinstance(first_item, dict):
173
- logger.info(f" First content type: {first_item.get('type', 'unknown')}")
174
- elif isinstance(content, str):
175
- logger.info(f" Tool returned string content: {len(content)} chars")
176
148
 
177
149
  else:
178
150
  # Generic logging for unknown methods
@@ -277,18 +249,32 @@ def main() -> None:
277
249
  # Forward to remote server
278
250
  response_data = forward_request(request_data)
279
251
 
280
- # Always send response back to Claude Desktop (MCP requires this)
281
- response_json = json.dumps(response_data)
282
- print(response_json, flush=True)
283
- sys.stdout.flush()
284
- logger.info(" Response forwarded [OK]")
252
+ # Only send response if response_data is not None (handles HTTP 204 notifications)
253
+ if response_data is not None:
254
+ response_json = json.dumps(response_data)
255
+ print(response_json, flush=True)
256
+ sys.stdout.flush()
257
+ logger.info(" Response forwarded [OK]")
258
+ else:
259
+ logger.info(" No response sent (notification or HTTP 204)")
285
260
 
286
261
  except json.JSONDecodeError as e:
287
262
  logger.error(f"ERROR: Invalid JSON in request - {e}")
288
263
  logger.error(f" Problematic line: {line[:200]}")
264
+
265
+ # Try to extract request_id from partial JSON, fallback to None
266
+ request_id = None
267
+ try:
268
+ # Attempt to get ID from partial JSON
269
+ if '"id"' in line:
270
+ partial = json.loads(line.split('"method"')[0] + '"}')
271
+ request_id = partial.get("id")
272
+ except:
273
+ pass
274
+
289
275
  error_response = {
290
276
  "jsonrpc": "2.0",
291
- "id": None,
277
+ "id": request_id,
292
278
  "error": {
293
279
  "code": -32700,
294
280
  "message": f"Parse error: {str(e)}"
@@ -301,9 +287,16 @@ def main() -> None:
301
287
  logger.error(f"ERROR: Unexpected error processing request - {str(e)}")
302
288
  import traceback
303
289
  logger.error(f"Traceback: {traceback.format_exc()}")
290
+
291
+ # Try to get request_id if request_data was parsed successfully
292
+ try:
293
+ request_id = request_data.get("id") if 'request_data' in locals() else None
294
+ except:
295
+ request_id = None
296
+
304
297
  error_response = {
305
298
  "jsonrpc": "2.0",
306
- "id": None,
299
+ "id": request_id,
307
300
  "error": {
308
301
  "code": -32000,
309
302
  "message": f"Error: {str(e)}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eulerian-marketing-platform
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: MCP server for Eulerian Marketing Platform - enables AI assistants to interact with Eulerian's marketing analytics and campaign management APIs
5
5
  Author-email: Eulerian Technologies <mathieu@eulerian.com>
6
6
  License: MIT
@@ -385,6 +385,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
385
385
 
386
386
  ## Changelog
387
387
 
388
+ ### 0.2.8
389
+ - fixes for proxy disconnection
390
+ - remove unnecessary logging
391
+
388
392
  ### 0.2.3
389
393
  - fixes disconnection issue with notifications
390
394
 
@@ -0,0 +1,8 @@
1
+ eulerian_marketing_platform/__init__.py,sha256=7g1Hvi9_9ZjCTHLJyd0NEJVm5qhC1MVfP5VlCwi0zZ0,428
2
+ eulerian_marketing_platform/server.py,sha256=eSoiidX405A2otYGnifpgLqxcGMHXMPMxJQUzQ9WHOo,12570
3
+ eulerian_marketing_platform-0.2.8.dist-info/LICENSE,sha256=eIqBqE_fRsqQJ8F-2v0e-8WzZqdshsCqnzmqLAWrNHU,1078
4
+ eulerian_marketing_platform-0.2.8.dist-info/METADATA,sha256=F2ax4B0D-aEvXBN9iFvfZgGOAshdGiyL5Bh05zVHVOA,12241
5
+ eulerian_marketing_platform-0.2.8.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
+ eulerian_marketing_platform-0.2.8.dist-info/entry_points.txt,sha256=rrPZptATSS9PUtH9gzCYq0WuP6eahkF-DkdUP1FaYfk,88
7
+ eulerian_marketing_platform-0.2.8.dist-info/top_level.txt,sha256=nidh3T6fw-mLjUqZwQ8AiMScS4usuH0WXW4ZgG4HYCo,28
8
+ eulerian_marketing_platform-0.2.8.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- eulerian_marketing_platform/__init__.py,sha256=Rchunx1TsnHjirVTZtfMlg6LHXlQupKPi-tYLVZTI00,428
2
- eulerian_marketing_platform/server.py,sha256=GBuksSr38MWXKNR36mbHaMz8589eElGM6qGt2-zOJdw,13321
3
- eulerian_marketing_platform-0.2.6.dist-info/LICENSE,sha256=eIqBqE_fRsqQJ8F-2v0e-8WzZqdshsCqnzmqLAWrNHU,1078
4
- eulerian_marketing_platform-0.2.6.dist-info/METADATA,sha256=VR6nemyIP3yUTR_bbLV1V9K5e48M9WVO3zOssc1jIpM,12169
5
- eulerian_marketing_platform-0.2.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
- eulerian_marketing_platform-0.2.6.dist-info/entry_points.txt,sha256=rrPZptATSS9PUtH9gzCYq0WuP6eahkF-DkdUP1FaYfk,88
7
- eulerian_marketing_platform-0.2.6.dist-info/top_level.txt,sha256=nidh3T6fw-mLjUqZwQ8AiMScS4usuH0WXW4ZgG4HYCo,28
8
- eulerian_marketing_platform-0.2.6.dist-info/RECORD,,