ims-mcp 1.0.2__py3-none-any.whl → 1.0.4__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/__init__.py +1 -1
- ims_mcp/server.py +22 -6
- {ims_mcp-1.0.2.dist-info → ims_mcp-1.0.4.dist-info}/METADATA +6 -3
- ims_mcp-1.0.4.dist-info/RECORD +9 -0
- ims_mcp-1.0.2.dist-info/RECORD +0 -9
- {ims_mcp-1.0.2.dist-info → ims_mcp-1.0.4.dist-info}/WHEEL +0 -0
- {ims_mcp-1.0.2.dist-info → ims_mcp-1.0.4.dist-info}/entry_points.txt +0 -0
- {ims_mcp-1.0.2.dist-info → ims_mcp-1.0.4.dist-info}/licenses/LICENSE +0 -0
- {ims_mcp-1.0.2.dist-info → ims_mcp-1.0.4.dist-info}/top_level.txt +0 -0
ims_mcp/__init__.py
CHANGED
ims_mcp/server.py
CHANGED
|
@@ -15,6 +15,7 @@ configuration is needed when running via uvx or other launchers.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import os
|
|
18
|
+
import sys
|
|
18
19
|
import uuid
|
|
19
20
|
from r2r import R2RClient
|
|
20
21
|
|
|
@@ -38,6 +39,21 @@ def get_authenticated_client() -> R2RClient:
|
|
|
38
39
|
if _authenticated_client is not None:
|
|
39
40
|
return _authenticated_client
|
|
40
41
|
|
|
42
|
+
# Log startup info (only on first call)
|
|
43
|
+
from ims_mcp import __version__
|
|
44
|
+
base_url = os.getenv('R2R_API_BASE') or os.getenv('R2R_BASE_URL') or 'http://localhost:7272'
|
|
45
|
+
collection = os.getenv('R2R_COLLECTION', 'default')
|
|
46
|
+
api_key = os.getenv('R2R_API_KEY', '')
|
|
47
|
+
email = os.getenv('R2R_EMAIL', '')
|
|
48
|
+
password = os.getenv('R2R_PASSWORD', '')
|
|
49
|
+
|
|
50
|
+
print(f"[ims-mcp v{__version__}]", file=sys.stderr)
|
|
51
|
+
print(f" server={base_url}", file=sys.stderr)
|
|
52
|
+
print(f" collection={collection}", file=sys.stderr)
|
|
53
|
+
print(f" api_key={api_key[:3] + '...' if api_key else 'none'}", file=sys.stderr)
|
|
54
|
+
print(f" email={email if email else 'none'}", file=sys.stderr)
|
|
55
|
+
print(f" password={password[:3] + '...' if password else 'none'}", file=sys.stderr)
|
|
56
|
+
|
|
41
57
|
# Create new client
|
|
42
58
|
client = R2RClient()
|
|
43
59
|
|
|
@@ -47,11 +63,11 @@ def get_authenticated_client() -> R2RClient:
|
|
|
47
63
|
|
|
48
64
|
if email and password:
|
|
49
65
|
try:
|
|
50
|
-
# Login
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
client.access_token = result.results.access_token.token
|
|
66
|
+
# Login - R2RClient automatically handles token internally
|
|
67
|
+
client.users.login(email=email, password=password)
|
|
68
|
+
print(f"[ims-mcp] Login successful", file=sys.stderr)
|
|
54
69
|
except Exception as e:
|
|
70
|
+
print(f"[ims-mcp] Login failed: {e}", file=sys.stderr)
|
|
55
71
|
# If login fails, continue without authentication (might work for local servers)
|
|
56
72
|
pass
|
|
57
73
|
|
|
@@ -325,7 +341,7 @@ async def list_documents(
|
|
|
325
341
|
offset: float = 0, # Use float to accept JSON "number" type, convert to int internally
|
|
326
342
|
limit: float = 100, # Use float to accept JSON "number" type, convert to int internally
|
|
327
343
|
document_ids: list[str] | None = None,
|
|
328
|
-
compact_view: bool =
|
|
344
|
+
compact_view: bool = True,
|
|
329
345
|
tags: list[str] | None = None,
|
|
330
346
|
match_all_tags: bool = False,
|
|
331
347
|
) -> str:
|
|
@@ -336,7 +352,7 @@ async def list_documents(
|
|
|
336
352
|
offset: Number of documents to skip (default: 0)
|
|
337
353
|
limit: Maximum number of documents to return (default: 100, max: 100)
|
|
338
354
|
document_ids: Optional list of specific document IDs to retrieve
|
|
339
|
-
compact_view: Show only ID and title (default:
|
|
355
|
+
compact_view: Show only ID and title (default: True - compact view)
|
|
340
356
|
tags: Optional list of tags to filter by (e.g., ["agents", "r1"])
|
|
341
357
|
match_all_tags: If True, document must have ALL tags; if False (default), document must have ANY tag
|
|
342
358
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ims-mcp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Model Context Protocol server for IMS (Instruction Management Systems)
|
|
5
5
|
Author: Igor Solomatov
|
|
6
6
|
License-Expression: MIT
|
|
@@ -229,13 +229,16 @@ List documents with pagination and optional tag filtering.
|
|
|
229
229
|
- `offset` (int, optional): Documents to skip (default: 0)
|
|
230
230
|
- `limit` (int, optional): Max documents (default: 100)
|
|
231
231
|
- `document_ids` (list[str], optional): Specific IDs to retrieve
|
|
232
|
-
- `compact_view` (bool, optional): Show only ID and title (default:
|
|
232
|
+
- `compact_view` (bool, optional): Show only ID and title (default: True)
|
|
233
233
|
- `tags` (list[str], optional): Filter by tags (e.g., `["agents", "r1"]`)
|
|
234
234
|
- `match_all_tags` (bool, optional): If True, document must have ALL tags; if False (default), document must have ANY tag
|
|
235
235
|
|
|
236
236
|
**Examples:**
|
|
237
237
|
```python
|
|
238
|
-
# List all documents
|
|
238
|
+
# List all documents (compact view - ID and title only)
|
|
239
|
+
list_documents(offset=0, limit=10)
|
|
240
|
+
|
|
241
|
+
# List with full details
|
|
239
242
|
list_documents(offset=0, limit=10, compact_view=False)
|
|
240
243
|
|
|
241
244
|
# Filter by tags (ANY mode - documents with "research" OR "ml")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ims_mcp/__init__.py,sha256=6hX8dryQog_XJDdunq29fTc8Pih9ApWYgabwaAE3DGI,631
|
|
2
|
+
ims_mcp/__main__.py,sha256=z4P1aCVfOgS3cTM2wgJd2pxjMmKCkGkiqYDRGgrspxw,191
|
|
3
|
+
ims_mcp/server.py,sha256=g7ceKx7Bxjr7LGBGfbn3AFHK2rjcPv30Y_Rhfuy3GZQ,21734
|
|
4
|
+
ims_mcp-1.0.4.dist-info/licenses/LICENSE,sha256=4d1dlH04mbnN3ya4lybcVOUwljRHGy-aSc9MYqGYW44,2534
|
|
5
|
+
ims_mcp-1.0.4.dist-info/METADATA,sha256=_GIf5S7xRw-FmX7U8psxa5MlYFPINanV2tTflGmP4hY,9295
|
|
6
|
+
ims_mcp-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
ims_mcp-1.0.4.dist-info/entry_points.txt,sha256=xCH9I8g1pTTEqrfjnE-ANHaZo4W6EBJVy0Lg5z8SaIQ,48
|
|
8
|
+
ims_mcp-1.0.4.dist-info/top_level.txt,sha256=wEXA33qFr_eov3S1PY2OF6EQBA2rtAWB_ZNJOzNNQuM,8
|
|
9
|
+
ims_mcp-1.0.4.dist-info/RECORD,,
|
ims_mcp-1.0.2.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
ims_mcp/__init__.py,sha256=_6NlDOhSJOSX3jaL2jl2rXydaa2CWsV6pN1BCrYnOtw,631
|
|
2
|
-
ims_mcp/__main__.py,sha256=z4P1aCVfOgS3cTM2wgJd2pxjMmKCkGkiqYDRGgrspxw,191
|
|
3
|
-
ims_mcp/server.py,sha256=QOjniyXYYcZVeUDhD_w73NLBWE2KUejOTp4vqawubMg,20925
|
|
4
|
-
ims_mcp-1.0.2.dist-info/licenses/LICENSE,sha256=4d1dlH04mbnN3ya4lybcVOUwljRHGy-aSc9MYqGYW44,2534
|
|
5
|
-
ims_mcp-1.0.2.dist-info/METADATA,sha256=40x-xkXd7POWXBB-8Lg0x44-p-Nl5oODsE9V6nh-oi8,9200
|
|
6
|
-
ims_mcp-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
ims_mcp-1.0.2.dist-info/entry_points.txt,sha256=xCH9I8g1pTTEqrfjnE-ANHaZo4W6EBJVy0Lg5z8SaIQ,48
|
|
8
|
-
ims_mcp-1.0.2.dist-info/top_level.txt,sha256=wEXA33qFr_eov3S1PY2OF6EQBA2rtAWB_ZNJOzNNQuM,8
|
|
9
|
-
ims_mcp-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|