This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-mcp-server.git
The following commit(s) were added to refs/heads/main by this push:
new cf77711 Fix: AttributeError: module 'iotdb_mcp_server.server' has no
attribute 'main' (#6)
cf77711 is described below
commit cf77711f9f9092da9535df8d7c5ee856a0164934
Author: 小豆豆学长 <[email protected]>
AuthorDate: Mon May 26 12:23:11 2025 +0800
Fix: AttributeError: module 'iotdb_mcp_server.server' has no attribute
'main' (#6)
* Update server.py
* fix: Main entry point
---
src/iotdb_mcp_server/__init__.py | 3 +--
src/iotdb_mcp_server/server.py | 7 ++++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/iotdb_mcp_server/__init__.py b/src/iotdb_mcp_server/__init__.py
index bd6c83b..a2a10c4 100644
--- a/src/iotdb_mcp_server/__init__.py
+++ b/src/iotdb_mcp_server/__init__.py
@@ -26,8 +26,7 @@ import asyncio
def main():
"""Main entry point for the package."""
- _config = Config.from_env_arguments()
- asyncio.run(server.main(_config))
+ asyncio.run(server.main())
# Expose important items at package level
diff --git a/src/iotdb_mcp_server/server.py b/src/iotdb_mcp_server/server.py
index 5c627b5..53e1fb4 100644
--- a/src/iotdb_mcp_server/server.py
+++ b/src/iotdb_mcp_server/server.py
@@ -273,7 +273,12 @@ elif config.sql_dialect == "table":
)
]
-if __name__ == "__main__":
+
+def main():
logger.info("iotdb_mcp_server running with stdio transport")
# Initialize and run the server
mcp.run(transport="stdio")
+
+
+if __name__ == "__main__":
+ main()