Skip to content

MCP : Execution failed: Unexpected end of JSON input #390

@guigui42

Description

@guigui42

Describe the bug

I wrote an MCP server (written using github.com/modelcontextprotocol/go-sdk ) and configured it for Copilot CLI this way :

{
  "mcpServers": {
"vosdroits": {
      "type": "local",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/guigui42/mcp-vosdroits:latest"
      ],
      "tools": [
        "*"
      ]
    }
  }
}

When I ask copilot "je dois acheter une maison, que dois je faire ?" that should trigger the "list_life_events" tool from the MCP, but I get this error

Execution failed: Unexpected end of JSON input

Image
2025-10-23T18:48:17.043Z [DEBUG] InitiatorHeaderProcessor: Setting X-Initiator to 'user'
2025-10-23T18:48:17.043Z [START-GROUP] Sending request to the AI model
2025-10-23T18:48:18.675Z [INFO] [log_19731e, x-request-id: "00000-31e76f6c-6adc-4a72-822a-35033713aaf4"] post https://api.enterprise.githubcopilot.com/chat/completions succeeded with status 200 in 1630ms

2025-10-23T18:48:18.678Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:18.889Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:18.901Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.024Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.054Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.080Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.085Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.255Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.256Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.278Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.428Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.452Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:19.459Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:20.026Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:20.037Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:20.145Z [DEBUG] StreamingChunkDisplay received chunk.
2025-10-23T18:48:20.170Z [DEBUG] response (Request-ID 00000-31e76f6c-6adc-4a72-822a-35033713aaf4):
2025-10-23T18:48:20.170Z [DEBUG] data:
2025-10-23T18:48:20.171Z [DEBUG] {
  "usage": {
    "completion_tokens": 71,
    "prompt_tokens": 21498,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "total_tokens": 21569
  },
  "id": "msg_vrtx_017giE1d8xoTvJH9UGnHnsng",
  "choices": [
    {
      "index": 0,
      "finish_reason": "tool_calls",
      "logprobs": null,
      "message": {
        "role": "assistant",
        "content": "Je vais vous aider à trouver les informations sur les démarches pour acheter une maison en France.",
        "refusal": null,
        "tool_calls": [
          {
            "id": "toolu_vrtx_011QhtN6Dqnnz4AJ9ZM3u633",
            "type": "function",
            "function": {
              "name": "vosdroits-list_life_events",
              "arguments": ""
            }
          }
        ],
        "parsed": null
      }
    }
  ],
 "created": 1761245300,
  "model": "claude-sonnet-4.5",
  "object": "chat.completion"
}
2025-10-23T18:48:20.171Z [END-GROUP]
2025-10-23T18:48:20.172Z [DEBUG] Command threw error: Unexpected end of JSON input
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at W9 (file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:1830:1484)
    at file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:2417:19399
    at Array.map (<anonymous>)
    at Object.onMessage (file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:2417:19340)
    at fBt (file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:1948:3057)
    at wPn (file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:2417:19114)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Jul (file:///Users/guigui42/.nvm/versions/node/v23.5.0/lib/node_modules/@github/copilot/index.js:2417:16739)

The same MCP server works fine in Claude Desktop

Image

Works in VS Code as well

Image

Affected version

0.0.349 Commit: 3469b3e

Steps to reproduce the behavior

No response

Expected behavior

it should use the tool as expected and not fail with this error

Additional context

macOS
and was able to reproduce on Linux Mint

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions