Documentation
¶
Overview ¶
Package mcptracker is the mcp tracker provider (ADR-003): a tracker whose system has an MCP server, such as JIRA Cloud or Data Center, read and written by calling the server's tools directly. No model is involved, so what it reads is as deterministic as a REST call, and it calls with ynf's own credentials, never the agent's.
Index ¶
- type Call
- type Config
- type Tracker
- func (t *Tracker) Check(ctx context.Context) error
- func (t *Tracker) Close() error
- func (t *Tracker) Comment(ctx context.Context, key, marker, body string) error
- func (t *Tracker) Get(ctx context.Context, key string) (facts.Ticket, tracker.Text, error)
- func (t *Tracker) Host() string
- func (t *Tracker) Label(ctx context.Context, key string, add, remove []string) error
- func (t *Tracker) WithTransport(dial func() mcp.Transport) *Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
Call is a tool and its arguments. In arguments, a string that is exactly {add}, {remove} or {labels} becomes that list; {key} and {text} are replaced inside any string.
type Config ¶
type Config struct {
Provider string `json:"provider"`
// Site is the tracker's web address; its host names the tracker in item keys.
Site string `json:"site"`
Server struct {
// Command starts a server that speaks MCP on stdin and stdout; it receives only the
// variables named in Env, and PATH and HOME.
Command []string `json:"command"`
Env []string `json:"env"`
// URL is a server reached over HTTP; TokenEnv names the variable holding its bearer token.
URL string `json:"url"`
TokenEnv string `json:"token_env"`
} `json:"server"`
Get Call `json:"get"`
Comment Call `json:"comment"`
Label Call `json:"label"`
// Fields are CEL over the get tool's result, bound to result: title, body, labels (a list of
// strings), status, repo, the repository the ticket says its code goes to, if any, and
// comments, the text of each of the ticket's comments, if mapped: it is how a retried step
// finds the marker of a comment already posted.
Fields struct {
Title string `json:"title"`
Body string `json:"body"`
Labels string `json:"labels"`
Status string `json:"status"`
Repo string `json:"repo"`
Comments string `json:"comments"`
} `json:"fields"`
// ClosedWhen is CEL over status and labels; true means the ticket is closed.
ClosedWhen string `json:"closed_when"`
}
Config is an mcp tracker as factory.yaml declares it.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is an mcp tracker. It connects on first use and keeps the session.
func New ¶
New builds the tracker, compiling its mappings so a mistake shows when the factory is read.
func (*Tracker) Check ¶
Check connects to the tracker's server and confirms it has every tool the tracker is configured to call, so a mistyped tool name shows before any ticket is started.
func (*Tracker) Comment ¶
Comment implements tracker.Tracker. The marker goes in the comment. With fields.comments mapped, the comment is posted only if no existing one contains the marker, so a retried step does not comment twice; without it there is no way to know, and it is always posted.