Skip to content

[Bug] Custom tools not discovered in stdio transport mode #837

@jackle1127

Description

@jackle1127

Description

Custom tools registered via [McpForUnityTool] attribute are discovered and work correctly in HTTP transport mode, but are not available when using stdio transport mode.

Steps to Reproduce

  1. Create a custom tool in a Unity project:
using MCPForUnity.Editor.Tools;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;

namespace PkgUnityMcp.Editor.Tools
{
    [McpForUnityTool("test_ping",
        Description = "Simple test tool that returns a pong.")]
    public static class McpPingTool
    {
        public static object HandleCommand(JObject @params)
        {
            string message = @params?["message"]?.ToString() ?? "pong";
            return new SuccessResponse($"test_ping reply: {message}", new
            {
                reply = message,
                source = "custom_tool"
            });
        }
    }
}
  1. Wait for compilation to complete
  2. Connect via stdio mode
  3. Attempt to call test_ping - tool is not found (Unknown or unsupported command type: test_ping)
  4. Switch to HTTP mode
  5. Call test_ping via execute_custom_tool - works correctly, returns {"reply": "hello from Claude Code", "source": "custom_tool"}

Expected Behavior

Custom tools should be discoverable and callable in both stdio and HTTP transport modes.

Actual Behavior

  • HTTP mode: Custom tools are discovered and work correctly
  • stdio mode: Custom tools are not registered. Calling them returns Unknown or unsupported command type

Environment

  • MCP for Unity: 9.4.8-beta.3
  • Unity: 2021.3.58f1
  • Client: Claude Code
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions