Skip to content

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

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

Activity

  1. added theissue type on Oct 23, 2025
  2. sergiou87 commented on Oct 24, 2025

    @sergiou87
    Member

    Thank you for your report! There seems to be a problem in Copilot CLI handling function tool calls with no arguments "arguments": "", I'll investigate 🕵️

  3. self-assigned this
    on Oct 24, 2025
  4. sergiou87 commented on Oct 24, 2025

    @sergiou87
    Member

    Good news! This was fixed yesterday in v0.0.350 🎉

  5. guigui42 commented on Oct 24, 2025

    @guigui42
    Author

    @sergiou87 confirmed, it works now. thanks a lot. you guys are shipping like crazy ;)

  6. hellcoderGIT commented on Nov 13, 2025

    @hellcoderGIT

    The issue reported in #390 appears to have been reintroduced or not fixed for for other cases in version 0.0.355 (0.0.351 was working fine). When calling MCP tools with no parameters, I get "Unexpected end of JSON
    input" error.

    Affected version

     - Version: 0.0.355
     - Commit: 90c0eb793
    

    MCP Server

     - SQL MCP Server (mssql-mcp) from https://github.com/Azure-Samples/SQL-AI-samples (https://github.com/Azure-Samples/SQL-AI-samples)
     - Tool: ListTables - a parameterless function
    

    Steps to reproduce

     - Configure mssql-mcp in ~/.copilot/mcp-config.json
     - Call DBMCP-ListTables (which takes no parameters)
     - Error: "Unexpected end of JSON input"
    
  7. passystems-tus commented on Nov 17, 2025

    @passystems-tus

    Same here: With claude ist everything running perfect, with the same configuration in copilot i got
    ... prüfe die projekte in plane
    ✗ get_projects
    Unexpected end of JSON input

    Version: 0.0.357

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