Initializing a Session
Session initialization is a three-step process:
- Send an
initializerequest. - The server returns a response with the MCP session ID.
- Send an
initializednotification to indicate you are ready to begin working with the MCP server tools.
Send an initialize request
Section link for Send an initialize requestUsing the Bearer token, send an initialize request to the Vault MCP Server specifying the MCP version and client information. The Vault MCP Server supports MCP versions 2024-11-05 and later.
curl 'https://myvault.veevavault.com/api/ai/mcp' \
--header 'Accept: application/json, text/event-stream' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data '{
"jsonrpc": "2.0", "id": 1, "method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": { "name": "my-agent", "version": "1.0.0" }
}
}'Save the session ID from the response header
Section link for Save the session ID from the response headerThe server response provides the Vault MCP Server version (protocolVersion) and the Mcp-Session-Id.
Mcp-Session-Id: 1868a90c-b249-4158-9a3c-396561f2510b
{
"result": {
"protocolVersion": "2024-11-05",
"serverInfo": { "name": "myvault.veevavault.com", "version": "26.1.3" },
"capabilities": { "tools": { "listChanged": false } }
}
}Send the initialized notification
Section link for Send the initialized notificationInclude Mcp-Session-Id on this request and all subsequent requests.
curl 'https://myvault.veevavault.com/api/ai/mcp' \
--header 'Authorization: Bearer {access_token}' \
--header 'Mcp-Session-Id: 1868a90c-b249-4158-9a3c-396561f2510b' \
--data '{ "jsonrpc": "2.0", "method": "notifications/initialized" }'
# Response: 202 AcceptedYou have successfully initialized the Vault MCP Server session.