Get MCP Server
Retrieve details for a specific MCP server.
GET
/
ai
/
mcp_servers
/
{mcp_server_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const mcpServer = await client.ai.mcpServers.retrieve('mcp_server_id');
console.log(mcpServer.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
mcp_server = client.ai.mcp_servers.retrieve(
"mcp_server_id",
)
print(mcp_server.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
mcpServer, err := client.AI.McpServers.Get(context.TODO(), "mcp_server_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mcpServer.ID)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.mcpservers.McpServerRetrieveParams;
import com.telnyx.sdk.models.ai.mcpservers.McpServerRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
McpServerRetrieveResponse mcpServer = client.ai().mcpServers().retrieve("mcp_server_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mcp_server = telnyx.ai.mcp_servers.retrieve("mcp_server_id")
puts(mcp_server)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$mcpServer = $client->ai->mcpServers->retrieve('mcp_server_id');
var_dump($mcpServer);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:mcp-servers retrieve \
--api-key 'My API Key' \
--mcp-server-id mcp_server_idcurl --request GET \
--url https://api.telnyx.com/v2/ai/mcp_servers/{mcp_server_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"api_key_ref": "<string>",
"allowed_tools": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the mcp server.
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const mcpServer = await client.ai.mcpServers.retrieve('mcp_server_id');
console.log(mcpServer.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
mcp_server = client.ai.mcp_servers.retrieve(
"mcp_server_id",
)
print(mcp_server.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
mcpServer, err := client.AI.McpServers.Get(context.TODO(), "mcp_server_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mcpServer.ID)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.mcpservers.McpServerRetrieveParams;
import com.telnyx.sdk.models.ai.mcpservers.McpServerRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
McpServerRetrieveResponse mcpServer = client.ai().mcpServers().retrieve("mcp_server_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mcp_server = telnyx.ai.mcp_servers.retrieve("mcp_server_id")
puts(mcp_server)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$mcpServer = $client->ai->mcpServers->retrieve('mcp_server_id');
var_dump($mcpServer);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:mcp-servers retrieve \
--api-key 'My API Key' \
--mcp-server-id mcp_server_idcurl --request GET \
--url https://api.telnyx.com/v2/ai/mcp_servers/{mcp_server_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"api_key_ref": "<string>",
"allowed_tools": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}