Documentation
¶
Overview ¶
Package mcp serves the codesearch tools over MCP via stdio.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(cfg *config.IndexConfig) error
Serve runs the codesearch MCP server on stdio until EOF.
The index is opened lazily on the first tool call and released after an idle window (see index.LazyIndex). This is what lets a concurrent `codesearch sync` (e.g. from a git hook) acquire the writer lock between bursts of MCP traffic — the server doesn't hoard the OS file lock when no tool calls are in flight.
cfg.Root and cfg.IndexPath() must already exist (run `codesearch init && codesearch sync` first).
Types ¶
type FacetResult ¶
FacetResult is one term entry returned by codesearch_facets.
type FacetsArgs ¶
FacetsArgs is the typed input for codesearch_facets.
type GetResult ¶
type GetResult struct {
Path string `json:"path"`
Content string `json:"content"`
Truncated bool `json:"truncated"`
}
GetResult is the response from codesearch_get.
type SearchArgs ¶
type SearchArgs struct {
Query string `json:"query"`
Fields map[string]string `json:"fields,omitempty"`
Limit int `json:"limit,omitempty"`
}
SearchArgs is the typed input for codesearch_search.
type StatusResult ¶
type StatusResult struct {
IndexPath string `json:"index_path"`
DocCount uint64 `json:"doc_count"`
IndexSizeBytes int64 `json:"index_size_bytes"`
SchemaVersion int `json:"schema_version"`
LastSyncAt string `json:"last_sync_at"`
}
StatusResult is the response from codesearch_status.