Skip to content

Move MCP and LSP connection status to background initialization with summarized status display #120

Description

@Avtrkrb

Currently, when Nanocoder starts up, it displays verbose connection messages for each MCP server and LSP connection in the main chat area:

User preferences loaded...

Loaded 4 custom commands from .nanocoder/commands...

Connecting to 9 MCP servers...

Connected to MCP server "duckduckgo" with 2 tools

Connected to MCP server "context7" with 2 tools

Connected to MCP server "fetch" with 1 tools

Connected to MCP server "gitlab" with 77 tools

Connected to MCP server "chrome-devtools" with 26 tools

Connected to MCP server "playwright" with 22 tools

Connected to MCP server "github" with 40 tools

Connected to MCP server "sequential-thinking" with 1 tools

Connected to MCP server "deepwiki" with 3 tools

LSP: Connected to "rust-analyzer"

LSP: Connected to "clangd"

LSP: Connected to "typescript-language-server"

LSP: Connected to "gopls"

LSP: Connected to "pyright"

LSP: Connected to "vscode-json-languageserver"

LSP: Connected to "lua-language-server"

LSP: Connected to "vscode-css-languageserver"

LSP: Connected to "bash-language-server"

LSP: Connected to "yaml-language-server"

LSP: Connected to "vscode-html-languageserver"

LSP: 11 language servers ready

This behavior has several drawbacks:

  • The startup messages occupy valuable chat space
  • Users cannot immediately start typing/interacting with the application
  • The verbose output clutters the conversation area
  • Connection status is mixed with chat messages

Proposed Solution

  1. Background Connection Process: MCP and LSP servers should connect in the background during initialization without displaying individual connection messages to the chat queue.

  2. Status Summary Display: Add summarized connection status to the existing "Status" section, positioned below the "Theme" section as requested. The format should be:

    • MCP: X servers connected, Y errors
    • LSP: X servers ready, Y errors
  3. State Management: Track MCP and LSP connection status in the app state without cluttering the chat history.

Implementation Details

Required Changes

  1. State Management (source/hooks/useAppState.tsx):

    • Add mcpConnectionStatus and lspConnectionStatus state variables
    • Track total servers, connected count, error count for both MCP and LSP
  2. Initialization Logic (source/hooks/useAppInitialization.tsx):

    • Modify initializeMCPServers and initializeLSPServers functions to update state instead of adding messages to chat queue
    • Maintain connection results in component state for status display
    • Return summary objects instead of logging individual messages
  3. Status Component (source/components/status.tsx):

    • Add MCP and LSP status display below existing information
    • Format as "MCP: 9 servers connected, 0 errors" and "LSP: 11 servers ready, 0 errors"
    • Handle error cases appropriately
  4. App Component (source/app.tsx):

    • Pass MCP and LSP status information to the Status component
    • Ensure state synchronization between initialization and status display

Example New Behavior

Instead of the verbose startup messages, the status section would show:

┌───────────────────────────────────────── Status ───────────────────────────────────────┐
│ CWD: /home/user/project                                                                |                               │                                                                                        |
│ Config: /home/user/project/.nanocoder/agents.config.json                               |                                │                                                                                        |
│ Provider: openai, Model: gpt-4o                                                        |                                │                                                                                        |
│ Theme: default                                                                         |                               │                                                                                        |
│ MCP: 9 servers connected, 0 errors                                                     |                                │                                                                                        |
│ LSP: 11 servers ready, 0 errors                                                        |                               │                                                                                        |
│ ↳ Using AGENTS.md. Project initialized                                                 |                                │                                                                                        |
└────────────────────────────────────────────────────────────────────────────────────────┘

Note: Nanocoder already provides /mcp and /lsp commands that show detailed status of the MCP and LSP servers respectively. This enhancement would complement these commands by providing a summary in the status section.

Benefits

  1. Cleaner UI: No startup messages cluttering the chat area
  2. Immediate Usability: Users can immediately start typing commands after the welcome message
  3. Organized Information: Connection status is properly categorized in the status section
  4. Consistent Experience: Diagnostic information is centralized and formatted consistently
  5. Better Performance: Reduced DOM updates during initialization

Technical Considerations

  • Maintain error reporting capability for connection failures
  • Ensure status is updated accurately even during connection failures
  • Preserve the ability to diagnose connection issues through the status display
  • Handle the case where no MCP/LSP servers are configured

This enhancement would significantly improve the user experience by providing a cleaner startup experience while maintaining visibility of the connection status in an appropriate location.

Activity

  1. added
    enhancement
    on Dec 3, 2025
  2. added theissue type on Dec 3, 2025
  3. self-assigned this
    on Dec 3, 2025
  4. will-lamerton commented on Dec 3, 2025

    @will-lamerton
    Member

    This definitely needs fixing haha! Are you on this? :)

  5. Avtrkrb commented on Dec 3, 2025

    @Avtrkrb
    MemberAuthor

    This definitely needs fixing haha! Are you on this? :)

    Yes I am, I'm almost done, will be raising a PR in the next couple of hours as soon as I'm done with the tests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions