Skip to content

Latest commit

 

History

History
297 lines (224 loc) · 17.3 KB

File metadata and controls

297 lines (224 loc) · 17.3 KB

Mcp

Overview

Model Context Protocol endpoint.

Available Operations

mcpGet

Open a dedicated Server-Sent Events stream for MCP notifications

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()->build();


$requestSecurity = new Operations\StackoneMcpGetSecurity(
    basic: new Components\SchemeBasic(
        username: '',
        password: '',
    ),
);

$response = $sdk->mcp->mcpGet(
    security: $requestSecurity,
    mcpSessionId: '<id>',
    xAccountId: '<id>'

);

if ($response->statusCode === 200) {
    // handle response
}

Parameters

Parameter Type Required Description
security Operations\StackoneMcpGetSecurity ✔️ The security requirements to use for the request.
mcpSessionId string ✔️ Session id
xAccountId ?string Account secure id for the target provider account (optional if x-account-id query parameter is provided)
xAccountIdQueryParameter mixed Account secure id (alternative to x-account-id header)

Response

?Operations\StackoneMcpGetResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

mcpPost

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

Example Usage: initialize

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()->build();

$jsonRpcMessageDto = new Components\JsonRpcMessageDto(
    jsonrpc: '2.0',
    method: 'initialize',
    params: new Components\Params(),
    id: new Components\Id(),
);
$requestSecurity = new Operations\StackoneMcpPostSecurity(
    basic: new Components\SchemeBasic(
        username: '',
        password: '',
    ),
);

$response = $sdk->mcp->mcpPost(
    security: $requestSecurity,
    jsonRpcMessageDto: $jsonRpcMessageDto,
    xAccountId: '<id>'

);

if ($response->statusCode === 200) {
    // handle response
}

Example Usage: toolsCall

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()->build();

$jsonRpcMessageDto = new Components\JsonRpcMessageDto(
    jsonrpc: '2.0',
    method: 'tools/call',
    params: new Components\Params(),
    id: new Components\Id(),
);
$requestSecurity = new Operations\StackoneMcpPostSecurity(
    basic: new Components\SchemeBasic(
        username: '',
        password: '',
    ),
);

$response = $sdk->mcp->mcpPost(
    security: $requestSecurity,
    jsonRpcMessageDto: $jsonRpcMessageDto,
    xAccountId: '<id>'

);

if ($response->statusCode === 200) {
    // handle response
}

Example Usage: toolsList

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()->build();

$jsonRpcMessageDto = new Components\JsonRpcMessageDto(
    jsonrpc: '2.0',
    method: 'tools/list',
    params: new Components\Params(),
    id: new Components\Id(),
);
$requestSecurity = new Operations\StackoneMcpPostSecurity(
    basic: new Components\SchemeBasic(
        username: '',
        password: '',
    ),
);

$response = $sdk->mcp->mcpPost(
    security: $requestSecurity,
    jsonRpcMessageDto: $jsonRpcMessageDto,
    xAccountId: '<id>'

);

if ($response->statusCode === 200) {
    // handle response
}

Parameters

Parameter Type Required Description
security Operations\StackoneMcpPostSecurity ✔️ The security requirements to use for the request.
jsonRpcMessageDto Components\JsonRpcMessageDto ✔️ JSON-RPC 2.0 message
xAccountId ?string Account secure id for the target provider account (optional if x-account-id query parameter is provided)
xAccountIdQueryParameter mixed Account secure id (alternative to x-account-id header)
mcpSessionId ?string Session id; omit for initialize, include for subsequent calls

Response

?Operations\StackoneMcpPostResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

mcpDelete

Close an existing MCP session for the provided session id

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()->build();


$requestSecurity = new Operations\StackoneMcpDeleteSecurity(
    basic: new Components\SchemeBasic(
        username: '',
        password: '',
    ),
);

$response = $sdk->mcp->mcpDelete(
    security: $requestSecurity,
    mcpSessionId: '<id>',
    xAccountId: '<id>'

);

if ($response->statusCode === 200) {
    // handle response
}

Parameters

Parameter Type Required Description
security Operations\StackoneMcpDeleteSecurity ✔️ The security requirements to use for the request.
mcpSessionId string ✔️ Session id
xAccountId ?string Account secure id for the target provider account (optional if x-account-id query parameter is provided)
xAccountIdQueryParameter mixed Account secure id (alternative to x-account-id header)

Response

?Operations\StackoneMcpDeleteResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*