Repository navigation
Description
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
-
Background Connection Process: MCP and LSP servers should connect in the background during initialization without displaying individual connection messages to the chat queue.
-
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
-
State Management: Track MCP and LSP connection status in the app state without cluttering the chat history.
Implementation Details
Required Changes
-
State Management (
source/hooks/useAppState.tsx):- Add
mcpConnectionStatusandlspConnectionStatusstate variables - Track total servers, connected count, error count for both MCP and LSP
- Add
-
Initialization Logic (
source/hooks/useAppInitialization.tsx):- Modify
initializeMCPServersandinitializeLSPServersfunctions 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
- Modify
-
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
-
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
- Cleaner UI: No startup messages cluttering the chat area
- Immediate Usability: Users can immediately start typing commands after the welcome message
- Organized Information: Connection status is properly categorized in the status section
- Consistent Experience: Diagnostic information is centralized and formatted consistently
- 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
will-lamerton commentedon Dec 3, 2025
This definitely needs fixing haha! Are you on this? :)
Avtrkrb commentedon Dec 3, 2025
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...