Bug Report
Summary
mempalace_diary_write MCP tool returns Internal tool error (-32000) when the entry parameter contains non-ASCII characters such as Chinese text, ×, →, or ★. The same call succeeds when the entry is plain ASCII.
Environment
- mempalace version: 3.3.0
- Platform: Windows 10 (via Claude Code plugin)
- Python: 3.10.7
- MCP client: Claude Code
Steps to Reproduce
Call mempalace_diary_write via MCP with a non-ASCII entry:
{
"agent_name": "claude",
"entry": "SESSION:2026-04-16|test|hook.fire×3|root.cause:chromadb.stale→reconnect.fix|JH:重要更动先确认★★★",
"topic": "operations"
}
Result: MCP error -32000: Internal tool error
Call the same tool with an ASCII-only entry:
{
"agent_name": "claude",
"entry": "SESSION:2026-04-16|test|hook.fire.x3|chromadb.stale.reconnect.fix",
"topic": "operations"
}
Result: Success
Additional Context
Calling tool_diary_write directly via Python (bypassing MCP transport) works fine with non-ASCII characters. The issue appears to be in the MCP transport layer's handling of Unicode in tool arguments.
from mempalace.mcp_server import tool_diary_write
# This works fine:
tool_diary_write(agent_name='claude', entry='SESSION:2026-04-16|test|hook.fire.confirmed★★★', topic='operations')
Simulating the MCP request via handle_request also works:
from mempalace.mcp_server import handle_request
req = {
'jsonrpc': '2.0', 'id': 1, 'method': 'tools/call',
'params': {'name': 'mempalace_diary_write', 'arguments': {
'agent_name': 'claude',
'entry': 'SESSION:2026-04-16|stop-hook-test|MCP.diary.write.debug★',
'topic': 'operations'
}}
}
handle_request(req) # succeeds
This suggests the failure is specific to how the live MCP server process receives and handles the characters — possibly a stdio encoding issue on Windows.
Workaround
Use ASCII-only characters in diary entries.
Bug Report
Summary
mempalace_diary_writeMCP tool returnsInternal tool error(-32000) when theentryparameter contains non-ASCII characters such as Chinese text,×,→, or★. The same call succeeds when the entry is plain ASCII.Environment
Steps to Reproduce
Call
mempalace_diary_writevia MCP with a non-ASCII entry:{ "agent_name": "claude", "entry": "SESSION:2026-04-16|test|hook.fire×3|root.cause:chromadb.stale→reconnect.fix|JH:重要更动先确认★★★", "topic": "operations" }Result:
MCP error -32000: Internal tool errorCall the same tool with an ASCII-only entry:
{ "agent_name": "claude", "entry": "SESSION:2026-04-16|test|hook.fire.x3|chromadb.stale.reconnect.fix", "topic": "operations" }Result: Success
Additional Context
Calling
tool_diary_writedirectly via Python (bypassing MCP transport) works fine with non-ASCII characters. The issue appears to be in the MCP transport layer's handling of Unicode in tool arguments.Simulating the MCP request via
handle_requestalso works:This suggests the failure is specific to how the live MCP server process receives and handles the characters — possibly a stdio encoding issue on Windows.
Workaround
Use ASCII-only characters in diary entries.