mcp

package
v0.0.0-...-16efc32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mcp provides an MCP (Model Context Protocol) server for grepai. This allows AI agents to use grepai as a native tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallEdgeCompact

type CallEdgeCompact struct {
	CallerName string `json:"caller_name"`
	CalleeName string `json:"callee_name"`
	File       string `json:"file"`
	Line       int    `json:"line"`
}

CallEdgeCompact is a compact version of trace.CallEdge for compact output.

type CallSiteCompact

type CallSiteCompact struct {
	File string `json:"file"`
	Line int    `json:"line"`
}

CallSiteCompact is a minimal struct for compact output (no context field).

type CalleeInfoCompact

type CalleeInfoCompact struct {
	Symbol   trace.Symbol    `json:"symbol"`
	CallSite CallSiteCompact `json:"call_site"`
}

CalleeInfoCompact is a compact version of trace.CalleeInfo for compact output.

type CallerInfoCompact

type CallerInfoCompact struct {
	Symbol   trace.Symbol    `json:"symbol"`
	CallSite CallSiteCompact `json:"call_site"`
}

CallerInfoCompact is a compact version of trace.CallerInfo for compact output.

type IndexStatus

type IndexStatus struct {
	TotalFiles   int    `json:"total_files"`
	TotalChunks  int    `json:"total_chunks"`
	IndexSize    string `json:"index_size"`
	LastUpdated  string `json:"last_updated"`
	Provider     string `json:"provider"`
	Model        string `json:"model"`
	SymbolsReady bool   `json:"symbols_ready"`
}

IndexStatus represents the current state of the index.

type SearchResult

type SearchResult struct {
	FilePath  string  `json:"file_path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Score     float32 `json:"score"`
	Content   string  `json:"content"`
}

SearchResult is a lightweight struct for MCP output.

type SearchResultCompact

type SearchResultCompact struct {
	FilePath  string  `json:"file_path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Score     float32 `json:"score"`
}

SearchResultCompact is a minimal struct for compact output (no content field).

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps the MCP server with grepai functionality.

func NewServer

func NewServer(projectRoot string) (*Server, error)

NewServer creates a new MCP server for grepai.

func (*Server) Serve

func (s *Server) Serve() error

Serve starts the MCP server using stdio transport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL