mem-brain-mcp 1.0.3__py3-none-any.whl → 1.0.5__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.
mem_brain_mcp/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Mem-Brain MCP Server - Exposes Mem-Brain API as MCP tools."""
2
2
 
3
- __version__ = "1.0.3"
3
+ __version__ = "1.0.5"
4
4
 
mem_brain_mcp/server.py CHANGED
@@ -13,6 +13,7 @@ from starlette.responses import JSONResponse
13
13
 
14
14
  from mem_brain_mcp.client import APIClient
15
15
  from mem_brain_mcp.config import settings
16
+ from mem_brain_mcp import __version__
16
17
 
17
18
  # The comprehensive agent instructions (embedded for MCP distribution)
18
19
  AGENT_INSTRUCTIONS = """You are an intelligent assistant with a persistent, evolving memory graph.
@@ -1143,16 +1144,27 @@ async def unlink_memories(memory_id_1: str, memory_id_2: str) -> str:
1143
1144
 
1144
1145
 
1145
1146
  @mcp.tool()
1146
- async def get_stats() -> str:
1147
+ async def get_stats(_placeholder: Optional[bool] = None) -> str:
1147
1148
  """Get memory system statistics including total memories, links, and top tags. Use this when user asks 'how much do you remember?' or wants an overview of their memory system.
1148
1149
 
1150
+ Parameters:
1151
+ _placeholder (bool, optional): Placeholder parameter for OpenCode compatibility. This parameter is ignored and can be omitted or set to any value. The function takes no actual parameters.
1152
+ - This is a workaround for MCP clients that incorrectly require a parameter for parameterless tools
1153
+ - Can be safely omitted or set to None/True/False
1154
+ - Example: get_stats() or get_stats(_placeholder=True)
1155
+
1149
1156
  Returns:
1150
1157
  str: Formatted statistics including total memories, links, and top tags.
1151
1158
 
1152
1159
  Examples:
1153
- # Get statistics
1160
+ # Get statistics (preferred - no parameters needed)
1154
1161
  get_stats()
1162
+
1163
+ # Get statistics (OpenCode workaround - parameter is ignored)
1164
+ get_stats(_placeholder=True)
1155
1165
  """
1166
+ # _placeholder parameter is ignored - this is a workaround for OpenCode compatibility
1167
+ # The function actually takes no parameters, but some MCP clients incorrectly require one
1156
1168
  try:
1157
1169
  logger.info("get_stats called")
1158
1170
  client = await _get_api_client()
@@ -1479,10 +1491,24 @@ async def health_check(request: Request) -> JSONResponse:
1479
1491
  )
1480
1492
 
1481
1493
 
1494
+ def _mask_api_url(url: str) -> str:
1495
+ """Mask the API URL, showing only the first 1/4 and hiding the rest."""
1496
+ if not url:
1497
+ return "Not set"
1498
+ # Show first 1/4 of the URL, mask the rest
1499
+ url_length = len(url)
1500
+ visible_length = max(1, url_length // 4)
1501
+ if visible_length >= url_length:
1502
+ return url
1503
+ visible_part = url[:visible_length]
1504
+ masked_part = "*" * (url_length - visible_length)
1505
+ return f"{visible_part}{masked_part}"
1506
+
1507
+
1482
1508
  def run_server():
1483
1509
  """Run the FastMCP server with HTTP transport."""
1484
- logger.info(f"Starting Mem-Brain MCP Server on {settings.mcp_server_host}:{settings.mcp_server_port}")
1485
- logger.info(f"API URL: {settings.api_url}")
1510
+ logger.info(f"Starting Mem-Brain MCP Server v{__version__} on {settings.mcp_server_host}:{settings.mcp_server_port}")
1511
+ logger.info(f"API URL: {_mask_api_url(settings.api_url)}")
1486
1512
  logger.info(f"API Key: {'***' if settings.api_key else 'Not set'}")
1487
1513
 
1488
1514
  # Configure CORS for browser-based and MCP clients
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mem-brain-mcp
3
- Version: 1.0.3
3
+ Version: 1.0.5
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
@@ -0,0 +1,9 @@
1
+ mem_brain_mcp/__init__.py,sha256=VjYIpP-y244JwHQcw2vVYsyAGIdNgyX-XTq1_HJWK1c,89
2
+ mem_brain_mcp/__main__.py,sha256=H_mwoKm1FBmu4KzAcQcq-TXZqeNvlrAekAxB1s4F4hA,712
3
+ mem_brain_mcp/client.py,sha256=7KFGcLoPDaOOLiuG2lygQK7xH5Kio-YifDjuSpDoDJ8,6993
4
+ mem_brain_mcp/config.py,sha256=xx2lBkCIeT85t0HxtORwZHSU3hZT_EdsThpfjwPJhbQ,1261
5
+ mem_brain_mcp/server.py,sha256=vH-xwwkS38thwajW-XraUftTRJZUaY23DxqJyumhvKI,70173
6
+ mem_brain_mcp-1.0.5.dist-info/METADATA,sha256=pt4rXTpgSP5FMxpkTZl8I0dPswJVf1fNESuSKPyDrq8,5228
7
+ mem_brain_mcp-1.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
+ mem_brain_mcp-1.0.5.dist-info/entry_points.txt,sha256=NH6QYQ-Sd8eJn5crpe_DL1PvGeUlL3y65968xPhmwG8,62
9
+ mem_brain_mcp-1.0.5.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- mem_brain_mcp/__init__.py,sha256=4mabvpmReQ0ZVZ-xw8FrwHAdGDhjWQDpHhWg_11lxmY,89
2
- mem_brain_mcp/__main__.py,sha256=H_mwoKm1FBmu4KzAcQcq-TXZqeNvlrAekAxB1s4F4hA,712
3
- mem_brain_mcp/client.py,sha256=7KFGcLoPDaOOLiuG2lygQK7xH5Kio-YifDjuSpDoDJ8,6993
4
- mem_brain_mcp/config.py,sha256=xx2lBkCIeT85t0HxtORwZHSU3hZT_EdsThpfjwPJhbQ,1261
5
- mem_brain_mcp/server.py,sha256=ieSIkwWp3777ETa1M3J_SBMRUu571e3YsJj_C70UXRM,68812
6
- mem_brain_mcp-1.0.3.dist-info/METADATA,sha256=dR7sgte11k7CQyL38FTrsRDVBjx4hhil8HCXtbl9abQ,5228
7
- mem_brain_mcp-1.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
- mem_brain_mcp-1.0.3.dist-info/entry_points.txt,sha256=NH6QYQ-Sd8eJn5crpe_DL1PvGeUlL3y65968xPhmwG8,62
9
- mem_brain_mcp-1.0.3.dist-info/RECORD,,