{
  "openapi": "3.0.3",
  "info": {
    "title": "Jupiter ERP MCP",
    "version": "1.0.0",
    "description": "MCP endpoint for an agent that already has an API token.\nOne HTTP POST carries a JSON-RPC 2.0 message (initialize, tools/list, tools/call, ping).\nAmounts inside tool results are integer cents, the same as the Account API.\nThe tool catalog is the read tools of the Jupiter AI assistant, limited by the token abilities.\nFinalizing, sending, cancelling, paying, and deleting are not tools.\n",
    "license": {
      "name": "Protected"
    }
  },
  "servers": [
    {
      "url": "https://api.jupiter-erp.com/",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "MCP"
    }
  ],
  "paths": {
    "/api/mcp": {
      "post": {
        "operationId": "handleMcpRequest",
        "tags": [
          "MCP"
        ],
        "summary": "Send one MCP JSON-RPC message",
        "description": "A personal access token from Profile, API and MCP requires the X-Account-Uuid header.\nWithout that header the response is 412.\nA token bound to one account can only be used for that account.\nA token without an account can select any account the user belongs to.\nAn OAuth access token is bound to the account chosen at consent.\nFor that token the header may be omitted. If it is sent, it must match the token account.\nSession tokens from the panel are rejected.\nThe account is never taken from a tool argument.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountUuidHeader"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result or error for a request that included an id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted notification (no id). Empty body."
          },
          "400": {
            "description": "The body is not a JSON-RPC request."
          },
          "401": {
            "description": "Missing or invalid access token."
          },
          "403": {
            "description": "Session token, MCP switched off, token limited to another account,\nuser is not a member of the account, or the account is blocked.\n"
          },
          "412": {
            "description": "A personal access token was sent without the X-Account-Uuid header.\nAn OAuth access token does not need the header.\n"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "parameters": {
      "AccountUuidHeader": {
        "name": "X-Account-Uuid",
        "in": "header",
        "required": false,
        "description": "Required for a personal access token.\nOptional for an OAuth access token, which already carries the account from consent.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "description": "String or integer. Omit or null for a notification.",
            "nullable": true
          },
          "method": {
            "type": "string",
            "enum": [
              "initialize",
              "ping",
              "tools/list",
              "tools/call"
            ]
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "description": "Echo of the request id.",
            "nullable": true
          },
          "result": {
            "description": "Present on success. Shape depends on the method."
          },
          "error": {
            "$ref": "#/components/schemas/JsonRpcError"
          }
        }
      },
      "JsonRpcError": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
