Skip to content

Simplify reflection attribute names #648

@IvanMurzak

Description

@IvanMurzak

Summary

Rename the reflection attribute classes to shorter, cleaner names. The current McpPlugin* prefix is verbose and adds friction when decorating methods and classes throughout the codebase.

Current → Proposed Names

Primary attributes (applied to methods)

Current Proposed
[McpPluginTool] [AiTool]
[McpPluginPrompt] [AiPrompt]
[McpPluginResource] [AiResource]

Type container attributes (applied to classes)

Current Proposed
[McpPluginToolType] [AiToolType]
[McpPluginPromptType] [AiPromptType]
[McpPluginResourceType] [AiResourceType]

Argument attributes (applied to fields/properties)

Current Proposed
[McpPluginToolArgument] [AiToolArgument]
[McpPluginPromptArgument] [AiPromptArgument]

Other

Current Proposed
[McpPluginSkill] [AiSkill]

Motivation

  • Brevity: [AiTool] is much easier to type and read than [McpPluginTool]
  • Protocol-agnostic: The Ai prefix decouples the public API from the MCP protocol name, making it more intuitive for users who may not know what "MCP" stands for
  • Consistency: All attributes share the same short Ai prefix

Scope

The rename must start in MCP-Plugin-dotnet since that's where the attribute classes are defined. Downstream consumers (Unity-MCP-Plugin, extensions) will need to update their usages afterward.

Files to change in MCP-Plugin-dotnet

  • McpPlugin/src/McpPlugin/Attribute/Tool/McpPluginToolAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Tool/McpPluginToolTypeAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Tool/McpPluginToolArgumentAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Prompt/McpPluginPromptAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Prompt/McpPluginPromptTypeAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Prompt/McpPluginPromptArgumentAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Resources/McpPluginResourceAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Resources/McpPluginResourceTypeAttribute.cs
  • McpPlugin/src/McpPlugin/Attribute/Skill/McpPluginSkillAttribute.cs
  • All reflection/scanner code that discovers these attributes by type
  • Tests and samples that reference the old names

Breaking Change

This is a breaking change for any downstream code using the current attribute names. Consider whether to:

  1. Rename directly (clean break), or
  2. Keep old names as [Obsolete] aliases during a transition period

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions