Skip to content

No way to subclass MCP #151

Description

@NicolasAnquetil

I tried to create my own MCP server by subclassing MCP but the initialization process only looks at the server class itself

MCPMessageProcessor >> addHandlersFromPragmasIn: anObject

	( Pragma allNamed: #jrpc: in: anObject class )
		do: [ :pragma | ...

since the pragma is in methods define by MCP itself, this does not work for subclasses of MCP

One straightforward solution would be to redefine it to look up the inheritance hierarchy:

addHandlersFromPragmasIn: anObject
      anObject class withAllSuperclasses reverseDo: [ :cls |
			(Pragma allNamed: #jrpc: in: aClass) do: [ :pragma | ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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