mem-brain-mcp 1.0.5__tar.gz → 1.0.6__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.
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/PKG-INFO +1 -1
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/pyproject.toml +1 -1
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/src/mem_brain_mcp/__init__.py +1 -1
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/src/mem_brain_mcp/client.py +29 -11
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/src/mem_brain_mcp/server.py +9 -1
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/.dockerignore +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/.env +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/.gitignore +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/README.md +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/TROUBLESHOOTING.md +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/USAGE.md +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/DEPLOYMENT.md +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/alb-target-group.json +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/deploy.sh +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/ecs-service-config.json +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/ecs-task-definition.json +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/aws/security-groups.md +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/docker/Dockerfile +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/src/mem_brain_mcp/__main__.py +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/src/mem_brain_mcp/config.py +0 -0
- {mem_brain_mcp-1.0.5 → mem_brain_mcp-1.0.6}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mem-brain-mcp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
4
4
|
Summary: MCP Server for Mem-Brain API - Exposes memory operations as MCP tools
|
|
5
5
|
Keywords: ai,claude,cursor,llm,mcp,memory,model-context-protocol
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -56,20 +56,37 @@ class APIClient:
|
|
|
56
56
|
url = f"{self.base_url}/{endpoint.lstrip('/')}"
|
|
57
57
|
headers = self._get_headers()
|
|
58
58
|
headers.update(kwargs.pop("headers", {}))
|
|
59
|
+
|
|
60
|
+
# Debug logging for request details
|
|
61
|
+
logger.debug(f"Making {method} request to: {url}")
|
|
62
|
+
logger.debug(f"Headers: {dict((k, v[:20] + '...' if k == 'Authorization' and len(v) > 20 else v) for k, v in headers.items())}")
|
|
63
|
+
if kwargs.get("json"):
|
|
64
|
+
logger.debug(f"Request body: {kwargs.get('json')}")
|
|
65
|
+
if kwargs.get("params"):
|
|
66
|
+
logger.debug(f"Request params: {kwargs.get('params')}")
|
|
59
67
|
|
|
60
68
|
async with httpx.AsyncClient(timeout=30.0) as client:
|
|
61
|
-
response = await client.request(
|
|
62
|
-
method=method,
|
|
63
|
-
url=url,
|
|
64
|
-
headers=headers,
|
|
65
|
-
**kwargs
|
|
66
|
-
)
|
|
67
69
|
try:
|
|
68
|
-
response.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
response = await client.request(
|
|
71
|
+
method=method,
|
|
72
|
+
url=url,
|
|
73
|
+
headers=headers,
|
|
74
|
+
**kwargs
|
|
75
|
+
)
|
|
76
|
+
logger.debug(f"Response status: {response.status_code}")
|
|
77
|
+
logger.debug(f"Response headers: {dict(response.headers)}")
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
response.raise_for_status()
|
|
81
|
+
result = response.json()
|
|
82
|
+
logger.debug(f"Response data keys: {list(result.keys()) if isinstance(result, dict) else 'N/A'}")
|
|
83
|
+
return result
|
|
84
|
+
except httpx.HTTPStatusError as e:
|
|
85
|
+
error_detail = e.response.text if e.response else "No response body"
|
|
86
|
+
logger.error(f"API request failed: {e.request.method} {e.request.url} - {e.response.status_code}: {error_detail}")
|
|
87
|
+
raise
|
|
88
|
+
except httpx.RequestError as e:
|
|
89
|
+
logger.error(f"Request error: {type(e).__name__}: {str(e)}")
|
|
73
90
|
raise
|
|
74
91
|
|
|
75
92
|
async def add_memory(
|
|
@@ -204,6 +221,7 @@ class APIClient:
|
|
|
204
221
|
Returns:
|
|
205
222
|
Statistics response
|
|
206
223
|
"""
|
|
224
|
+
logger.debug("get_stats() called - making request to /stats endpoint")
|
|
207
225
|
return await self._request("GET", "/stats")
|
|
208
226
|
|
|
209
227
|
async def find_path(
|
|
@@ -144,12 +144,17 @@ async def _get_api_client() -> APIClient:
|
|
|
144
144
|
"""Get API client with per-request JWT token."""
|
|
145
145
|
token = _get_request_token()
|
|
146
146
|
if token:
|
|
147
|
-
|
|
147
|
+
logger.debug(f"Using JWT token from request headers: {token[:20]}...")
|
|
148
|
+
client = APIClient(api_key=token) # api_key parameter now holds JWT token
|
|
149
|
+
logger.debug(f"API client created with base_url: {client.base_url}")
|
|
150
|
+
return client
|
|
148
151
|
# Fallback to config API key (for single-user scenarios)
|
|
149
152
|
if settings.api_key:
|
|
150
153
|
logger.debug("Using config API key as fallback")
|
|
154
|
+
logger.debug(f"API client (fallback) base_url: {api_client.base_url}")
|
|
151
155
|
return api_client # Global instance
|
|
152
156
|
# No token available
|
|
157
|
+
logger.error("No authentication token available - neither from headers nor config")
|
|
153
158
|
raise ToolError("No authentication token provided. Please login using the login tool or configure your JWT token in your MCP client headers.")
|
|
154
159
|
|
|
155
160
|
|
|
@@ -1167,8 +1172,11 @@ async def get_stats(_placeholder: Optional[bool] = None) -> str:
|
|
|
1167
1172
|
# The function actually takes no parameters, but some MCP clients incorrectly require one
|
|
1168
1173
|
try:
|
|
1169
1174
|
logger.info("get_stats called")
|
|
1175
|
+
logger.debug(f"get_stats called with _placeholder={_placeholder} (ignored)")
|
|
1170
1176
|
client = await _get_api_client()
|
|
1177
|
+
logger.debug(f"API client initialized with base_url: {client.base_url}")
|
|
1171
1178
|
result = await client.get_stats()
|
|
1179
|
+
logger.debug(f"get_stats result received: {list(result.keys()) if isinstance(result, dict) else 'N/A'}")
|
|
1172
1180
|
top_tags = ', '.join([f"{tag}({count})" for tag, count in result.get('top_tags', [])[:10]])
|
|
1173
1181
|
return f"""Memory System Statistics:
|
|
1174
1182
|
Total Memories: {result.get('total_memories', 0)}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|