pub struct PathfinderServer { /* private fields */ }Expand description
The main Pathfinder MCP server.
Holds shared workspace state and dispatches MCP tool calls.
Implementations§
Source§impl PathfinderServer
impl PathfinderServer
Sourcepub async fn new(
workspace_root: WorkspaceRoot,
config: PathfinderConfig,
) -> Self
pub async fn new( workspace_root: WorkspaceRoot, config: PathfinderConfig, ) -> Self
Create a new Pathfinder server backed by the real Ripgrep scout, Tree-sitter
surgeon, and LspClient for LSP operations.
Zero-Config language detection (PRD §6.5) runs synchronously during construction. LSP processes are started lazily — only when the first LSP-dependent tool call is made for a given language.
If Zero-Config detection fails (e.g., unreadable workspace directory), the server
falls back to NoOpLawyer and logs a warning. All tools remain functional in
degraded mode.
Sourcepub fn with_engines(
workspace_root: WorkspaceRoot,
config: PathfinderConfig,
sandbox: Sandbox,
scout: Arc<dyn Scout>,
surgeon: Arc<dyn Surgeon>,
) -> Self
pub fn with_engines( workspace_root: WorkspaceRoot, config: PathfinderConfig, sandbox: Sandbox, scout: Arc<dyn Scout>, surgeon: Arc<dyn Surgeon>, ) -> Self
Create a server with injected Scout and Surgeon engines (for testing).
Uses a NoOpLawyer for LSP operations — keeps existing tests unchanged.
Sourcepub fn with_all_engines(
workspace_root: WorkspaceRoot,
_config: PathfinderConfig,
sandbox: Sandbox,
scout: Arc<dyn Scout>,
surgeon: Arc<dyn Surgeon>,
lawyer: Arc<dyn Lawyer>,
) -> Self
pub fn with_all_engines( workspace_root: WorkspaceRoot, _config: PathfinderConfig, sandbox: Sandbox, scout: Arc<dyn Scout>, surgeon: Arc<dyn Surgeon>, lawyer: Arc<dyn Lawyer>, ) -> Self
Create a server with all three engines injected (for testing with a MockLawyer).
Source§impl PathfinderServer
impl PathfinderServer
Sourcepub fn search_codebase_tool_attr() -> Tool
pub fn search_codebase_tool_attr() -> Tool
Generated tool metadata function for search_codebase
Sourcepub fn get_repo_map_tool_attr() -> Tool
pub fn get_repo_map_tool_attr() -> Tool
Generated tool metadata function for get_repo_map
Sourcepub fn read_symbol_scope_tool_attr() -> Tool
pub fn read_symbol_scope_tool_attr() -> Tool
Generated tool metadata function for read_symbol_scope
Sourcepub fn read_source_file_tool_attr() -> Tool
pub fn read_source_file_tool_attr() -> Tool
Generated tool metadata function for read_source_file
Sourcepub fn replace_batch_tool_attr() -> Tool
pub fn replace_batch_tool_attr() -> Tool
Generated tool metadata function for replace_batch
Sourcepub fn read_with_deep_context_tool_attr() -> Tool
pub fn read_with_deep_context_tool_attr() -> Tool
Generated tool metadata function for read_with_deep_context
Sourcepub fn get_definition_tool_attr() -> Tool
pub fn get_definition_tool_attr() -> Tool
Generated tool metadata function for get_definition
Sourcepub fn analyze_impact_tool_attr() -> Tool
pub fn analyze_impact_tool_attr() -> Tool
Generated tool metadata function for analyze_impact
Sourcepub fn lsp_health_tool_attr() -> Tool
pub fn lsp_health_tool_attr() -> Tool
Generated tool metadata function for lsp_health
Sourcepub fn replace_body_tool_attr() -> Tool
pub fn replace_body_tool_attr() -> Tool
Generated tool metadata function for replace_body
Sourcepub fn replace_full_tool_attr() -> Tool
pub fn replace_full_tool_attr() -> Tool
Generated tool metadata function for replace_full
Sourcepub fn insert_before_tool_attr() -> Tool
pub fn insert_before_tool_attr() -> Tool
Generated tool metadata function for insert_before
Sourcepub fn insert_after_tool_attr() -> Tool
pub fn insert_after_tool_attr() -> Tool
Generated tool metadata function for insert_after
Sourcepub fn insert_into_tool_attr() -> Tool
pub fn insert_into_tool_attr() -> Tool
Generated tool metadata function for insert_into
Sourcepub fn delete_symbol_tool_attr() -> Tool
pub fn delete_symbol_tool_attr() -> Tool
Generated tool metadata function for delete_symbol
Sourcepub fn validate_only_tool_attr() -> Tool
pub fn validate_only_tool_attr() -> Tool
Generated tool metadata function for validate_only
Sourcepub fn create_file_tool_attr() -> Tool
pub fn create_file_tool_attr() -> Tool
Generated tool metadata function for create_file
Sourcepub fn delete_file_tool_attr() -> Tool
pub fn delete_file_tool_attr() -> Tool
Generated tool metadata function for delete_file
Sourcepub fn read_file_tool_attr() -> Tool
pub fn read_file_tool_attr() -> Tool
Generated tool metadata function for read_file
Sourcepub fn write_file_tool_attr() -> Tool
pub fn write_file_tool_attr() -> Tool
Generated tool metadata function for write_file
Trait Implementations§
Source§impl Clone for PathfinderServer
impl Clone for PathfinderServer
Source§fn clone(&self) -> PathfinderServer
fn clone(&self) -> PathfinderServer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ServerHandler for PathfinderServer
impl ServerHandler for PathfinderServer
fn get_info(&self) -> ServerInfo
async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResult, ErrorData>
async fn list_tools( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, ErrorData>
fn enqueue_task( &self, _request: CallToolRequestParams, _context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CreateTaskResult, ErrorData>> + Send
fn ping( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send
fn initialize( &self, request: InitializeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<InitializeResult, ErrorData>> + Send
fn complete( &self, request: CompleteRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CompleteResult, ErrorData>> + Send
fn set_level( &self, request: SetLevelRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send
fn get_prompt( &self, request: GetPromptRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetPromptResult, ErrorData>> + Send
fn list_prompts( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListPromptsResult, ErrorData>> + Send
fn list_resources( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + Send
fn list_resource_templates( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + Send
fn read_resource( &self, request: ReadResourceRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ReadResourceResult, ErrorData>> + Send
fn subscribe( &self, request: SubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send
fn unsubscribe( &self, request: UnsubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send
fn on_custom_request( &self, request: CustomRequest, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CustomResult, ErrorData>> + Send
fn on_cancelled( &self, notification: CancelledNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send
fn on_progress( &self, notification: ProgressNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send
fn on_initialized( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send
fn on_roots_list_changed( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send
fn on_custom_notification( &self, notification: CustomNotification, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send
fn list_tasks( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListTasksResult, ErrorData>> + Send
fn get_task_info( &self, request: GetTaskInfoParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + Send
fn get_task_result( &self, request: GetTaskResultParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetTaskPayloadResult, ErrorData>> + Send
fn cancel_task( &self, request: CancelTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CancelTaskResult, ErrorData>> + Send
Auto Trait Implementations§
impl Freeze for PathfinderServer
impl !RefUnwindSafe for PathfinderServer
impl Send for PathfinderServer
impl Sync for PathfinderServer
impl Unpin for PathfinderServer
impl UnsafeUnpin for PathfinderServer
impl !UnwindSafe for PathfinderServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>
fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>
fn get_info(&self) -> <R as ServiceRole>::Info
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more