Skip to content

[BUG] "Invalid request parameters" on valid JSON-RPC call to "mcp" method #87

@a1030429800

Description

@a1030429800

Hello, I have been extensively debugging the communication protocol for excel-mcp-server. I have successfully implemented the two-step session handshake and can get a 200 OK response from the server, but the JSON-RPC message inside the response still contains an Invalid request parameters error.

This proves the connection, headers (Accept, mcp-session-id), and basic JSON-RPC structure are all correct. The issue seems to be with the validation of the params object.

Here is the final, robust PowerShell command that reproduces the issue. It successfully establishes a session but fails on parameter validation.

Steps to Reproduce:

Start the excel-mcp-server.

Make a pre-flight request to get a valid mcp-session-id from the response headers (e.g., 987573e176da4ed3a1ccaf483e96dac7).

Run the following PowerShell command, replacing the session ID with the one received in step 2.

PowerShell

$headers = @{
"Content-Type" = "application/json";
"Accept" = "application/json, text/event-stream";
"mcp-session-id" = "987573e176da4ed3a1ccaf483e96dac7" # Use a valid ID from the server
}

$body = '{
"jsonrpc": "2.0",
"method": "mcp",
"params": {
"tools": [
{
"server_name": "excel",
"name": "create_workbook",
"input": { "file_path": "test.xlsx" }
}
]
},
"id": 1
}'

$url = "YOUR_SERVER_URL/mcp"

Invoke-WebRequest -Uri $url -Method POST -Headers $headers -Body $body
Expected Result:
A 200 OK response with a JSON-RPC message containing the result of the tool call.

Actual Result:
A 200 OK response, but the content is a JSON-RPC error message:
data: {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"Invalid request parameters","data":""}}

The params object {"tools": [...]} seems to be causing a validation error, even though it appears to match the signature of the mcp method in the source code. Could you please investigate the parameter validation logic?

Thank you for your great work on this project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions