Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConfig ¶
type BaseConfig struct {
// Mattermost server URL (e.g., "https://mattermost.company.com")
MMServerURL string `json:"mm_server_url"`
// Internal Mattermost server URL for API communication (e.g., "http://localhost:8065")
// If empty, MMServerURL will be used for internal communication
MMInternalServerURL string `json:"mm_internal_server_url"`
// Development mode enables additional tools for setting up test data
DevMode bool `json:"dev_mode"`
}
BaseConfig represents common configuration for all MCP server types
func (BaseConfig) GetDevMode ¶
func (c BaseConfig) GetDevMode() bool
GetDevMode returns the development mode setting
func (BaseConfig) GetMMInternalServerURL ¶
func (c BaseConfig) GetMMInternalServerURL() string
GetMMInternalServerURL returns the internal Mattermost server URL for API communication If not set, falls back to the external server URL for backward compatibility
func (BaseConfig) GetMMServerURL ¶
func (c BaseConfig) GetMMServerURL() string
GetMMServerURL returns the Mattermost server URL
type HTTPConfig ¶
type HTTPConfig struct {
BaseConfig
// HTTP server configuration
HTTPPort int `json:"http_port"` // Port for HTTP server (default: 8080)
HTTPBindAddr string `json:"http_bind_addr"` // Bind address (default: "127.0.0.1" for security)
SiteURL string `json:"site_url"` // Site URL for external access (optional)
}
HTTPConfig represents configuration for HTTP transport MCP server
type InMemoryConfig ¶ added in v1.5.0
type InMemoryConfig struct {
BaseConfig
}
InMemoryConfig represents configuration for in-memory transport MCP server Used for embedded MCP servers that run within the same process as the plugin
type MattermostHTTPMCPServer ¶
type MattermostHTTPMCPServer struct {
*MattermostMCPServer
// contains filtered or unexported fields
}
MattermostHTTPMCPServer wraps MattermostMCPServer for HTTP transport
func NewHTTPServer ¶
func NewHTTPServer(config HTTPConfig, logger loggerlib.Logger) (*MattermostHTTPMCPServer, error)
NewHTTPServer creates a new HTTP transport MCP server
func (*MattermostHTTPMCPServer) GetTestHandler ¶
func (s *MattermostHTTPMCPServer) GetTestHandler() http.Handler
GetTestHandler returns the HTTP handler for testing purposes
func (*MattermostHTTPMCPServer) Serve ¶
func (s *MattermostHTTPMCPServer) Serve() error
Serve starts the HTTP MCP server
type MattermostInMemoryMCPServer ¶ added in v1.5.0
type MattermostInMemoryMCPServer struct {
*MattermostMCPServer
// contains filtered or unexported fields
}
MattermostInMemoryMCPServer wraps MattermostMCPServer for in-memory transport This server runs embedded within the plugin process and uses session-based authentication
func NewInMemoryServer ¶ added in v1.5.0
func NewInMemoryServer(config InMemoryConfig, logger loggerlib.Logger) (*MattermostInMemoryMCPServer, error)
NewInMemoryServer creates a new in-memory transport MCP server This server is designed to run embedded within the plugin process
func (*MattermostInMemoryMCPServer) CreateConnectionForUser ¶ added in v1.5.0
func (s *MattermostInMemoryMCPServer) CreateConnectionForUser(userID, sessionID string, tokenResolver auth.TokenResolver) (*mcp.InMemoryTransport, error)
CreateConnectionForUser creates a new in-memory transport connection for a specific user Returns the client-side transport that should be used by the MCP client Accepts either: - sessionID + tokenResolver: Creates authenticated connection - empty sessionID + nil tokenResolver: Creates unauthenticated connection (for tool discovery)
type MattermostMCPServer ¶
type MattermostMCPServer struct {
// contains filtered or unexported fields
}
MattermostMCPServer provides a high-level interface for creating an MCP server with Mattermost-specific tools and authentication
func (*MattermostMCPServer) GetMCPServer ¶
func (s *MattermostMCPServer) GetMCPServer() *mcp.Server
GetMCPServer returns the underlying MCP server for testing purposes
type MattermostStdioMCPServer ¶
type MattermostStdioMCPServer struct {
*MattermostMCPServer
// contains filtered or unexported fields
}
MattermostStdioMCPServer wraps MattermostMCPServer for STDIO transport
func NewStdioServer ¶
func NewStdioServer(config StdioConfig, logger loggerlib.Logger) (*MattermostStdioMCPServer, error)
NewStdioServer creates a new STDIO transport MCP server
func (*MattermostStdioMCPServer) Serve ¶
func (s *MattermostStdioMCPServer) Serve() error
Serve starts the STDIO MCP server
type ProtectedResourceMetadata ¶
type ProtectedResourceMetadata struct {
Resource string `json:"resource"` // Required: The protected resource's resource identifier URL
AuthorizationServers []string `json:"authorization_servers,omitempty"` // Optional: Authorization servers
ScopesSupported []string `json:"scopes_supported,omitempty"` // Recommended: OAuth scopes
ResourceName string `json:"resource_name,omitempty"` // Recommended: Human-readable name
}
ProtectedResourceMetadata represents OAuth 2.0 Protected Resource Metadata (RFC 9728)
type ServerConfig ¶
type ServerConfig interface {
GetMMServerURL() string
GetMMInternalServerURL() string
GetDevMode() bool
}
ServerConfig interface defines common configuration methods for all server types
type StdioConfig ¶
type StdioConfig struct {
BaseConfig
// Personal Access Token for authentication
PersonalAccessToken string `json:"personal_access_token"`
}
StdioConfig represents configuration for STDIO transport MCP server