Skip to content

Ensure MCP server names are validated, improve detection of errors due to invalid MCP server names #110

Closed

Description

@ekolawole

Describe the bug

PS C:\Users\satem> copilot -p "hello world"
\× Model call failed: "400 400 Bad Request\n"

\× Model call failed: "400 400 Bad Request\n"

× Model call failed: "400 400 Bad Request\n"

× Model call failed: "400 400 Bad Request\n"

× Model call failed: "400 400 Bad Request\n"

× Model call failed: "400 400 Bad Request\n"

× Execution failed: Failed to get response from the AI model; retried 5 times (total retry wait 
   time: 90.0143845786254 seconds)

PS C:\Users\satem> 

Affected version

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

Additional context

No response

Activity

  1. added theissue type on Sep 28, 2025
  2. yanskun commented on Sep 29, 2025

    @yanskun

    I had the same problem, but updating to the latest version fixed it.

    npm install -g @github/copilot@latest
    

    Try running

  3. yanskun commented on Sep 29, 2025

    @yanskun

    I'm sorry.
    After communicating with copilot several times, the problem recurred,
    so it seems the above alone is not enough.

  4. kukirokuk commented on Oct 1, 2025

    @kukirokuk

    same stuff

  5. jazzbearz commented on Oct 1, 2025

    @jazzbearz

    For me, mcp name with a space caused the problem. Fixed by removing the space.

  6. ekolawole commented on Oct 1, 2025

    @ekolawole
    Author

    @jazzbearz you are God sent. Yes MCP names with space caused the problem. I fixed it and it worked. see below:

     Welcome to GitHub Copilot CLI
     Version 0.0.331 · Commit eb0ae04
    
     Copilot can write, test and debug code right from your terminal. Describe a
     task to get started or enter ? for help. Copilot uses AI, check for mistakes.
    
     Windows support is experimental. If you encounter issues, consider running
     Copilot inside Windows Subsystem for Linux (WSL). Please report any issues
     using /feedback.
    
     ● Logged in as user: ...
    
     ● Configured MCP servers: Chrome DevTools
    
     ● Connected to GitHub MCP Server
    
     ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
     │ > hello                                                                                                                                                                                                                                 │
     ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
     × Model call failed: "400 400 Bad Request\n"
    
     × Model call failed: "400 400 Bad Request\n"
    
     ● Operation cancelled by user
    
     ● MCP configuration saved successfully! Changes will take effect immediately.
    
     ● Configured MCP servers: ChromeDevTools
    
     ● Connected to GitHub MCP Server
    
     ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
     │ > hello                                                                                                                                                                                                                                 │
     ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
     ● Hello! 👋 I'm GitHub Copilot CLI,
  7. andyfeller commented on Oct 7, 2025

    @andyfeller
    Contributor

    @ekolawole @yanskun @kukirokuk @jazzbearz : first, thank you all for opening helping one another understand the problem and arriving at a workaround! 🫶 🙇

    Outside of improving the /mcp add and /mcp edit commands to validate server name doesn't contain spaces, I'm going to see if we can improve detecting errors raised being due to the server name in cases where people modify their MCP configuration.

  8. self-assigned this
    on Oct 8, 2025
  9. changed the title [-]Model call failed: "400 400 Bad Request\n"[/-] [+]Ensure MCP server names are validated, improve detection of errors due to invalid MCP server names[/+] on Oct 8, 2025
  10. yanskun commented on Oct 8, 2025

    @yanskun

    @andyfeller
    Thank you for letting us know that there seems to be a problem with the naming of the MCP Server.

    I'm not sure if this will help, but I thought I'd share.
    My MCP Server name didn't appear to have spaces.

    $ cat ~/.copilot/mcp-config.json
    
    {
      "mcpServers": {
        "deepwiki": {
          "type": "sse",
          "url": "https://mcp.deepwiki.com/sse"
        },
        "context7": {
          "type": "http",
          "url": "https://mcp.context7.com/mcp"
        },
        "serena": {
          "type": "stdio",
          "command": "uvx",
          "args": [
            "--from",
            "git+http://github.com/oraios/serena",
            "serena-mcp-server",
            "--context",
            "ide-assistant",
            "--project",
            "${PWD}"
          ],
          "env": {}
        },
        "sentry": {
          "type": "http",
          "url": "https://mcp.sentry.dev/mcp"
        },
        "notion": {
          "type": "http",
          "url": "https://mcp.notion.com/mcp"
        },
        "chrome-devtools": {
          "type": "stdio",
          "command": "npx",
          "args": ["chrome-devtools-mcp@latest"]
        }
      }
    }
    

    Also,
    after getting 400,
    you can exit the session,
    then use copilot --continue to open the same prompt and it will be successful.

  11. andyfeller commented on Oct 8, 2025

    @andyfeller
    Contributor

    I'm not sure if this will help, but I thought I'd share.
    My MCP Server name didn't appear to have spaces.

    That is verify interesting; thank you, @yanskun 🙇

    I'd be grateful for any help examining your local logs for any additional insights into errors or what else might have arose to indicate why it was failing if name only contained a-zA-Z0-9_-. Also, any request IDs you'd share. 🤔

  12. RyanHecht commented on Oct 8, 2025

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions