CSharp (SDK)
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Llm.McpVault.AuthorizeServerOAuthAsync(
serverId: "mcp_srv_aa87e2b1112a455b8deabed784372198",
body: new McpOAuthAuthorizeRequest() {
RedirectUri = "https://app.example.com/oauth/callback",
}
);
// handle responsefrom meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.mcp_vault.authorize_server_o_auth(server_id="mcp_srv_aa87e2b1112a455b8deabed784372198", redirect_uri="https://app.example.com/oauth/callback")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.mcpVault.authorizeServerOAuth({
serverId: "mcp_srv_aa87e2b1112a455b8deabed784372198",
mcpOAuthAuthorizeRequest: {
redirectUri: "https://app.example.com/oauth/callback",
},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.Llm.McpVault.AuthorizeServerOAuth(ctx, "mcp_srv_aa87e2b1112a455b8deabed784372198", components.McpOAuthAuthorizeRequest{
RedirectURI: "https://app.example.com/oauth/callback",
}, nil)
if err != nil {
log.Fatal(err)
}
if res.McpOAuthAuthorization != nil {
// handle response
}
}curl --request POST \
--url https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://app.example.com/oauth/callback"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirect_uri: 'https://app.example.com/oauth/callback'})
};
fetch('https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'redirect_uri' => 'https://app.example.com/oauth/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://app.example.com/oauth/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirect_uri\": \"https://app.example.com/oauth/callback\"\n}"
response = http.request(request)
puts response.read_body{
"object": "mcp.oauth.authorization",
"server_id": "mcp_srv_aa87e2b1112a455b8deabed784372198",
"authorization_url": "https://linear.app/oauth/authorize?response_type=code&client_id=linear-oauth-client&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fapp.example.com%2Foauth%2Fcallback&state=1sXq3n0d8Vb4yZ2kR7pL9tW5mC6hJ3fA0eG8uN1oQ4s&scope=read+write",
"expires_at": "2026-04-29T12:10:00.000Z"
}MCP Vault
Start MCP server OAuth authorization
Starts connecting an MCP server with OAuth as the caller: an end user on their developer’s server shared with end users, or the server’s owner. Returns the provider authorization URL to open in the end user’s browser; its state is single-use and expires after 10 minutes. redirect_uri must equal one of the server’s OAuth redirect_uris.
POST
/
api
/
v1
/
llm
/
mcp
/
servers
/
{server_id}
/
oauth
/
authorize
CSharp (SDK)
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Llm.McpVault.AuthorizeServerOAuthAsync(
serverId: "mcp_srv_aa87e2b1112a455b8deabed784372198",
body: new McpOAuthAuthorizeRequest() {
RedirectUri = "https://app.example.com/oauth/callback",
}
);
// handle responsefrom meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.mcp_vault.authorize_server_o_auth(server_id="mcp_srv_aa87e2b1112a455b8deabed784372198", redirect_uri="https://app.example.com/oauth/callback")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.mcpVault.authorizeServerOAuth({
serverId: "mcp_srv_aa87e2b1112a455b8deabed784372198",
mcpOAuthAuthorizeRequest: {
redirectUri: "https://app.example.com/oauth/callback",
},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.Llm.McpVault.AuthorizeServerOAuth(ctx, "mcp_srv_aa87e2b1112a455b8deabed784372198", components.McpOAuthAuthorizeRequest{
RedirectURI: "https://app.example.com/oauth/callback",
}, nil)
if err != nil {
log.Fatal(err)
}
if res.McpOAuthAuthorization != nil {
// handle response
}
}curl --request POST \
--url https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://app.example.com/oauth/callback"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirect_uri: 'https://app.example.com/oauth/callback'})
};
fetch('https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'redirect_uri' => 'https://app.example.com/oauth/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://app.example.com/oauth/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/mcp/servers/{server_id}/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirect_uri\": \"https://app.example.com/oauth/callback\"\n}"
response = http.request(request)
puts response.read_body{
"object": "mcp.oauth.authorization",
"server_id": "mcp_srv_aa87e2b1112a455b8deabed784372198",
"authorization_url": "https://linear.app/oauth/authorize?response_type=code&client_id=linear-oauth-client&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fapp.example.com%2Foauth%2Fcallback&state=1sXq3n0d8Vb4yZ2kR7pL9tW5mC6hJ3fA0eG8uN1oQ4s&scope=read+write",
"expires_at": "2026-04-29T12:10:00.000Z"
}Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Headers
Optional external end-user identifier forwarded by the API gateway.
Path Parameters
Body
application/json
Where the provider sends the end user back. Must equal one of the server's oauth.redirect_uris exactly.
Required string length:
1 - 2048Was this page helpful?
⌘I