use asyncio.run
This commit is contained in:
parent
612d792fd3
commit
71bb5ba66b
1 changed files with 3 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ Let's build your first MCP server in Python! We'll create a weather server that
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
import anyio
|
import asyncio
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from mcp.server import Server
|
from mcp.server import Server
|
||||||
from mcp.types import (
|
from mcp.types import (
|
||||||
|
|
@ -275,11 +275,11 @@ Let's build your first MCP server in Python! We'll create a weather server that
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from . import server
|
from . import server
|
||||||
import anyio
|
import asyncio
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point for the package."""
|
"""Main entry point for the package."""
|
||||||
anyio.run(server.main)
|
asyncio.run(server.main())
|
||||||
|
|
||||||
# Optionally expose other important items at package level
|
# Optionally expose other important items at package level
|
||||||
__all__ = ['main', 'server']
|
__all__ = ['main', 'server']
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue