Skip to content

Commit ec7467a

Browse files
authored
fix: Updated server for use with pipx (#111)
* fix: import module * fix:renamed startup function to match project * fix: added synchronous function for startup with pipx * nox format
1 parent 0c6d5eb commit ec7467a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

analytics_mcp/server.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
"""Entry point for the Google Analytics MCP server."""
1818

1919
import asyncio
20-
import coordinator
20+
import analytics_mcp.coordinator as coordinator
2121
from mcp.server.lowlevel import NotificationOptions
2222
from mcp.server.models import InitializationOptions
2323
import mcp.server.stdio
2424
import mcp.server
2525
import traceback
2626

2727

28-
async def run_mcp_stdio_server():
28+
async def run_server_async():
2929
"""Runs the MCP server over standard I/O."""
3030
print("Starting MCP Stdio Server:", coordinator.app.name)
3131
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
@@ -44,9 +44,14 @@ async def run_mcp_stdio_server():
4444
)
4545

4646

47+
def run_server():
48+
"""Synchronous wrapper to run the async MCP server."""
49+
asyncio.run(run_server_async())
50+
51+
4752
if __name__ == "__main__":
4853
try:
49-
asyncio.run(run_mcp_stdio_server())
54+
asyncio.run(run_server())
5055
except KeyboardInterrupt:
5156
print("\nMCP Server (stdio) stopped by user.")
5257
except Exception:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ google-analytics-mcp = "analytics_mcp.server:run_server"
4949
dev = ["black", "nox >=2026.2.9, <2027"]
5050

5151
[build-system]
52-
requires = ["setuptools>=69.0.0", "wheel"]
52+
requires = ["setuptools>=82.0.0", "wheel"]
5353
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)