mcpserver

package
v0.0.0-...-0ff359d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeWorkspaceParams

type AnalyzeWorkspaceParams struct {
	// WorkspacePath is the path to the workspace/repository to analyze
	WorkspacePath string `json:"workspacePath,omitempty"`
	// WorkspaceName is the name to use for this workspace
	WorkspaceName string `json:"workspaceName,omitempty"`
	// Incremental determines if this is an incremental analysis
	Incremental bool `json:"incremental,omitempty"`
	// AllowedPackages is a list of external packages to include in analysis
	AllowedPackages []string `json:"allowedPackages,omitempty"`
}

AnalyzeWorkspaceParams represents the parameters for workspace analysis

type ArchitectureAnalysisParams

type ArchitectureAnalysisParams struct {
	// AnalysisType specifies the type of architecture analysis to perform
	AnalysisType string `json:"analysisType"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

ArchitectureAnalysisParams represents the parameters for architecture analysis

type CypherQueryParams

type CypherQueryParams struct {
	// Query is the Cypher query to execute against the code graph
	Query string `json:"query"`
	// Parameters are optional query parameters for parameterized queries
	Parameters map[string]any `json:"parameters,omitempty"`
	// Explain returns the query execution plan instead of results
	Explain bool `json:"explain,omitempty"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

CypherQueryParams represents the parameters for a Cypher query

type ExistingNodeInfo

type ExistingNodeInfo struct {
	ID             string
	SemanticHash   string
	Embedding      []float64
	EmbeddingModel string
}

ExistingNodeInfo stores minimal information about existing nodes for incremental updates

type FindImplementersParams

type FindImplementersParams struct {
	// InterfaceName is the full name of the interface (e.g., "io.Writer")
	InterfaceName string `json:"interfaceName"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

FindImplementersParams represents the parameters for finding implementers of an interface

type ImpactAnalysisParams

type ImpactAnalysisParams struct {
	// NodeID is the node identifier to analyze (e.g., function:pkg.FunctionName)
	NodeID string `json:"nodeId"`
	// ChangeType specifies the type of change: signature, delete, modify
	ChangeType string `json:"changeType,omitempty"`
	// MaxDepth is the maximum depth for impact analysis
	MaxDepth int `json:"maxDepth,omitempty"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

ImpactAnalysisParams represents the parameters for impact analysis

type ImportStats

type ImportStats struct {
	Created int
	Updated int
}

ImportStats tracks statistics for the import process

type ListWorkspacesParams

type ListWorkspacesParams struct{}

ListWorkspacesParams represents parameters for listing workspaces

type NaturalQueryParams

type NaturalQueryParams struct {
	// Question is the natural language question about the codebase
	Question string `json:"question"`
	// Context provides additional context for better query generation
	Context string `json:"context,omitempty"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

NaturalQueryParams represents the parameters for a natural language query

type PatternDetectionParams

type PatternDetectionParams struct {
	// PatternType specifies the type of pattern: duplicate, similar, antipattern, usage
	PatternType string `json:"patternType"`
	// Filter provides additional filters for pattern matching
	Filter map[string]any `json:"filter,omitempty"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

PatternDetectionParams represents the parameters for pattern detection

type Server

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

Server represents the Code Graph MCP server

func NewServer

func NewServer(neo4jDriver neo4j.DriverWithContext, embeddingsGenerator *analyzer.EmbeddingsGenerator, logger *slog.Logger) (*Server, error)

NewServer creates a new Code Graph MCP server with provided clients

func (*Server) Close

func (s *Server) Close()

Close closes the server and Neo4j connection

func (*Server) HandleAnalyzeImpact

func (s *Server) HandleAnalyzeImpact(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[ImpactAnalysisParams]) (*mcp.CallToolResultFor[any], error)

HandleAnalyzeImpact is a public wrapper for the impact analysis handler (testing only)

func (*Server) HandleArchitectureAnalysis

func (s *Server) HandleArchitectureAnalysis(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[ArchitectureAnalysisParams]) (*mcp.CallToolResultFor[any], error)

HandleArchitectureAnalysis is a public wrapper for the architecture analysis handler (testing only)

func (*Server) HandleCypherQuery

func (s *Server) HandleCypherQuery(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[CypherQueryParams]) (*mcp.CallToolResultFor[any], error)

HandleCypherQuery is a public wrapper for the cypher query handler (testing only)

func (*Server) HandleFindImplementers

func (s *Server) HandleFindImplementers(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[FindImplementersParams]) (*mcp.CallToolResultFor[any], error)

HandleFindImplementers is a public wrapper for the find implementers handler (testing only)

func (*Server) HandleNaturalQuery

func (s *Server) HandleNaturalQuery(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[NaturalQueryParams]) (*mcp.CallToolResultFor[any], error)

HandleNaturalQuery is a public wrapper for the natural query handler (testing only)

func (*Server) HandlePatternDetection

func (s *Server) HandlePatternDetection(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[PatternDetectionParams]) (*mcp.CallToolResultFor[any], error)

HandlePatternDetection is a public wrapper for the pattern detection handler (testing only)

func (*Server) HandleTraceCallPath

func (s *Server) HandleTraceCallPath(ctx context.Context, session *mcp.ServerSession, params *mcp.CallToolParamsFor[TraceCallPathParams]) (*mcp.CallToolResultFor[any], error)

HandleTraceCallPath is a public wrapper for the trace call path handler (testing only)

func (*Server) Run

func (s *Server) Run(ctx context.Context, transport mcp.Transport) error

Run starts the MCP server with the given transport

type TraceCallPathParams

type TraceCallPathParams struct {
	// From is the full name of the starting function/method
	From string `json:"from"`
	// To is the full name of the ending function/method
	To string `json:"to"`
	// Workspace is the workspace to query (required)
	Workspace string `json:"workspace"`
}

TraceCallPathParams represents the parameters for tracing a call path

Jump to

Keyboard shortcuts

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