Skip to content

[Enhancement] Settings UI for MCP configuration #55

@Wan-ZL

Description

@Wan-ZL

Description

Add a user-friendly Settings UI for configuring MCP (Model Context Protocol) servers. Currently, MCP can only be configured via API or CLI.

Current State

MCP functionality is fully working (verified in #51), but lacks a UI. Users must use:

# Enable MCP via API
curl -X PUT http://localhost:8080/api/settings -d '{"mcp_enabled": true}'

# Add server via API
curl -X POST http://localhost:8080/api/mcp/servers \
  -d '{
    "name": "filesystem",
    "transport": "stdio",
    "command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/path"],
    "env": {}
  }'

Desired State

Add MCP configuration section to Settings page (settings.html):

  1. Enable/Disable MCP: Toggle switch for mcp_enabled
  2. MCP Servers List: Display configured servers with status
    • Server name
    • Transport type (stdio/sse)
    • Connection status (connected/disconnected)
    • Tool count
  3. Add Server Form:
    • Name (text input)
    • Transport type (dropdown: stdio, sse)
    • Command (array input for stdio)
    • URL (text input for sse)
    • Environment variables (key-value pairs)
  4. Actions: Connect, Disconnect, Remove server buttons

Acceptance Criteria

  • Settings page has "MCP Configuration" section
  • Toggle to enable/disable MCP
  • List of configured MCP servers with status
  • "Add Server" button opens form modal
  • Form validates transport-specific requirements (command for stdio, URL for sse)
  • Connect/Disconnect buttons work and update status in real-time
  • Remove server button with confirmation dialog
  • All changes persist to database
  • UI updates when MCP manager connects/disconnects servers

UI Mockup

┌─────────────────────────────────────┐
│ MCP Configuration                   │
├─────────────────────────────────────┤
│ [x] Enable MCP Support              │
│                                     │
│ Configured Servers:                 │
│ ┌─────────────────────────────────┐ │
│ │ filesystem (stdio)              │ │
│ │ Status: Connected | Tools: 5    │ │
│ │ [Disconnect] [Remove]           │ │
│ └─────────────────────────────────┘ │
│                                     │
│ [+ Add MCP Server]                  │
└─────────────────────────────────────┘

Technical Notes

  • Reuse existing settings UI patterns from static/settings.html
  • API endpoints already exist:
    • GET /api/mcp/servers
    • POST /api/mcp/servers
    • DELETE /api/mcp/servers/{name}
    • POST /api/mcp/servers/{name}/connect
    • POST /api/mcp/servers/{name}/disconnect
  • No backend changes needed, pure frontend work

Priority Rationale

LOW: MCP is fully functional without UI. This is a UX enhancement for users who prefer GUI over CLI/API.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions