Phase 2: Client-Side MCP Infrastructure & Connection Testing #124
Labels
No labels
Epic 5
MCP
P1
PR-0
PR-1
api
api-layer
architecture
area:backend
area:frontend
arrow
authentication
backend
bug
chat
client
clipboard
common-module
compose
cross-cutting
cross-cutting-requirement
data-layer
data-models
database
desktop-client
documentation
duplicate
enhancement
epic
epic-1
epic-2
epic-3
epic-4
epic-5
epic-6
epic-7
epic-llm-config
error-handling
feature
frontend
good first issue
help wanted
implementation
infrastructure
installer
invalid
kotlin
ktor
llm
medium-priority
message
multiplatform
needs-review
needs-triage
packaging
performance
phase-1
phase-2
phase-3
phase-4
phase-5
phase3
phase:3
priority: high
question
refactor
refactoring
resource-sharing
security
server
server-module
services
session
session-management
settings
setup
shutdown
state
storage
streaming
sub-issue
tests
tooling
type:task
ui
ui/ux
user-accounts
user-management
ux
viewmodel
websocket
windows
windows-integration
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Torvian.eu/chatbot#124
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 2: Client-Side MCP Infrastructure & Connection Testing
Epic:
NF.EA1 - Local MCP ServersDescription
This issue covers the creation of the core client-side services responsible for managing the lifecycle of local MCP server processes and handling communication over the Model Context Protocol. The primary goal is to build the foundation for starting, stopping, and interacting with local servers, culminating in a user-facing "Test Connection" feature to validate a server's configuration.
User Stories & Acceptance Criteria
✅ Task Checklist
US2.1: Implement Local MCP Server Process Manager
LocalMCPServerProcessManagerservice responsible for low-level OS process management.expect/actual) for starting and stopping STDIO processes based on aLocalMCPServerconfiguration.stdin,stdout, andstderrstreams of the child process.US2.2: Implement Local MCP Server Manager (High-Level Orchestration)
LocalMCPServerManagerservice to act as the main entry point for MCP server operations.ProcessManager,MCPClientService,LocalMCPServerRepository).startServer,stopServer, andgetServerStatus.US2.3: Implement MCP Client Service (MCP Operations Layer)
MCPClientServicethat wraps the MCP SDK/library.testConnectionmethod that establishes an MCP connection over the I/O streams provided by theProcessManagerand performs a handshake or basic request to verify connectivity.discoverToolsmethod that uses the MCP connection to request the list of available tools from a server.US2.4: Implement Local MCP Server Connection Testing UI
LocalMCPServerManagerto start the server (if not running), execute thetestConnectionflow via theMCPClientService, and then stop the server.Architectural Context
This phase introduces three key client-side services with a clear separation of concerns:
LocalMCPServerProcessManager(Low-Level): This service is the platform-specific layer that knows how to interact with the operating system. Its only job is to start, stop, and monitor OS processes. It has no knowledge of the Model Context Protocol.MCPClientService(Mid-Level): This service is the protocol-specific layer. It understands how to speak MCP using the provided SDK. It takes I/O streams from theProcessManagerand uses them to perform MCP operations like discovery and testing. It has no knowledge of the application's overall state management.LocalMCPServerManager(High-Level): This is the application's orchestration layer. It ties everything together. It responds to UI events (like "Test Connection"), uses theLocalMCPServerRepositoryto get server configurations, tells theProcessManagerto start/stop processes, and invokes theMCPClientServiceto perform protocol operations. It is responsible for managing the state and lifecycle of the servers from the user's perspective.This layered approach ensures that platform-specific code, protocol-specific code, and application logic are cleanly separated, making the system easier to maintain and test.