Signals
Signals for the mcpclient app.
These signals report the lifecycle of connections to MCP servers, and of the tool calls and resource reads that LLMs make through them.
Note
Experimental. The MCPClient was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.
- smarter.apps.mcpclient.signals.mcpclient_called = <django.dispatch.dispatcher.Signal object>
Signal sent when an MCPClient api endpoint is called.
- Parameters:
mcpclient (MCPClient) – The mcpclient instance.
request (HttpRequest) – The HTTP request object.
args – Positional arguments.
kwargs – Keyword arguments.
Example:
mcpclient_called.send(sender=self.__class__, mcpclient=self.mcpclient, request=request, args=args, kwargs=kwargs)
- smarter.apps.mcpclient.signals.mcpclient_connected = <django.dispatch.dispatcher.Signal object>
Signal sent when Smarter connects to an MCP server and fetches its catalog.
- Parameters:
mcpclient (MCPClient) – The MCPClient.
catalog (MCPServerCatalog) – What the server reported.
Example:
mcpclient_connected.send(sender=self.__class__, mcpclient=mcpclient, catalog=catalog)
- smarter.apps.mcpclient.signals.mcpclient_connection_failed = <django.dispatch.dispatcher.Signal object>
Signal sent when Smarter cannot connect to an MCP server, or fetch its catalog.
Example:
mcpclient_connection_failed.send(sender=self.__class__, mcpclient=mcpclient, error=str(e))
- smarter.apps.mcpclient.signals.mcpclient_resource_read = <django.dispatch.dispatcher.Signal object>
Signal sent when an LLM reads an MCP server’s resource.
- Parameters:
Example:
mcpclient_resource_read.send(sender=self.__class__, mcpclient=mcpclient, uri=uri, characters=1234)
- smarter.apps.mcpclient.signals.mcpclient_tool_called = <django.dispatch.dispatcher.Signal object>
Signal sent when an LLM calls an MCP server’s tool, before the call.
- Parameters:
Example:
mcpclient_tool_called.send(sender=self.__class__, mcpclient=mcpclient, tool_name=name, arguments=arguments)
- smarter.apps.mcpclient.signals.mcpclient_tool_failed = <django.dispatch.dispatcher.Signal object>
Signal sent when an MCP server’s tool cannot be called, e.g. because the server is unreachable.
- Parameters:
Example:
mcpclient_tool_failed.send(sender=self.__class__, mcpclient=mcpclient, tool_name=name, error=str(e))
- smarter.apps.mcpclient.signals.mcpclient_tool_responded = <django.dispatch.dispatcher.Signal object>
Signal sent when an MCP server’s tool returns a result.
- Parameters:
Example:
mcpclient_tool_responded.send( sender=self.__class__, mcpclient=mcpclient, tool_name=name, is_error=False, characters=1234 )