Skip to content

Commit 376a687

Browse files
committed
Update
1 parent 0b8ff55 commit 376a687

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

mcp-server/src/generate_mcp_tools.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,22 @@
1010

1111
import inspect
1212
import json
13+
import os
1314
import re
15+
import sys
1416
from pathlib import Path
1517
from typing import Any, get_type_hints, get_origin, get_args
1618

19+
# Configure environment to use UTF-8 encoding (fixes emoji display on Windows)
20+
if sys.platform == 'win32':
21+
# Set console to UTF-8 mode on Windows
22+
os.system('chcp 65001 > nul 2>&1')
23+
# Reconfigure stdout encoding if available (Python 3.7+)
24+
try:
25+
sys.stdout.reconfigure(encoding='utf-8') # type: ignore[attr-defined]
26+
except (AttributeError, OSError):
27+
pass # Not available or failed, continue anyway
28+
1729

1830
def get_api_modules():
1931
"""Import all API modules from the generated client dynamically."""
@@ -514,7 +526,7 @@ def main():
514526

515527
# Write to file
516528
output_file = Path(__file__).parent / "backend_mcp_server_generated.py"
517-
with open(output_file, "w") as f:
529+
with open(output_file, "w", encoding="utf-8") as f:
518530
f.write(server_code)
519531

520532
print(f"✅ Generated MCP server: {output_file}")

openapitools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
33
"spaces": 2,
44
"generator-cli": {
5-
"version": "latest"
5+
"version": "7.16.0"
66
}
77
}

0 commit comments

Comments
 (0)