Skip to content

fix(traffic-route): fix build failure and import path in Python MCP server#404

Open
Alex-eng-ux wants to merge 1 commit into
volcengine:mainfrom
Alex-eng-ux:fix/traffic-route-build-issues
Open

fix(traffic-route): fix build failure and import path in Python MCP server#404
Alex-eng-ux wants to merge 1 commit into
volcengine:mainfrom
Alex-eng-ux:fix/traffic-route-build-issues

Conversation

@Alex-eng-ux

Copy link
Copy Markdown

Description

Fix two issues in the TrafficRoute Python MCP server that prevent it from building and running correctly.

Changes

1. pyproject.toml - Fix build failure with uvx

The readme = "../README.md" references a file in the parent directory. When building via uvx --from git+..., setuptools's security check blocks access to files outside the package directory, causing DistutilsOptionError.

Fix: Remove the readme field. The package can still be documented via other means.

2. server.py - Fix import path and run method

  • Wrong import path: from vcloud.veenedge.mcp_server import create_mcp_server — the module vcloud.veenedge does not exist. The correct import is from vcloud.traffic_route.mcp_server import create_mcp_server.
  • asyncio.run(mcp.run()) fails with TypeError: An asyncio.Future, a coroutine or an awaitable is required on newer MCP SDK versions. Changed to mcp.run() which works correctly.

Testing

Tested locally with uvx --from <local_path> mcp-server-traffic-route — the server starts successfully and accepts MCP stdio protocol connections.

…rt path

- Remove `readme = "../README.md"` from pyproject.toml to fix
  DistutilsOptionError when building via uvx
- Fix server.py: wrong import path `vcloud.veenedge.mcp_server`
  should be `vcloud.traffic_route.mcp_server`
- Fix server.py: replace `asyncio.run(mcp.run())` with `mcp.run()`
  for compatibility with newer MCP SDK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant