> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send MCP JSON-RPC message

> Send JSON-RPC request to the MCP server over HTTP streaming transport



## OpenAPI

````yaml post /mcp
openapi: 3.1.0
info:
  title: StackOne
  description: The documentation for the StackOne API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.stackone.com
security: []
tags:
  - name: Accounts
    description: View and manage linked accounts.
  - name: Actions
    description: Retrieve Actions metadata and definitions.
  - name: AI
    description: AI-powered features.
  - name: Auth Configs
    description: View and manage connector auth configurations for the project.
  - name: Connect Sessions
    description: >-
      Generate connection session tokens or auth URLs to allow your customers to
      connect their accounts.
  - name: Connector Profiles
    description: View and manage connector profiles for the project.
  - name: Connectors
    description: Retrieve metadata for connectors.
  - name: Logs
    description: API request logs and analytics.
  - name: MCP
    description: Model Context Protocol endpoint.
  - name: Proxy
    description: Routing API requests through StackOne directly to the underlying provider.
  - name: Request Logs
    description: API requests and response logs.
  - name: Webhooks
    description: Configure and manage webhooks.
paths:
  /mcp:
    post:
      tags:
        - MCP
      summary: Send MCP JSON-RPC message
      description: Send JSON-RPC request to the MCP server over HTTP streaming transport
      operationId: stackone_mcp_post
      parameters:
        - name: x-account-id
          in: header
          description: >-
            Account secure id for the target provider account (optional if
            x-account-id query parameter is provided)
          required: false
          schema:
            type: string
        - name: instructions
          required: false
          in: query
          description: >-
            Server `instructions` (returned in the MCP initialize handshake)
            that teach the model the path/query/body/headers parameter envelope:
            "off" (default) omits them, "on" includes envelope guidance matched
            to the active param-style
          schema:
            enum:
              - 'on'
              - 'off'
            type: string
        - name: param-style
          required: false
          in: query
          description: >-
            Parameter schema style: "nested" (default) groups by location,
            "flat_prefixed" flattens with location prefix, "flat_smart" flattens
            and only prefixes on name collision
          schema:
            enum:
              - nested
              - flat_prefixed
              - flat_smart
            type: string
        - name: tool-mode
          required: false
          in: query
          description: >-
            Tool registration mode: "individual" (default) registers each action
            as a separate tool; "search_execute" registers two tools per linked
            account for a search-then-execute flow
          schema:
            enum:
              - individual
              - search_execute
            type: string
        - name: x-account-id
          required: false
          in: query
          description: Account secure id (alternative to x-account-id header)
          schema: {}
        - name: mcp-session-id
          in: header
          description: Session id; omit for initialize, include for subsequent calls
          required: false
          schema:
            type: string
        - name: Accept
          in: header
          description: >-
            Response format. Include text/event-stream to receive SSE,
            application/json for standard JSON, or both.
          required: false
          schema:
            type: string
            default: application/json, text/event-stream
            example: application/json, text/event-stream
      requestBody:
        required: true
        description: JSON-RPC 2.0 message
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcMessageDto'
            examples:
              initialize:
                summary: initialize — start a new session
                value:
                  jsonrpc: '2.0'
                  method: initialize
                  params:
                    clientInfo:
                      name: my-client
                      version: 1.0.0
                    protocolVersion: '2025-03-26'
                    capabilities: {}
                  id: init-1
              toolsList:
                summary: tools/list — list available tools
                value:
                  jsonrpc: '2.0'
                  method: tools/list
                  params: {}
                  id: list-1
              toolsCall:
                summary: tools/call — call a tool (individual mode)
                value:
                  jsonrpc: '2.0'
                  method: tools/call
                  params:
                    name: unified_hris_list_employees
                    arguments: {}
                  id: call-1
              toolsCallSearchExecute:
                summary: tools/call — search for an action (search_execute mode)
                value:
                  jsonrpc: '2.0'
                  method: tools/call
                  params:
                    name: googlecalendar_<account_id>_search_actions
                    arguments:
                      query: list calendar events
                      top_k: 1
                  id: search-1
              toolsCallExecuteAction:
                summary: tools/call — execute an action (search_execute mode)
                value:
                  jsonrpc: '2.0'
                  method: tools/call
                  params:
                    name: googlecalendar_<account_id>_execute_action
                    arguments:
                      action_name: googlecalendar_list_events
                      query_params:
                        calendarId: primary
                  id: execute-1
      responses:
        '200':
          description: Processed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  id:
                    oneOf:
                      - type: string
                      - type: number
                    nullable: true
                    description: >-
                      Echoes the id from the request. null for protocol-level
                      errors where the id could not be determined.
                  result:
                    nullable: true
                    description: >-
                      Present on success. Shape varies by method — see response
                      examples.
                  error:
                    type: object
                    description: >-
                      Present on protocol-level failure. Tool-level failures use
                      result with isError: true instead.
                    properties:
                      code:
                        type: number
                        example: -32600
                      message:
                        type: string
                        example: Invalid request
                      data:
                        description: Additional error context
                        nullable: true
              examples:
                initialize:
                  summary: initialize — session opened
                  value:
                    jsonrpc: '2.0'
                    id: init-1
                    result:
                      protocolVersion: '2025-03-26'
                      capabilities:
                        tools:
                          listChanged: true
                        resources: {}
                        prompts: {}
                      serverInfo:
                        name: stackone-mcp-server
                        version: 1.0.0
                toolsList:
                  summary: tools/list — tool listing
                  value:
                    jsonrpc: '2.0'
                    id: list-1
                    result:
                      tools:
                        - name: unified_hris_list_employees
                          description: List employees
                          inputSchema:
                            type: object
                            properties:
                              query:
                                type: object
                                properties:
                                  page_size:
                                    type: number
                                  next_cursor:
                                    type: string
                toolsCallSuccess:
                  summary: tools/call — success
                  value:
                    jsonrpc: '2.0'
                    id: call-1
                    result:
                      content:
                        - type: text
                          text: >-
                            {"isError":false,"result":{"data":[{"id":"emp_01","name":"Jane
                            Smith"}],"next_cursor":null}}
                      isError: false
                      structuredContent:
                        isError: false
                        result:
                          data:
                            - id: emp_01
                              name: Jane Smith
                          next_cursor: null
                toolsCallError:
                  summary: tools/call — tool-level error
                  value:
                    jsonrpc: '2.0'
                    id: call-1
                    result:
                      content:
                        - type: text
                          text: >-
                            {"isError":true,"result":{"error":"Resource not
                            found","status_code":404,"error_category":"not_found","retryable":false}}
                      isError: true
                      structuredContent:
                        isError: true
                        result:
                          error: Resource not found
                          status_code: 404
                          error_category: not_found
                          retryable: false
                protocolError:
                  summary: Protocol-level error
                  value:
                    jsonrpc: '2.0'
                    id: null
                    error:
                      code: -32600
                      message: Invalid request
            text/event-stream:
              schema:
                type: string
                description: >-
                  Server-Sent Events stream. Each event is a newline-delimited
                  frame containing a JSON-RPC message in the data field.
                example: >+
                  event: message

                  data:
                  {"jsonrpc":"2.0","id":"init-1","result":{"protocolVersion":"2025-03-26","capabilities":{},"serverInfo":{"name":"stackone-mcp-server","version":"1.0.0"}}}

        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '408':
          description: The request has timed out.
          headers:
            Retry-After:
              description: A time in seconds after which the request can be retried.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimedOutResponse'
        '409':
          description: Conflict with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Server error while executing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '501':
          description: This functionality is not implemented.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
        '502':
          description: Bad gateway error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
      security:
        - basic: []
        - ApiKey: []
components:
  schemas:
    JsonRpcMessageDto:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          description: JSON-RPC protocol version
        method:
          type: string
          example: initialize
          description: >-
            JSON-RPC method name. Supported values: initialize, tools/list,
            tools/call.
        params:
          type: object
          description: >-
            Method parameters. Shape varies by method — see the request body
            examples.
          nullable: true
        id:
          oneOf:
            - type: string
            - type: number
          nullable: true
          description: Request id (string or number). Echoed back in the response.
      required:
        - jsonrpc
        - method
    BadRequestResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Error message
          example: Bad Request
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
        data:
          description: Error details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/UnifiedError'
        provider_errors:
          description: List of provider-specific errors
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/ProviderError'
      required:
        - statusCode
        - message
        - timestamp
    UnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 401
        message:
          type: string
          description: Error message
          example: Unauthorized
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 403
        message:
          type: string
          description: Error message
          example: Forbidden resource
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotFoundResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 404
        message:
          type: string
          description: Error message
          example: Not Found
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    RequestTimedOutResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 408
        message:
          type: string
          description: Error message
          example: Request timed out
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
          example: Conflict
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnprocessableEntityResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 422
        message:
          type: string
          description: Error message
          example: Unprocessable Entity
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    TooManyRequestsResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 429
        message:
          type: string
          description: Error message
          example: Too many requests
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message
          example: Internal server error
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotImplementedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 501
        message:
          type: string
          description: Error message
          example: Not Implemented
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    BadGatewayResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 502
        message:
          type: string
          description: Error message
          example: Bad Gateway
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnifiedError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
          nullable: true
        message:
          type: string
          description: Error message
          example: Bad Request
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    ProviderError:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code of the provider error
          example: 400
          nullable: true
        url:
          type: string
          description: URL that caused the error
          example: https://api.provider.com/v1/resource
          nullable: true
        raw:
          type: object
          description: Raw error response from the provider
          example:
            message: Invalid input parameters
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
  securitySchemes:
    basic:
      type: http
      scheme: basic

````