ims-mcp 1.0.29__py3-none-any.whl → 1.0.30__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.
- ims_mcp/server.py +33 -7
- {ims_mcp-1.0.29.dist-info → ims_mcp-1.0.30.dist-info}/METADATA +3 -3
- ims_mcp-1.0.30.dist-info/RECORD +10 -0
- ims_mcp-1.0.29.dist-info/RECORD +0 -10
- {ims_mcp-1.0.29.dist-info → ims_mcp-1.0.30.dist-info}/WHEEL +0 -0
- {ims_mcp-1.0.29.dist-info → ims_mcp-1.0.30.dist-info}/entry_points.txt +0 -0
- {ims_mcp-1.0.29.dist-info → ims_mcp-1.0.30.dist-info}/licenses/LICENSE +0 -0
- {ims_mcp-1.0.29.dist-info → ims_mcp-1.0.30.dist-info}/top_level.txt +0 -0
ims_mcp/server.py
CHANGED
|
@@ -320,14 +320,22 @@ def get_posthog_client():
|
|
|
320
320
|
# Import PostHog (lazy import to avoid dependency if not used)
|
|
321
321
|
from posthog import Posthog
|
|
322
322
|
|
|
323
|
+
# Silence PostHog's internal logger when not debugging
|
|
324
|
+
if not DEBUG_MODE:
|
|
325
|
+
posthog_logger = logging.getLogger('posthog')
|
|
326
|
+
posthog_logger.setLevel(logging.CRITICAL) # Only show critical errors
|
|
327
|
+
posthog_logger.propagate = False
|
|
328
|
+
|
|
323
329
|
# Get optional host override (use US cloud by default for GeoIP)
|
|
324
330
|
host = os.getenv('POSTHOG_HOST', 'https://us.i.posthog.com')
|
|
325
331
|
|
|
326
332
|
# Initialize with before_send hook
|
|
333
|
+
# IMPORTANT: disable_geoip=False because MCP runs locally on user's machine (not server)
|
|
327
334
|
_posthog_client = Posthog(
|
|
328
335
|
project_api_key=api_key,
|
|
329
336
|
host=host,
|
|
330
337
|
debug=DEBUG_MODE,
|
|
338
|
+
disable_geoip=False, # Enable GeoIP - MCP uses user's actual IP
|
|
331
339
|
on_error=lambda e: debug_print(f"[posthog] Error: {e}"),
|
|
332
340
|
before_send=before_send_hook
|
|
333
341
|
)
|
|
@@ -386,16 +394,34 @@ def track_tool_call(func: Callable) -> Callable:
|
|
|
386
394
|
'username': username,
|
|
387
395
|
'repository': repository,
|
|
388
396
|
'mcp_server': 'Rosetta',
|
|
389
|
-
'
|
|
390
|
-
'$lib_version': __version__,
|
|
391
|
-
'$geoip_disable': False # Enable GeoIP
|
|
397
|
+
'mcp_server_version': __version__ # Separate property for easy version filtering
|
|
392
398
|
})
|
|
399
|
+
# Note: GeoIP is enabled via disable_geoip=False in client initialization
|
|
400
|
+
|
|
401
|
+
# Set screen_name with fallback chain (use first available)
|
|
402
|
+
screen_name = None
|
|
393
403
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
if 'query' in kwargs and kwargs['query']:
|
|
405
|
+
screen_name = kwargs['query'][:100]
|
|
406
|
+
elif 'title' in kwargs and kwargs['title']:
|
|
407
|
+
screen_name = kwargs['title']
|
|
397
408
|
elif 'document_id' in kwargs and kwargs['document_id']:
|
|
398
|
-
|
|
409
|
+
screen_name = kwargs['document_id']
|
|
410
|
+
elif 'document_ids' in kwargs and kwargs['document_ids']:
|
|
411
|
+
ids = kwargs['document_ids']
|
|
412
|
+
if isinstance(ids, list) and ids:
|
|
413
|
+
screen_name = ', '.join(ids[:5])
|
|
414
|
+
elif 'tags' in kwargs and kwargs['tags']:
|
|
415
|
+
tags = kwargs['tags']
|
|
416
|
+
if isinstance(tags, list) and tags:
|
|
417
|
+
screen_name = f"tags: {', '.join(tags[:5])}"
|
|
418
|
+
elif 'filters' in kwargs and kwargs['filters']:
|
|
419
|
+
filters = kwargs['filters']
|
|
420
|
+
if isinstance(filters, dict) and filters:
|
|
421
|
+
screen_name = f"filters: {', '.join(f'{k}={v}' for k, v in list(filters.items())[:3])}"
|
|
422
|
+
|
|
423
|
+
if screen_name:
|
|
424
|
+
properties['$screen_name'] = screen_name
|
|
399
425
|
|
|
400
426
|
# Capture event (async, non-blocking)
|
|
401
427
|
posthog.capture(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ims-mcp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.30
|
|
4
4
|
Summary: Model Context Protocol server for IMS (Instruction Management Systems)
|
|
5
5
|
Author: Igor Solomatov
|
|
6
6
|
License-Expression: MIT
|
|
@@ -399,8 +399,8 @@ To track analytics in your own PostHog project, provide your Project API Key:
|
|
|
399
399
|
**User Context:**
|
|
400
400
|
- Username (from `USER`/`USERNAME`/`LOGNAME` environment variables + `whoami` fallback)
|
|
401
401
|
- Repository names (from MCP `roots/list` protocol request, comma-separated if multiple; fallback to `client_id` parsing; 5-min cache)
|
|
402
|
-
-
|
|
403
|
-
- GeoIP enabled
|
|
402
|
+
- MCP server identifier (`mcp_server: "Rosetta"`) and version (`mcp_server_version: "1.0.30"`)
|
|
403
|
+
- GeoIP enabled via `disable_geoip=False` in client initialization (MCP runs locally on user's machine, IP is user's actual location)
|
|
404
404
|
|
|
405
405
|
**Business Parameters** (usage patterns):
|
|
406
406
|
- `query` - Search queries
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
ims_mcp/__init__.py,sha256=tc179xWmUwO8ZD5y4k3M005BsF-mJtUgziVo7dJdj7E,1163
|
|
2
|
+
ims_mcp/__main__.py,sha256=z4P1aCVfOgS3cTM2wgJd2pxjMmKCkGkiqYDRGgrspxw,191
|
|
3
|
+
ims_mcp/server.py,sha256=5lcuunYIbbpY3dHzuKmdbF4QrZn08B_KVYxkIXrsEoI,40368
|
|
4
|
+
ims_mcp/resources/bootstrap.md,sha256=-b5SpUGO_KXP5HmagY_Y9krslHPsVthk3QhLGkca6Ig,2522
|
|
5
|
+
ims_mcp-1.0.30.dist-info/licenses/LICENSE,sha256=4d1dlH04mbnN3ya4lybcVOUwljRHGy-aSc9MYqGYW44,2534
|
|
6
|
+
ims_mcp-1.0.30.dist-info/METADATA,sha256=H4YpkrUNCjbZaLWAJayxmexL4s-aM5IZ6jJzZeCYHXk,12703
|
|
7
|
+
ims_mcp-1.0.30.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
+
ims_mcp-1.0.30.dist-info/entry_points.txt,sha256=xCH9I8g1pTTEqrfjnE-ANHaZo4W6EBJVy0Lg5z8SaIQ,48
|
|
9
|
+
ims_mcp-1.0.30.dist-info/top_level.txt,sha256=wEXA33qFr_eov3S1PY2OF6EQBA2rtAWB_ZNJOzNNQuM,8
|
|
10
|
+
ims_mcp-1.0.30.dist-info/RECORD,,
|
ims_mcp-1.0.29.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
ims_mcp/__init__.py,sha256=tc179xWmUwO8ZD5y4k3M005BsF-mJtUgziVo7dJdj7E,1163
|
|
2
|
-
ims_mcp/__main__.py,sha256=z4P1aCVfOgS3cTM2wgJd2pxjMmKCkGkiqYDRGgrspxw,191
|
|
3
|
-
ims_mcp/server.py,sha256=IU8uyL5q85FfLvnYWVGVhCwG0IN_u1QGuPHrw8fbWs8,38939
|
|
4
|
-
ims_mcp/resources/bootstrap.md,sha256=-b5SpUGO_KXP5HmagY_Y9krslHPsVthk3QhLGkca6Ig,2522
|
|
5
|
-
ims_mcp-1.0.29.dist-info/licenses/LICENSE,sha256=4d1dlH04mbnN3ya4lybcVOUwljRHGy-aSc9MYqGYW44,2534
|
|
6
|
-
ims_mcp-1.0.29.dist-info/METADATA,sha256=_AKRB6sZh6B3HbEUfVfDAJQ8Z2LdUk_7jFkrQreR4qs,12553
|
|
7
|
-
ims_mcp-1.0.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
-
ims_mcp-1.0.29.dist-info/entry_points.txt,sha256=xCH9I8g1pTTEqrfjnE-ANHaZo4W6EBJVy0Lg5z8SaIQ,48
|
|
9
|
-
ims_mcp-1.0.29.dist-info/top_level.txt,sha256=wEXA33qFr_eov3S1PY2OF6EQBA2rtAWB_ZNJOzNNQuM,8
|
|
10
|
-
ims_mcp-1.0.29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|