Documentation
¶
Index ¶
- Variables
- func CustomerURLFromContext(ctx context.Context) (string, bool)
- func NewMCPClient(ctx context.Context, resources Resources, transport transport.Interface, ...) (*client.Client, *mcp.InitializeResult, error)
- func NewMCPServer(resources Resources, groups ...*toolsets.ToolsetGroup) *server.MCPServer
- func WithCrossRegion(ctx context.Context, crossRegion bool) context.Context
- func WithCustomerURL(ctx context.Context, customerURL string) context.Context
- func WithScopes(ctx context.Context, scopes []string) context.Context
- type Resources
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the current version of the MCP server. It is set at build time using -ldflags "-X 'github.com/teamwork/mcp/internal/config.Version=1.0.0'". If not set, it defaults to "dev".
Functions ¶
func CustomerURLFromContext ¶
CustomerURLFromContext returns the customer URL from the context, if any.
func NewMCPClient ¶
func NewMCPClient( ctx context.Context, resources Resources, transport transport.Interface, options ...client.ClientOption, ) (*client.Client, *mcp.InitializeResult, error)
NewMCPClient creates a new MCP client.
func NewMCPServer ¶
func NewMCPServer(resources Resources, groups ...*toolsets.ToolsetGroup) *server.MCPServer
NewMCPServer creates a new MCP server with the given resources and toolset group.
func WithCrossRegion ¶
WithCrossRegion adds a boolean value to the context indicating if the request is cross-region.
func WithCustomerURL ¶
WithCustomerURL returns a new context with the given customer URL.
Types ¶
type Resources ¶
type Resources struct {
// Info stores environment variables mappings.
Info struct {
// Version is the current version of the MCP server.
Version string
// ServerAddress is the address of the server. This is useful for the MCP
// server in HTTP mode.
ServerAddress string
// Environment is the environment this app is running in.
Environment string
// AWSRegion is the AWS region this app is running in.
AWSRegion string
// MCPURL is the base URL of the MCP server. This is useful for the MCP
// server in HTTP mode.
MCPURL string
// APIURL is the base URL of the Teamwork API.
APIURL string
// HAProxyURL is the URL of the HAProxy instance. This is useful for the MCP
// server in HTTP mode.
HAProxyURL string
// BearerToken is the bearer token to be used to authenticate with Teamwork
// API. This is useful for the MCP server in STDIO mode.
BearerToken string
// Log contains the logging configuration.
Log struct {
// Format is the format of the logs. It can be "json" or "text".
Format string
// Level is the log level. It can be "debug", "info", "warn", "error" or
// "fatal".
Level string
// SentryDSN is the Sentry DSN to be used for error reporting.
SentryDSN string
}
// DatadogAPM contains the configuration for Datadog APM. This is useful for
// the MCP server in HTTP mode.
DatadogAPM struct {
// Enabled indicates if Datadog APM is enabled.
Enabled bool
// Service is the name of the service to be used in Datadog APM.
Service string
// AgentHost is the host of the Datadog Agent.
AgentHost string
// AgentPort is the port of the Datadog Agent.
AgentPort string
// StatsdPort is the port of the DogStatsD Agent.
StatsdPort string
// Environment is the environment to be used in Datadog APM.
Environment string
// Version is the version of the service to be used in Datadog APM.
Version string
}
}
// contains filtered or unexported fields
}
Resources stores all the resources loaded in the startup.
func (*Resources) DeskClient ¶ added in v1.5.0
DeskClient returns the Teamwork Desk Client for use.
func (*Resources) TeamworkEngine ¶
TeamworkEngine returns the Teamwork Engine instance to be used to make requests to Teamwork API.
func (*Resources) TeamworkHTTPClient ¶
TeamworkHTTPClient returns the HTTP client to be used to make requests to Teamwork API.