You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Graceful handling of character encoding errors in SQLite MCP server #124
Is your feature request related to a problem? Please describe.
When using Japanese text with SQLite database in the Claude Desktop Application, the MCP server crashes if character encoding is not properly configured. Specifically:
Attempting to INSERT Japanese text causes the MCP server to crash
Even for successful manual inserts ('apple', 'りんご') via direct SQLite operations, querying through the application shows corrupt characters:
{'id': 1, 'word': 'apple', 'meaning_ja': '���'}
Describe the solution you'd like
The MCP server should handle character encoding errors gracefully without crashing. When encountering encoding issues, it should:
Continue running instead of crashing
Possibly return an error message indicating the encoding problem
Allow users to fix the encoding settings without needing to restart the server
Describe alternatives you've considered
Currently, the issue can be worked around by setting the PYTHONIOENCODING environment variable in the MCP server configuration:
SQLite itself is encoding-agnostic and treats data as byte strings. The character encoding interpretation happens at the interface level - in this case, Python's SQLite driver in the MCP server. Without proper encoding settings, Python may default to an incorrect encoding when reading from or writing to the database.
I had the same issue as well when trying to have a db with tamil text, luckily found this issue to find a workaround to include encoding information in the config after several attempts. please consider fixing this.
Activity
naveenatmit commentedon Nov 30, 2024
I had the same issue as well when trying to have a db with tamil text, luckily found this issue to find a workaround to include encoding information in the config after several attempts. please consider fixing this.
jspahrsummers commentedon Dec 3, 2024
Thanks for flagging! We'd be happy to review a pull request fixing this issue if anyone wants to give it a try. 🙏
jerome3o-anthropic commentedon Jan 30, 2025
Fixed in #378, thank you @interrobot