Skip to content

Memory MCP JSON Parsing Error - All Tools Failing #3173

@FranzKiller

Description

@FranzKiller

Describe the bug

All Memory MCP tools fail with the same JSON parsing error: Unexpected non-whitespace character after JSON at position 175 (line 1 column 176). This occurs even for simple read operations like read_graph, search_nodes, and open_nodes.

To Reproduce

Steps to reproduce the behavior:

  1. Configure Memory Tool MCP server in ~/.cursor/mcp.json:n
    "Memory Tool": {
    "command": "cmd",
    "args": [
    "/c",
    "npx",
    "-y",
    "@modelcontextprotocol/server-memory"
    ]
    }
    2. Restart Cursor IDE to load the MCP server

  2. Attempt to use any Memory Tool MCP function:

    • read_graph() - fails with JSON parsing error
    • search_nodes("query") - fails with JSON parsing error
    • open_nodes(["entity"]) - fails with JSON parsing error
    • create_entities(...) - fails with JSON parsing error
  3. All tools return the same error: Unexpected non-whitespace character after JSON at position 175 (line 1 column 176)

Expected behavior

Memory Tool MCP tools should work correctly, especially read operations like read_graph which should return an empty graph if no data exists.

Environment

  • Server Version: @modelcontextprotocol/server-memory@2025.11.25 (latest)
  • IDE: Cursor IDE (Windows)
  • OS: Windows 10.0.22631
  • Node.js: (via npx)
  • Data Directory: C:\Users\Franc\.cursor\projects\c-ProgettiIscobol-sn22\mcps\user-Memory_Tool (empty - no existing data)

Logs

All tool calls return:
Restart Cursor IDE to load the MCP server
Attempt to use any Memory Tool MCP function:
read_graph() - fails with JSON parsing error
search_nodes("query") - fails with JSON parsing error
open_nodes(["entity"]) - fails with JSON parsing error
create_entities(...) - fails with JSON parsing error
All tools return the same error: Unexpected non-whitespace character after JSON at position 175 (line 1 column 176)
Expected behavior
Memory Tool MCP tools should work correctly, especially read operations like read_graph which should return an empty graph if no data exists.
Environment
Server Version: @modelcontextprotocol/server-memory@2025.11.25 (latest)
IDE: Cursor IDE (Windows)
OS: Windows 10.0.22631
Node.js: (via npx)
Data Directory: C:\Users\Franc.cursor\projects\c-ProgettiIscobol-sn22\mcps\user-Memory_Tool (empty - no existing data)
Logs
All tool calls return:
Error: Unexpected non-whitespace character after JSON at position 175 (line 1 columnsonl file exists)- Using the simplest possible operations (read_graphwith no parameters)- The server version is the latest available (2025.11.25)## Additional context- The error position (175) suggests the server is returning a malformed JSON response- The problem occurs even with an empty knowledge graph (no existing data)- All tools fail with the same error, suggesting a systemic issue rather than data corruption- The server starts correctly (no startup errors)- The MCP connection is established (tools are recognized)## Related Issues- #3144 - Schema Validation Error (different issue, related to additional properties)- #3137 -open_nodes` returns empty relations (different issue, related to relations)## Suggested Solutions1. Investigate JSON serialization: The error suggests the server is generating malformed JSON responses2. Check empty state handling: The error occurs even with no data, suggesting the server may not handle empty graphs correctly3. Verify MCP protocol compliance: Ensure the server's JSON responses comply with MCP protocol specifications
This error occurs even when:
The data directory is completely empty (no memory.jsonl file exists)
Using the simplest possible operations (read_graph with no parameters)
The server version is the latest available (2025.11.25)
Additional context
The error position (175) suggests the server is returning a malformed JSON response
The problem occurs even with an empty knowledge graph (no existing data)
All tools fail with the same error, suggesting a systemic issue rather than data corruption
The server starts correctly (no startup errors)
The MCP connection is established (tools are recognized)
Related Issues
#3144 - Schema Validation Error (different issue, related to additional properties)
#3137 - open_nodes returns empty relations (different issue, related to relations)
Suggested Solutions
Investigate JSON serialization: The error suggests the server is generating malformed JSON responses
Check empty state handling: The error occurs even with no data, suggesting the server may not handle empty graphs correctly
Verify MCP protocol compliance: Ensure the server's JSON responses comply with MCP protocol specifications
Copia e incolla questo testo nel campo attivo su GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions