initialize
Negotiate the MCP protocol version and read the CoreSpeed server capabilities.
https://api.corespeed.io/mcpinitializeMost MCP clients send this automatically as their first call. It negotiates the protocol version and reports which capabilities the server exposes.
Authorizations
AuthorizationstringheaderrequiredBearer <token>— an MCP OAuth token, ask-cs-…API key, or a user session JWT.x-api-key: <sk-cs-…>is accepted in its place.Acceptstringheaderrequiredapplication/json, text/event-stream— the Streamable HTTP transport requires both media types even though CoreSpeed answers with JSON.Content-Typestringheaderrequiredapplication/json. The transport rejects anything else with415.
Request
protocolVersionstringrequiredThe version your client speaks. Supported:
2025-11-25(latest),2025-06-18,2025-03-26,2024-11-05,2024-10-07. An unsupported value is answered with the latest version instead of an error, so read the version in the response rather than assuming yours was accepted.capabilitiesobjectrequiredClient capabilities. Send
{}when your client has none to advertise.clientInfoobjectrequired{ "name": string, "version": string }. Part of the MCP handshake; the gateway does not copy it onto activity events, which are emitted pertools/call.
curl https://api.corespeed.io/mcp \
-H "Authorization: Bearer $CORESPEED_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": { "name": "my-agent", "version": "1.0.0" }
}
}'const res = await fetch("https://api.corespeed.io/mcp", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CORESPEED_API_KEY}`,
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "initialize",
params: {
protocolVersion: "2025-06-18",
capabilities: {},
clientInfo: { name: "my-agent", version: "1.0.0" },
},
}),
});
const { result } = await res.json();
console.log(result.protocolVersion, result.serverInfo);import os
import httpx
res = httpx.post(
"https://api.corespeed.io/mcp",
headers={
"Authorization": f"Bearer {os.environ['CORESPEED_API_KEY']}",
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream",
},
json={
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": {"name": "my-agent", "version": "1.0.0"},
},
},
)
result = res.json()["result"]
print(result["protocolVersion"], result["serverInfo"])package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]any{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": map[string]any{
"protocolVersion": "2025-06-18",
"capabilities": map[string]any{},
"clientInfo": map[string]any{"name": "my-agent", "version": "1.0.0"},
},
})
req, _ := http.NewRequest("POST", "https://api.corespeed.io/mcp", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("CORESPEED_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json, text/event-stream")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var out struct {
Result struct {
ProtocolVersion string `json:"protocolVersion"`
ServerInfo map[string]any `json:"serverInfo"`
} `json:"result"`
}
json.NewDecoder(res.Body).Decode(&out)
fmt.Println(out.Result.ProtocolVersion, out.Result.ServerInfo)
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"capabilities": {
"tools": { "listChanged": true }
},
"serverInfo": {
"name": "mcp-gateway",
"version": "1.0.0"
}
}
}