Documentation
¶
Index ¶
Constants ¶
View Source
const LoginRequiredMessage = "please run 'ivcap context login' in your terminal to continue"
LoginRequiredMessage is returned when an MCP tool invocation requires auth but no usable access token is available.
Variables ¶
View Source
var ErrLoginRequired = errors.New(LoginRequiredMessage)
ErrLoginRequired is a sentinel error used to signal that authentication is required.
Functions ¶
func NewLoginRequiredResult ¶ added in v0.47.5
func NewLoginRequiredResult() *mcpgo.CallToolResult
NewLoginRequiredResult creates a CallToolResult with isError=true for authentication failures. This returns a proper MCP tool result instead of a JSON-RPC error, providing a better user experience for AI agents.
Types ¶
type Config ¶
type Config struct {
Logger *log.Logger
// Version is reported to MCP clients as the server's version (serverInfo.version).
// The CLI should set this to match the ivcap-cli build version.
Version string
// ToolSchema is the schema URN prefix used when discovering tool aspects.
ToolSchema string
// TimeoutSec is used both for adapter construction and request timeouts.
TimeoutSec int
// ChunkSize is used by artifact uploads.
ChunkSize int64
// CreateAdapter must return an authenticated adapter.
CreateAdapter func(timeoutSec int) (*a.Adapter, error)
// WithLogging enables JSON-RPC request/response logging to a file.
WithLogging bool
// LogDir specifies the directory for MCP log files (defaults to /tmp).
LogDir string
}
Config provides CLI-owned dependencies and settings to the MCP server.
Note: the MCP server itself lives in pkg/ so it does not depend on cmd/. Any CLI-specific concerns (config files, flags, env var resolution) should be handled by cmd/ and injected here.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.