Working with GT as an MCP server

GT ships with a minimal implementation of an MCP server that can execute tools, expose resources, and define prompts.

To start an MCP server on port 3000, execute the following snippet.

server := GtLMcpServer new
		port: 3000;
		start
  

To stop the server, you can call GtLMcpServer>>#stop stop "Stop serving and tell my plugins; they are told also when I was not running. Every plugin is told, also when one fails: the failure is signalled to my sender after the others were told" server ifNotNil: [ server stop. server := nil ]. self tellStopped: self plugins on it.

server stop
  

A note: this server was not hardened. It is a simple Zinc server that might crash or, depending on the capabilities you give the tools it exposes, do undesirable things to your image or system at large. Use with caution at this time.