Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to Initialize MCP server connection

Mason Gao
May 5, 2026

Hi
Im trying to build a custom Rovo Mcp client using it's API endpoint, this is the request I send to initialize the MCP session
URI: https://mcp.atlassian.com/v1/mcp
Headers:
Accept: application/json, text/event-stream

Cache-Control: no-cache

Content-type: application/json

MCP-Protocol-Version: 2025-06-18

Authorization: Bearer <My Oauth token>

Body:

{
"jsonrpc" : "2.0",
"method" : "initialize",
"id" : "<my ID>",
"params" : {
"protocolVersion" : "2025-06-18",
"capabilities" : { },
"clientInfo" : {
"name" : "agentscope-java",
"title" : "AgentScope Java Framework",
"version" : "1.0.9"
}
}
}

The response shows it is not a valid initialize request 
Status Code:
400
Body:
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Request must be an initialize request if no session ID is provided."}}

The request I sent to mcp server is constructed by agentScope framework, which utilize following maven package to encapsulate the request 

<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.17.0</version>
<scope>compile</scope>
</dependency>


Is there anything missing for my initialize request? Much appreciate for your suggestions. 

1 comment

Comment

Log in or Sign up to comment
Mason Gao
May 6, 2026

Update, it seems working if I dont specify content type in the header, however, server will send a request back with status code 202, and content-type "text/plain". 
The MCP package for java cannot process request with content type other than application/json and text/event-stream(and header send by server does not specify content length so it wont be treated as empty content), so it would throw a exception for it. Are there any methods to make server return only application/json or text/event-stream? or any methods to send request so it can force server to send content length back

  Groupid: io.modelcontextprotocol.sdk
Artifact id: mcp
Version: 0.17.0
TAGS
AUG Leaders

Atlassian Community Events