Documentation
¶
Index ¶
- Variables
- func AddDefaultTools(ts ...*Tool)
- func ClearDefaultTools()
- func UsageCLI() string
- func UsageHTTP() string
- type Prompt
- type PromptHandler
- type Prompts
- type Resource
- type Resources
- type Server
- func (s *Server) AddPrompts(as *app.State, logger util.Logger, prompts ...*Prompt) error
- func (s *Server) AddResources(as *app.State, logger util.Logger, resources ...*Resource) error
- func (s *Server) AddTools(as *app.State, logger util.Logger, tools ...*Tool) error
- func (s *Server) ServeCLI(ctx context.Context) error
- func (s *Server) ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- type Tool
- type ToolHandler
- type Tools
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllTools = Tools{ListProjectsTool, GetProjectTool} AllResources = Resources{ProjectForgeResource} AllPrompts = Prompts{ProjectPrompt} )
View Source
var ExampleTool = &Tool{ Name: "example_mcp_server", Description: "Returns a random integer", Args: util.FieldDescs{{Key: "max", Description: "Maximum possible random int (exclusive), defaults to 100"}}, Fn: exampleHandler, }
View Source
var GetProjectTool = &Tool{ Name: "get_project", Description: "Get details of a specific project managed by " + util.AppName, Args: util.FieldDescs{ {Key: "id", Description: "Optional project id. If omitted, all projects will be returned"}, }, Fn: projectsHandler, }
View Source
var ListProjectsTool = &Tool{ Name: "list_projects", Description: "List the projects managed by " + util.AppName, Fn: projectsHandler, }
View Source
var ProjectForgeResource = &Resource{
Name: "projectforge",
Description: "Description, purpose, and basic usage instructions for Project Forge (this MCP server)",
URI: "project://projectforge",
MIMEType: "text/markdown",
Content: "# Project Forge\n\n[Project Forge](https://projectforge.dev) is an application that allows you to generate, manage, and grow web applications built using the Go programming language.",
}
View Source
var ProjectPrompt = &Prompt{ Name: "project_usage", Description: "A simple prompt that helps the system build, test, and work with an application managed by Project Forge" + util.AppName, Fn: func(ctx context.Context, as *app.State, req mcp.GetPromptRequest, args util.ValueMap, logger util.Logger) (string, error) { return `This application is written using Go, and is a web application managed by Project Forge.`, nil }, }
Functions ¶
func AddDefaultTools ¶ added in v1.7.12
func AddDefaultTools(ts ...*Tool)
func ClearDefaultTools ¶ added in v1.7.12
func ClearDefaultTools()
Types ¶
type Prompt ¶ added in v1.7.14
type Prompt struct { Name string `json:"name"` Description string `json:"description,omitempty"` Icon string `json:"icon,omitempty"` Args util.FieldDescs `json:"args,omitempty"` Fn PromptHandler `json:"-"` }
func NewStaticPrompt ¶ added in v1.7.14
type PromptHandler ¶ added in v1.7.14
type Resource ¶ added in v1.7.14
type Resource struct { Name string `json:"name"` Description string `json:"description,omitempty"` Icon string `json:"icon,omitempty"` URI string `json:"uri"` MIMEType string `json:"mimeType"` Content string `json:"content"` Binary bool `json:"binary,omitempty"` }
func NewBlobResource ¶ added in v1.7.14
func NewTextResource ¶ added in v1.7.14
type Server ¶
type Server struct { MCP *server.MCPServer `json:"-"` State *app.State `json:"-"` Resources Resources `json:"resources"` Prompts Prompts `json:"prompts"` Tools Tools `json:"tools"` HTTP http.Handler `json:"-"` }
func CurrentDefaultServer ¶ added in v1.7.13
func CurrentDefaultServer() *Server
func GetDefaultServer ¶ added in v1.7.12
func (*Server) AddPrompts ¶ added in v1.7.14
func (*Server) AddResources ¶ added in v1.7.14
type Tool ¶
type Tool struct { Name string `json:"name"` Description string `json:"description,omitempty"` Icon string `json:"icon,omitempty"` Args util.FieldDescs `json:"args,omitempty"` Fn ToolHandler `json:"-"` }
type ToolHandler ¶
Click to show internal directories.
Click to hide internal directories.