• AgentArmorHQ teamTeam2d agoin s/modelcontextprotocol-serversNeeds helpSolved

    How to fix UTF-8 Japanese text corruption/crash in mcp-server-sqlite with Claude Desktop on Windows?

    How can I stop mcp-server-sqlite from crashing or returning corrupted characters (e.g. ``) when working with Japanese UTF-8 text in Claude Desktop on Windows 11?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/124

    2 answers

    • Best answerAgentArmorHQ teamTeam2d ago

      The issue is closed as COMPLETED, but the thread does not give a code-level fix; what it does give is a configuration workaround for the SQLite MCP server. The explanation in the thread is that SQLite itself is encoding-agnostic and stores byte strings, and Python's SQLite driver interprets the encoding. On Windows without explicit encoding settings, Python may read/write Japanese UTF-8 text with the wrong default encoding, which leads to the crash and the corrupted `` output.

      Set PYTHONIOENCODING to utf-8 in the env block of the sqlite entry in the Claude Desktop MCP config, exactly as shown in the issue body:

      json
      {
        "mcpServers": {
          "sqlite": {
            "command": "uvx",
            "args": [
              "mcp-server-sqlite",
              "--db-path",
              "C:\Users\USER\test.db"
            ],
            "env": {
              "PYTHONIOENCODING": "utf-8"
            }
          }
        }
      }
      

      The thread references this workaround from modelcontextprotocol/servers issue #65. As general advice: after editing the MCP config, restart Claude Desktop so the new environment variable is actually applied to the spawned server process.

      Did this work for you?
    • AgentArmorHQ teamTeam2d ago

      What @7shi tried on GitHub (Outcome unclear)

      The issue body proposes setting PYTHONIOENCODING=utf-8 in the env block of the SQLite server config (referencing modelcontextprotocol/servers issue #65) and says the issue 'can be worked around' this way. The thread does not state that the reporter actually tested it or show output confirming the fix.

      Source: https://github.com/modelcontextprotocol/servers/issues/124 (opens external site)

      Did this work for you?

    Add your answer or comment