Phase 5: Server-Side API Routes for MCP Management #127
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#127
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 5: Server-Side API Routes for MCP Management
Epic:
NF.EA1 - Local MCP ServersDescription
This issue covers the implementation of the necessary server-side RESTful API endpoints for managing local MCP servers and their associated tools. These routes will serve as the bridge between the client-side application and the backend services and database tables created in Phase 1.
The primary responsibilities of this API are to provide unique, persistent IDs for new server configurations and to handle the synchronization of tool definitions discovered by the client.
User Stories & Acceptance Criteria
✅ Task Checklist
US5.1: Implement Local MCP Server API Routes
POST /api/v1/local-mcp-servers:LocalMCPServerService.generateServerId.serverIdto the client, which will then store it in its local database.DELETE /api/v1/local-mcp-servers/{serverId}:LocalMCPServerService.deleteServer.LocalMCPToolDefinitionTable).US5.2: Implement Local MCP Tool Management API Route
POST /api/v1/local-mcp-servers/{serverId}/tools/sync:List<ToolDefinition>).{serverId}.ToolService.synchronizeMcpTools) that performs the create, update, and delete logic to align the server's database with the list of tools provided by the client.Architectural Context
Stateless and Client-Driven: These API endpoints are designed to be stateless. The client is the source of truth for the full MCP server configuration and the list of available tools. The client uses these APIs to notify the server of changes and to obtain persistent identifiers.
ID Generation Workflow: The client will first create a full
LocalMCPServerconfiguration in its local database with a temporary ID. It will then callPOST /api/v1/local-mcp-serversto receive a permanent, server-generated ID, which it then updates in its local record. This decouples the client's local state from the server's persistence layer.Security: All endpoints defined in this phase must be protected and require user authentication. Every operation must include an ownership check to ensure a user can only access or modify their own resources (
LocalMCPServerrecords and their associated tools).Synchronization Endpoint: The
/syncendpoint is the cornerstone of tool management. By accepting a complete list of tools for a server, it simplifies the logic on both the client and server. The client doesn't need to track individual changes, and the server's logic is idempotent—it simply makes its state match the client's provided state.