mem-brain-mcp 1.0.3__tar.gz → 1.0.5__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.3 → mem_brain_mcp-1.0.5}/.gitignore +3 -5
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/PKG-INFO +1 -1
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/pyproject.toml +1 -1
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/src/mem_brain_mcp/__init__.py +1 -1
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/src/mem_brain_mcp/server.py +30 -4
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/.dockerignore +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/.env +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/README.md +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/TROUBLESHOOTING.md +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/USAGE.md +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/DEPLOYMENT.md +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/alb-target-group.json +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/deploy.sh +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/ecs-service-config.json +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/ecs-task-definition.json +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/aws/security-groups.md +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/docker/Dockerfile +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/src/mem_brain_mcp/__main__.py +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/src/mem_brain_mcp/client.py +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/src/mem_brain_mcp/config.py +0 -0
- {mem_brain_mcp-1.0.3 → mem_brain_mcp-1.0.5}/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.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
|
|
@@ -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
|
|
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
|