Server Overview
Understanding the ShotGrid MCP Server architecture
ShotGrid MCP Server Overview
ShotGrid MCP Server is built on the Model Context Protocol (MCP) and provides a standardized way for LLMs to interact with ShotGrid data. This page provides an overview of the server architecture and key components.
Architecture
ShotGrid MCP Server consists of several key components:
Core Components
-
Server: The main
ShotGridMCPServer
class that implements the MCP protocol and manages all components. -
Connection Pool: Manages connections to the ShotGrid API, providing efficient connection reuse and error handling.
-
Schema Loader: Loads and caches the ShotGrid schema, which defines entity types, fields, and relationships.
-
Tool Manager: Registers and manages tools that can be called by MCP clients.
-
Mockgun Extension: An enhanced version of ShotGrid’s Mockgun for testing without a real ShotGrid instance.
Server Configuration
When creating a ShotGridMCPServer
instance, you can configure various aspects of its behavior:
Configuration Options
Parameter | Type | Description |
---|---|---|
name | str | Name of the server, shown to clients |
shotgrid_url | str | URL of your ShotGrid instance |
script_name | str | Script name for API authentication |
api_key | str | API key for authentication |
shotgun | Shotgun | Existing Shotgun instance to use |
use_mockgun | bool | Whether to use Mockgun instead of real ShotGrid |
max_connections | int | Maximum number of connections in the pool |
connection_timeout | int | Timeout for ShotGrid API calls (seconds) |
schema_path | str | Path to a cached schema file |
entity_schema_path | str | Path to a cached entity schema file |
on_duplicate_tools | str | How to handle duplicate tool registrations |
Lifecycle Hooks
ShotGrid MCP Server provides hooks for running code at different points in the server lifecycle:
Running the Server
To start the server, call the run
method:
For more control over the server lifecycle, you can use the async API:
Next Steps
Now that you understand the server architecture, you can:
- Learn how to create Tools for your server
- Understand the Connection Pool for efficient API usage
- Explore the Schema Loader for working with ShotGrid schemas
- See how to use Mockgun for testing