API Reference
The MCPClient REST api is mounted at /api/v1/mcpclients/. MCPClients are created and
updated by applying manifests, so the api lists, reads and deletes them, and connects to
their MCP servers.
MCPClient api/v1/mcpclients views.
MCPClients are created and updated by applying manifests, with smarter apply, so
these views do not create or update them. They list, read and delete MCPClients, and
connect to their MCP servers:
GET mcpclients/: the MCPClients that the user may read.GET mcpclients/<hashed_id>/: an MCPClient that the user may read.DELETE mcpclients/<hashed_id>/: delete an MCPClient that the user owns.GET mcpclients/<hashed_id>/tools/: the tools that the MCPClient offers the LLM, from its cached catalog.?refresh=truereconnects to the server first.POST mcpclients/<hashed_id>/refresh/: reconnect to the MCP server, and return the MCPClient’s status.POST mcpclients/<hashed_id>/tools/<tool_name>/: call a tool, with the JSON request body as its arguments. Only the owner may call tools.
The responses are built from the models of smarter.apps.mcpclient.contract.models, which the
Smarter api’s OpenAPI document publishes. Errors are Django REST framework’s {"detail": ...}. A
failed connection to the MCP server adds the MCPClient’s connection status beside it.
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.
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientListView(*args, **kwargs)[source]
Bases:
ContractListMixin,SmarterAuthenticatedListAPIViewThe MCPClients that the user may read.
- contract_model
alias of
MCPClientApiMCPClient
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- Return type:
- serializer_class
alias of
MCPClientSerializer
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientRefreshView(*args, **kwargs)[source]
Bases:
MCPClientViewBaseReconnect to an MCPClient’s MCP server.
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientToolCallView(*args, **kwargs)[source]
Bases:
MCPClientViewBaseCall one of an MCPClient’s tools.
Only the owner may call tools.
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientToolsView(*args, **kwargs)[source]
Bases:
MCPClientViewBaseThe tools that an MCPClient offers the LLM.
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientView(*args, **kwargs)[source]
Bases:
MCPClientViewBaseRead or delete an MCPClient.
- serializer_class
alias of
MCPClientSerializer
- class smarter.apps.mcpclient.api.v1.views.views.MCPClientViewBase(*args, **kwargs)[source]
Bases:
SmarterAuthenticatedAPIViewBase class for views of one MCPClient, identified by
hashed_idormcpclient_id.get_mcpclient()returns the MCPClient only if the user may read it, or, withowner=True, only if the user owns it. Otherwise it raisesHttp404, so that the MCPClients of other accounts are not disclosed.
- smarter.apps.mcpclient.api.v1.views.views.error_status(e)[source]
Return the HTTP status for an MCPClient error.
- Return type:
- smarter.apps.mcpclient.api.v1.views.views.status_error(mcpclient, e)[source]
The response to a failed connection to an MCPClient’s server: the error, beside the MCPClient’s connection status.
- Parameters:
mcpclient (
MCPClient) – The MCPClient.e (
SmarterMCPClientException) – The error.
- Returns:
The response, whose status is
error_status()’s.- Return type:
Response
URL configuration for the MCPClient app API.
These are mounted at /api/v1/mcpclients/. See smarter.apps.mcpclient.api.v1.views.views.
- class smarter.apps.mcpclient.api.v1.urls.MCPClientApiV1ReverseViews[source]
Bases:
objectReverse view names for the MCPClient api.
Each MCPClient view is available by the MCPClient’s hashed id, and by its id.
Example
from django.urls import reverse url = reverse( f"{MCPClientApiV1ReverseViews.namespace}:{MCPClientApiV1ReverseViews.tools_by_hashed_id}", kwargs={"hashed_id": mcpclient.hashed_id}, )
- list_view = 'mcp_client_list_view'
- mcpclient_by_hashed_id = 'mcp_client_view_by_hashed_id'
- mcpclient_by_id = 'mcp_client_view_by_id'
- namespace = 'api:v1:mcpclient'
- refresh_by_hashed_id = 'mcp_client_refresh_view_by_hashed_id'
- refresh_by_id = 'mcp_client_refresh_view_by_id'
- tool_call_by_hashed_id = 'mcp_client_tool_call_view_by_hashed_id'
- tool_call_by_id = 'mcp_client_tool_call_view_by_id'
- tools_by_hashed_id = 'mcp_client_tools_view_by_hashed_id'
- tools_by_id = 'mcp_client_tools_view_by_id'