# coding: utf-8
#
# Copyright 2026 祁筱欣
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
MCP 服务器 - stdio 模式入口
此文件用于通过 stdio(标准输入输出)模式启动 MCP 服务器。
适合本地开发和 Claude Desktop 集成。
使用方法:
python stdio_main.py
或
mzmcp
"""
import asyncio
import sys
from mzmcp.mcp_server import mcp
async def main():
"""MCP Server stdio 模式主入口函数"""
await mcp.run()
if __name__ == "__main__":
try:
asyncio.run(main())
except Exception as e:
print(f"错误: 启动 MCP 服务器失败 - {str(e)}", file=sys.stderr)
sys.exit(1)