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

# Send a JSON-RPC request to the MCP server

> Implements the MCP Streamable HTTP transport (spec 2025-03-26).

Accepts a JSON-RPC 2.0 message or batch array whose shape varies per method (`initialize`, `tools/call`, `resources/list`, etc.).

Include `mcp-session-id` to resume an existing session; omit it to start a new one.

The response may be a single JSON-RPC reply or an SSE stream depending on the request.



## OpenAPI

````yaml post /mcp
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /mcp:
    post:
      tags:
        - MCP
      summary: Send a JSON-RPC request to the MCP server
      description: >-
        Implements the MCP Streamable HTTP transport (spec 2025-03-26).


        Accepts a JSON-RPC 2.0 message or batch array whose shape varies per
        method (`initialize`, `tools/call`, `resources/list`, etc.).


        Include `mcp-session-id` to resume an existing session; omit it to start
        a new one.


        The response may be a single JSON-RPC reply or an SSE stream depending
        on the request.
      operationId: mcpHttpPost
      parameters:
        - schema:
            type: string
          required: false
          name: mcp-session-id
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                method:
                  type: string
                params: {}
                result: {}
                error:
                  type: object
                  properties:
                    code:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - message
                id:
                  anyOf:
                    - type: string
                    - type: number
                    - type: 'null'
              required:
                - jsonrpc
      responses:
        '200':
          description: JSON-RPC response or SSE stream of responses.
          content:
            application/json:
              schema: {}
            text/event-stream:
              schema:
                type: string
        '400':
          description: Missing or invalid request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '401':
          description: OAuth token missing or invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: Session belongs to a different user.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '404':
          description: No active session for the given session ID.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - oauth2: []
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.myhero.so/oauth/authorize
          tokenUrl: https://app.myhero.so/oauth/token
          scopes: {}

````