Documentation
¶
Index ¶
- func CreateMCPServer(appConfig *AppConfig, version string) (*server.MCPServer, error)
- func ExecuteGraphQL(url, query string, vars map[string]interface{}, token string, isDebug bool) ([]byte, error)
- func RegisterTools(srv *server.MCPServer, cfg *ForgeConfig, configDir string, isDebug bool) error
- func Serve(srv *server.MCPServer, opts ServeOptions) error
- type AppConfig
- type CtxAuthKey
- type ForgeConfig
- type GraphqlRequest
- type ServeOptions
- type ToolAnnotations
- type ToolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMCPServer ¶
CreateMCPServer creates and configures an MCP server with all tools registered
func ExecuteGraphQL ¶
func ExecuteGraphQL(url, query string, vars map[string]interface{}, token string, isDebug bool) ([]byte, error)
ExecuteGraphQL posts a query+vars to url with Bearer token, returning raw JSON
func RegisterTools ¶
RegisterTools discovers and registers all tools from the config directory
Types ¶
type AppConfig ¶
type AppConfig struct {
ConfigDir string
IsDebug bool
Config *ForgeConfig
}
AppConfig holds the parsed application configuration
type CtxAuthKey ¶
type CtxAuthKey struct{}
CtxAuthKey is used as a key for storing auth tokens in context
type ForgeConfig ¶
type ForgeConfig struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
TokenCommand string `yaml:"token_command"`
Env map[string]string `yaml:"env,omitempty"`
EnvPassthrough bool `yaml:"env_passthrough,omitempty"`
}
ForgeConfig holds global server settings
func LoadForgeConfig ¶
func LoadForgeConfig(path string) (*ForgeConfig, error)
LoadForgeConfig loads ForgeConfig from the given file path
type GraphqlRequest ¶
type GraphqlRequest struct {
Query string `json:"query"`
Variables map[string]interface{} `json:"variables,omitempty"`
}
GraphqlRequest is the POST payload for GraphQL
type ServeOptions ¶
ServeOptions holds options for serving the MCP server
type ToolAnnotations ¶
type ToolAnnotations struct {
Title string `yaml:"title,omitempty"`
ReadOnlyHint *bool `yaml:"readOnlyHint,omitempty"`
DestructiveHint *bool `yaml:"destructiveHint,omitempty"`
IdempotentHint *bool `yaml:"idempotentHint,omitempty"`
OpenWorldHint *bool `yaml:"openWorldHint,omitempty"`
}
ToolAnnotations defines the annotations for a tool
type ToolConfig ¶
type ToolConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Query string `yaml:"query"`
Inputs []struct {
Name string `yaml:"name"`
Type string `yaml:"type"` // "string" or "number"
Description string `yaml:"description"`
Required bool `yaml:"required"`
} `yaml:"inputs"`
Annotations ToolAnnotations `yaml:"annotations,omitempty"`
Output string `yaml:"output,omitempty"` // "raw" (default), "json", or "toon"
}
ToolConfig holds one tool's YAML definition
func LoadToolConfig ¶
func LoadToolConfig(path string) (*ToolConfig, error)
LoadToolConfig loads ToolConfig from the given file path