Documentation
¶
Overview ¶
Package mcpdocs writes a Markdown reference of an MCP server — its tools, prompts, resources and instructions — from what the server sends over the protocol, so it works for any server regardless of language and SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstDifference ¶
FirstDifference compares a written reference with a freshly rendered one and returns the first line that differs, or 0 if they match. Line endings are ignored, so a checkout with CRLF still matches.
func Render ¶
Render writes the reference. The text holds no date or version, so it changes only when what the server offers changes — which keeps --check meaningful.
func UndescribedParams ¶
UndescribedParams names the input parameters of a tool's inputSchema that have no description, as "tool.param". The model can only guess what they are for.
Types ¶
type Prompt ¶
type Prompt struct {
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
Arguments []struct {
Name string `json:"name"`
Description string `json:"description"`
Required bool `json:"required"`
} `json:"arguments"`
}
Prompt is a prompt as listed by prompts/list.
type Resource ¶
type Resource struct {
URI string `json:"uri"`
URITemplate string `json:"uriTemplate"`
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
MIMEType string `json:"mimeType"`
}
Resource is a resource or a resource template.
type Server ¶
type Server struct {
Name string
Instructions string
Tools []Tool
Prompts []Prompt
Resources []Resource
Templates []Resource
// Whether the server declares the capability; a section is written only then
HasTools, HasPrompts, HasResources bool
}
Server is what the reference is written from.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
OutputSchema json.RawMessage `json:"outputSchema"`
Annotations *struct {
Title string `json:"title"`
ReadOnlyHint *bool `json:"readOnlyHint"`
DestructiveHint *bool `json:"destructiveHint"`
IdempotentHint *bool `json:"idempotentHint"`
OpenWorldHint *bool `json:"openWorldHint"`
} `json:"annotations"`
}
Tool is a tool as listed by tools/list; the schemas stay raw so their properties keep the server's order.