Documentation
¶
Overview ¶
Unused symbols here are intentional: artifact_build is deliberately not registered (see the note at the end of this file). The code is kept so it can be re-enabled.
Index ¶
- Constants
- Variables
- func MapToRaw(m map[string]any) json.RawMessage
- func NewLoginRequiredResult() *mcpgo.CallToolResult
- func NewServer(cfg Config) *mcpserver.MCPServer
- func Register(t BuiltInTool)
- func ServeStdioWithLogging(s *server.MCPServer, logDir string) (string, error)
- type BuiltInTool
- type Config
- type GenomeImportArgs
- type GenomeImportFunc
- type GenomeListArgs
- type GenomeListFunc
- type JobWaitResult
- type ToolDefinition
Constants ¶
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 ¶
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.
func Register ¶ added in v0.50.1
func Register(t BuiltInTool)
Register adds a built-in tool. Registering the same name twice is a programming error.
Types ¶
type BuiltInTool ¶ added in v0.50.1
type BuiltInTool struct {
Tool mcp.Tool
Handler server.ToolHandlerFunc
// ReadOnly is true if the tool only reads: it never changes data on the platform.
ReadOnly bool
// Instruction is an optional line of server instructions that tells the model when to use the tool.
Instruction string
}
BuiltInTool describes a tool that the server always offers. The server derives everything else from these descriptors: the tools/list entries, their order, the session filter, the server instructions and the search index.
func GenomeImportTool ¶ added in v0.50.1
func GenomeImportTool(fn GenomeImportFunc) BuiltInTool
GenomeImportTool returns the genome_import tool. The CLI supplies fn, which runs the import.
func GenomeListTool ¶ added in v0.50.1
func GenomeListTool(fn GenomeListFunc) BuiltInTool
GenomeListTool returns the genome_list tool. The CLI supplies fn, which runs the listing.
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.
type GenomeImportArgs ¶ added in v0.50.1
type GenomeImportArgs struct {
Accession string `json:"accession"`
Include []string `json:"include,omitempty"`
Chromosomes []string `json:"chromosomes,omitempty"`
AssemblyVersion string `json:"assembly_version,omitempty"`
Name string `json:"name,omitempty"`
Policy string `json:"policy,omitempty"`
License string `json:"license,omitempty"`
}
GenomeImportArgs are the arguments of the genome_import tool.
type GenomeImportFunc ¶ added in v0.50.1
type GenomeImportFunc func(ctxt context.Context, adapter *a.Adapter, args GenomeImportArgs) (any, error)
GenomeImportFunc imports one NCBI genome into IVCAP and returns a JSON-serialisable result. Nothing may be written to stdout: in STDIO mode it carries the MCP protocol.
type GenomeListArgs ¶ added in v0.50.1
type GenomeListArgs struct {
Limit int `json:"limit,omitempty"`
Page string `json:"page,omitempty"`
}
GenomeListArgs are the arguments of the genome_list tool.
type GenomeListFunc ¶ added in v0.50.1
type GenomeListFunc func(ctxt context.Context, adapter *a.Adapter, args GenomeListArgs) (any, error)
GenomeListFunc lists the genomes imported into IVCAP and returns a JSON-serialisable result.
Source Files
¶
- artifact_build.go
- artifact_create.go
- artifact_get.go
- aspect_create.go
- aspect_get.go
- aspect_search.go
- config.go
- deps.go
- genome.go
- http_fetch.go
- job_status.go
- jsonutil.go
- logger.go
- nextflow.go
- registry.go
- server.go
- service_get.go
- service_list.go
- service_run.go
- skills.go
- skills_tools.go
- strings.go
- time.go
- unified_search.go
- verify_url.go