Repository navigation
Closed
Description
What happened?
Description
SkillProvider._load_skill() calls Path.read_text() without specifying an encoding parameter. On Windows, this defaults to the system locale encoding (typically cp1252), which fails when SKILL.md files contain UTF-8 characters like emoji (✅, ❌, →).
This causes the MCP server to exit immediately with exit code 1 on Windows when loading skills that contain UTF-8 characters.
Error
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position XXX: character maps to <undefined>
Root Cause
In fastmcp/server/providers/skills/skill_provider.py, approximately line 13:
content = main_file.read_text() # ❌ No encoding specifiedWithout an explicit encoding parameter, Python uses the system's default encoding, which is cp1252 on Windows. This cannot decode UTF-8 emoji and special characters.
Example Code
from pathlib import Path
from tempfile import TemporaryDirectory
from fastmcp.server.providers.skills import SkillsDirectoryProvider
# Create a temporary skill directory with UTF-8 content
with TemporaryDirectory() as tmpdir:
skill_dir = Path(tmpdir) / "test-skill"
skill_dir.mkdir()
# Create SKILL.md with UTF-8 emoji characters
skill_file = skill_dir / "SKILL.md"
skill_file.write_text(
"""---
name: test-skill
description: Test skill with UTF-8 characters
---
# Test Skill
- ✅ Success indicator
- ❌ Failure indicator
- → Arrow symbol
""",
encoding="utf-8"
)
# This will fail on Windows with UnicodeDecodeError
provider = SkillsDirectoryProvider(roots=skill_dir.parent)
print("Skills loaded successfully")Version Information
FastMCP version: 3.2.4
MCP version: 1.27.0
Python version: 3.12.0
Activity
doneman536 commentedon May 3, 2026
In upcoming versions of python utf-8 is supported by default. Till then we can have this.
Requested changes added now it use UTF-8 encoding alone and added reg…
#4084 [Issues] Windows startup crash due to UnicodeDecodeError when l… (
jlowin commentedon May 20, 2026
Closed in #4092