Skip to content

fix fastmcp-python template and rename tool name to avoid collision #492

Merged
josh-pritchard merged 7 commits into
mainfrom
xytian315/fix-fastmcp-trailing-slash
May 18, 2026
Merged

fix fastmcp-python template and rename tool name to avoid collision #492
josh-pritchard merged 7 commits into
mainfrom
xytian315/fix-fastmcp-trailing-slash

Conversation

@xytian315
Copy link
Copy Markdown
Collaborator

@xytian315 xytian315 commented May 13, 2026

Description

fix fastmcp-python template and rename tool name to avoid collision with remote mcp server.
Prefix example tools to avoid collisions. echo and sum collide with common reference MCP servers (@modelcontextprotocol/server-everything)

Change Type

/kind fix

Changelog

NONE

Additional Notes

@xytian315 xytian315 changed the title WIP: fix fastmcp example and tool name collision fix fastmcp example and tool name collision May 13, 2026
@xytian315 xytian315 marked this pull request as ready for review May 13, 2026 21:13
Copilot AI review requested due to automatic review settings May 13, 2026 21:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the FastMCP Python template to avoid common tool-name collisions in multi-server setups and to improve HTTP transport behavior around /mcp routing.

Changes:

  • Renames example tools to example_echo / example_sum to reduce collisions with common reference MCP servers.
  • Updates the echo tool’s config lookup key to match the new tool name.
  • Changes HTTP startup to build an ASGI app and run Uvicorn directly, attempting to avoid Starlette’s trailing-slash redirect behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
internal/cli/frameworks/builtin/fastmcp-python/templates/src/tools/sum.py.tmpl Renames the example sum tool to example_sum and updates docstring rationale.
internal/cli/frameworks/builtin/fastmcp-python/templates/src/tools/echo.py.tmpl Renames the example echo tool to example_echo and updates tool-config lookup key.
internal/cli/frameworks/builtin/fastmcp-python/templates/src/core/server.py.tmpl Switches HTTP mode to http_app() + uvicorn.run() and disables redirect slashes.

Comment thread internal/cli/frameworks/builtin/fastmcp-python/templates/src/core/server.py.tmpl Outdated
Comment thread internal/cli/frameworks/builtin/fastmcp-python/templates/src/core/server.py.tmpl Outdated
@xytian315 xytian315 changed the title fix fastmcp example and tool name collision fix fastmcp template and rename tool name to avoid collision May 13, 2026
@xytian315 xytian315 changed the title fix fastmcp template and rename tool name to avoid collision fix fastmcp-python template and rename tool name to avoid collision May 13, 2026
@josh-pritchard josh-pritchard added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit cb4a3f4 May 18, 2026
7 checks passed
@josh-pritchard josh-pritchard deleted the xytian315/fix-fastmcp-trailing-slash branch May 18, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants