Django ORM

All models for the MCPClient app.

class smarter.apps.mcpclient.models.MCPAuthType(*values)[source]

Bases: TextChoices

MCP Authentication Type choice list.

API_KEY = 'api_key'
BEARER_TOKEN = 'bearer_token'
NONE = 'none'
OAUTH2 = 'oauth2'
class smarter.apps.mcpclient.models.MCPClient(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModel

Implements the MCPClient API model.

Parameters:
  • id (Unknown) – Primary key: ID

  • created_at (Unknown) – Created at

  • updated_at (Unknown) – Updated at

  • name (Unknown) – Name. Name in camelCase, e.g., ‘apiKey’, no special characters.

  • description (Unknown) – Description. A brief description of this resource. Be verbose, but not too verbose.

  • version (Unknown) – Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.

  • annotations (Unknown) – Annotations. Key-value pairs for annotating this resource.

  • transport (Unknown) – Transport

  • endpoint_url (Unknown) – Endpoint url. Required for sse/http transports; omitted for stdio.

  • command (Unknown) – Command. Executable + args for stdio transport, e.g. ‘npx @scope/server’.

  • config (Unknown) – Config. Transport-specific params: headers, env vars, timeout_s, retry_policy, etc.

  • auth_type (Unknown) – Auth type

  • allowed_tools (Unknown) – Allowed tools. Tool name allowlist exposed to the harness; empty = all tools the server advertises.

  • allowed_resources (Unknown) – Allowed resources. Resource URI patterns this client may access; empty = all.

  • is_active (Unknown) – Is active

  • status (Unknown) – Status

  • priority (Unknown) – Priority. Resolution order when multiple MCPClients could serve a request; lower runs first.

  • protocol_version (Unknown) – Protocol version. Negotiated MCP protocol version from the last successful handshake.

Relationship fields:

Parameters:
  • user_profile (Unknown) – User profile (related name: mcpclient)

  • credentials (Unknown) – Credentials. auth credential (related name: mcpclient)

  • tags (Unknown) – Tags. Tags for categorizing and organizing this resource. (related name: mcpclient)

  • tagged_items (Unknown) – Tagged items (related name: +)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

allowed_resources

JSONField

Allowed resources. Resource URI patterns this client may access; empty = all.

Type:

Type

allowed_tools

JSONField

Allowed tools. Tool name allowlist exposed to the harness; empty = all tools the server advertises.

Type:

Type

annotations

JSONField

Annotations. Key-value pairs for annotating this resource.

Type:

Type

auth_type

CharField

Auth type

Choices:

  • none

  • api_key

  • oauth2

  • bearer_token

Type:

Type

command

CharField

Command. Executable + args for stdio transport, e.g. ‘npx @scope/server’.

Type:

Type

config

JSONField

Config. Transport-specific params: headers, env vars, timeout_s, retry_policy, etc.

Type:

Type

created_at

DateTimeField

Created at

Timestamp indicating when the model instance was created.

This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.

Type:

Type

credentials

ForeignKey to Secret

Credentials. auth credential (related name: mcpclient)

Type:

Type

credentials_id

Internal field, use credentials instead.

description

TextField

Description. A brief description of this resource. Be verbose, but not too verbose.

Type:

Type

endpoint_url

URLField

Endpoint url. Required for sse/http transports; omitted for stdio.

Type:

Type

get_auth_type_display(*, field=<django.db.models.CharField: auth_type>)

Shows the label of the auth_type. See get_FOO_display() for more information.

get_status_display(*, field=<django.db.models.CharField: status>)

Shows the label of the status. See get_FOO_display() for more information.

get_transport_display(*, field=<django.db.models.CharField: transport>)

Shows the label of the transport. See get_FOO_display() for more information.

id

BigAutoField

Primary key: ID

Type:

Type

is_active

BooleanField

Is active

Type:

Type

name

CharField

Name. Name in camelCase, e.g., ‘apiKey’, no special characters.

Type:

Type

priority

PositiveSmallIntegerField

Priority. Resolution order when multiple MCPClients could serve a request; lower runs first.

Type:

Type

protocol_version

CharField

Protocol version. Negotiated MCP protocol version from the last successful handshake.

Type:

Type

status

CharField

Status

Choices:

  • unconfigured

  • connected

  • disconnected

  • error

Type:

Type

tagged_items

Reverse GenericRelation from MCPClient

All + of this tagged item (related name of tagged_items)

Type:

Type

tags = <taggit.managers._TaggableManager object>
transport

CharField

Transport

Choices:

  • stdio

  • sse

  • http

Type:

Type

updated_at

DateTimeField

Updated at

Timestamp indicating when the model instance was last updated.

This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.

Type:

Type

user_profile

ForeignKey to UserProfile

User profile (related name: mcpclient)

Type:

Type

user_profile_id

Internal field, use user_profile instead.

version

CharField

Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.

Type:

Type

class smarter.apps.mcpclient.models.MCPConnectionStatus(*values)[source]

Bases: TextChoices

MCP Connection Status choice list.

CONNECTED = 'connected'
DISCONNECTED = 'disconnected'
ERROR = 'error'
UNCONFIGURED = 'unconfigured'
class smarter.apps.mcpclient.models.MCPTransport(*values)[source]

Bases: TextChoices

MCP Transport choice list.

HTTP = 'http'
SSE = 'sse'
STDIO = 'stdio'