[BUG] Bug: HTTP MCP server array parameters are serialized as strings instead of arrays
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Description
When calling tools on an HTTP-type MCP server, array parameters are
sent as JSON strings instead of JSON arrays, causing validation errors.
Environment
- Claude Code version: 2.1.71
- OS: macOS
- MCP server type: HTTP (
https://ai.todoist.net/mcp)
Steps to Reproduce
- Configure an HTTP MCP server in
.claude.json:
{
"mcpServers": {
"todoist": {
"type": "http",
"url": "https://ai.todoist.net/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}
### What Should Happen?
Array parameters should be sent to HTTP MCP servers as proper JSON arrays, not as JSON strings.
Expected request body:
{"tasks": [{"id": "xxx", "content": "yyy"}]}
Currently sent as:
{"tasks": "[{\"id\": \"xxx\", \"content\": \"yyy\"}]"}
### Error Messages/Logs
```shell
Attempting to call update-tasks tool on Todoist HTTP MCP server
(https://ai.todoist.net/mcp) resulted in the following error:
MCP error -32602: Input validation error: Invalid arguments for tool update-tasks: [
{
"expected": "array",
"code": "invalid_type",
"path": ["tasks"],
"message": "Invalid input: expected array, received string"
}
]
The same error occurs with all write tools that require array parameters:
- add-tasks (parameter: "tasks")
- update-tasks (parameter: "tasks")
- complete-tasks (parameter: "ids")
- add-comments (parameter: "comments")
Steps to Reproduce
- Configure an HTTP MCP server in
.claude.json:
{
"mcpServers": {
"todoist": {
"type": "http",
"url": "https://ai.todoist.net/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}
- Ask Claude Code to update a task using the update-tasks tool:
"Please update task ID 'xxx' with content 'yyy'"
- Claude Code calls the update-tasks tool with the following parameter:
tasks = [{"id": "xxx", "content": "yyy"}]
- MCP server returns validation error:
"expected array, received string"
- For comparison, calling the same MCP server directly via curl
with identical parameters succeeds:
curl -X POST https://ai.todoist.net/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"update-tasks","arguments":{"tasks":[{"id":"xxx","content":"yyy"}]}}}'
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.71
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗