Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/postgres_mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import asyncio
import sys

from . import server
from . import top_queries


def main():
"""Main entry point for the package."""
# As of version 3.3.0 Psycopg on Windows is not compatible with the default
# ProactorEventLoop.
# See: https://www.psycopg.org/psycopg3/docs/advanced/async.html#async
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

asyncio.run(server.main())


Expand Down
4 changes: 0 additions & 4 deletions src/postgres_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,3 @@ async def shutdown(sig=None):

# Exit with appropriate status code
sys.exit(128 + sig if sig is not None else 0)


if __name__ == "__main__":
asyncio.run(main())