Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT Package mcpserver exposes the commit-query capability as an MCP tool over a stdio transport, so an LLM agent can ask for an author's recent commits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadOnlyTools ¶
func ReadOnlyTools() []string
ReadOnlyTools lists the names of tools whose ReadOnlyHint is true. It is the single source of truth for which tools an installer may safely auto-approve, so the install permissions snippet cannot drift from what the server marks read-only. Every tool sting exposes is read-only by design.
The list is derived from toolDefinitions rather than maintained by hand: with more than one tool, two hand-synchronized lists would fail silently, which is exactly what Principle I forbids.
Types ¶
type GetCommitsInput ¶
type GetCommitsInput struct {
Provider string `json:"provider,omitempty" jsonschema:"source control provider: github (default) or gitlab"`
Author string `json:"author" jsonschema:"provider username or author string whose commits to retrieve"`
Since string `json:"since,omitempty" jsonschema:"start of window, RFC3339 or YYYY-MM-DD; if omitted, window is used"`
Until string `json:"until,omitempty" jsonschema:"end of window, RFC3339 or YYYY-MM-DD; defaults to now"`
Window string `json:"window,omitempty" jsonschema:"look-back window when since is omitted, e.g. 7d, 2w, 48h; defaults to the server default"`
Scope string `` /* 220-byte string literal not displayed */
Repos []string `` /* 164-byte string literal not displayed */
Org string `` /* 177-byte string literal not displayed */
IncludeStats *bool `` /* 145-byte string literal not displayed */
IncludeFiles *bool `json:"include_files,omitempty" jsonschema:"fetch per-file change summaries; uses extra commit-detail API calls"`
IncludeDiffs *bool `` /* 169-byte string literal not displayed */
MaxDiffBytes int `json:"max_diff_bytes,omitempty" jsonschema:"per-commit patch byte cap when include_diffs is true; defaults to server config"`
MaxCommits *int `` /* 150-byte string literal not displayed */
MaxRequests *int `` /* 161-byte string literal not displayed */
IncludePRs *bool `` /* 223-byte string literal not displayed */
}
GetCommitsInput is the argument schema for the get_commits tool. The jsonschema descriptions are surfaced to the calling agent.
The Include* flags are *bool (rather than bool) so that an explicit "false" from the client is distinguishable from an omitted field. Most omitted flags inherit server config; IncludeDiffs is the deliberate exception and defaults to false for MCP calls because of its API and output cost.
type GetRepoActivityInput ¶ added in v1.1.0
type GetRepoActivityInput struct {
Repo string `json:"repo" jsonschema:"repository as owner/name; required"`
Ref string `json:"ref,omitempty" jsonschema:"branch or tag to examine; defaults to the repository's default branch"`
Since string `json:"since,omitempty" jsonschema:"start of window, RFC3339 or YYYY-MM-DD; if omitted, window is used"`
Until string `json:"until,omitempty" jsonschema:"end of window, RFC3339 or YYYY-MM-DD; defaults to now"`
Window string `json:"window,omitempty" jsonschema:"look-back window when since is omitted, e.g. 7d, 2w, 48h; defaults to the server default"`
Author string `` /* 136-byte string literal not displayed */
IncludeDiffs *bool `json:"include_diffs,omitempty" jsonschema:"opt in to bounded patch text in the change set; defaults to false"`
MaxDiffBytes int `json:"max_diff_bytes,omitempty" jsonschema:"patch byte cap when include_diffs is true; defaults to server config"`
EnrichCommits *int `` /* 205-byte string literal not displayed */
MaxRequests *int `` /* 161-byte string literal not displayed */
EstimateOnly bool `json:"estimate_only,omitempty" jsonschema:"report projected cost and remaining quota without gathering evidence"`
}
GetRepoActivityInput is the argument schema for the get_repo_activity tool.
Provider is deliberately absent: the tool is GitHub-only, and offering a parameter whose only other value is an error would mislead the agent.
The *bool / *int pointer convention matches GetCommitsInput — it distinguishes an explicit false/0 from an omitted field, which matters for max_requests where 0 means "uncapped" rather than "unset".