> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.phonic.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.phonic.co/_mcp/server.

# Get

GET https://api.phonic.ai/v1/mcp_servers/{nameOrId}

Returns an MCP server by name or ID.

Reference: https://docs.phonic.co/api-reference/mcp-servers/get

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication header of the form `Bearer <PHONIC_API_KEY>`. Manage your API keys [here](https://phonic.co/api-keys).

## Request

### Path parameters

- `nameOrId` (string, required) — The name or the ID of the MCP server to get.

### Query parameters

- `project` (string, optional, default: main) — The name of the project containing the MCP server. Only used when `nameOrId` is a name.

## Response

### 200

Success response

- `mcp_server` (McpServer, required) — A customer-hosted MCP server whose tools can be made available to agents.

## Errors

### 403 Forbidden Error

Forbidden (resource belongs to a different organization)

- `error` (BasicErrorError, optional)

### 404 Not Found Error

MCP server not found

- `error` (BasicErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (BasicErrorError, optional)

## Types

### McpServer

A customer-hosted MCP server whose tools can be made available to agents.

- `id` (string, required) — The ID of the MCP server.
- `project` (McpServerProject, required)
- `name` (string, required) — The name of the MCP server.
- `url` (string, required) — The URL of the MCP server.
- `header_names` (list of string, required) — Names of the headers sent to the MCP server. Header values are write-only and never returned.
- `tools` (list of McpServerTool, required) — Tools listed by the MCP server when it was created.

### BasicErrorError

- `message` (string, required) — Error message
- `code` (string, optional) — Error code

### McpServerProject

- `id` (string, required) — The ID of the project containing the MCP server.
- `name` (string, required) — The name of the project containing the MCP server.

### McpServerTool

A tool listed by an MCP server.

- `name` (string, required) — The name of the tool on the MCP server.
- `description` (string, required) — The description of the tool.
- `parameters` (McpServerToolParameters, required) — JSON Schema describing the tool's arguments.

### McpServerToolParameters

JSON Schema describing the tool's arguments.

- `type` (enum, required)
  - Allowed values: `object`
- `properties` (map from string to any, required)
- `required` (list of string, required)
- `additionalProperties` (boolean, required)

## Examples

**Response**

```json
{
  "mcp_server": {
    "id": "mcp_server_3f8b2c1d-6a4e-4b7f-9c2d-1e5a7b9c0d2f",
    "project": {
      "id": "proj_ad0334f1-2487-4155-9df3-abd8129b29ad",
      "name": "main"
    },
    "name": "crm_server",
    "url": "https://mcp.example.com/mcp",
    "header_names": [
      "Authorization"
    ],
    "tools": [
      {
        "name": "lookup_customer",
        "description": "Looks up a customer by phone number.",
        "parameters": {
          "type": "object",
          "properties": {
            "phone_number": {
              "type": "string",
              "description": "The customer's phone number."
            }
          },
          "required": [
            "phone_number"
          ],
          "additionalProperties": false
        }
      }
    ]
  }
}
```

**SDK Code**

```python Get MCP server response
import requests

url = "https://api.phonic.ai/v1/mcp_servers/nameOrId"

querystring = {"project":"main"}

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Get MCP server response
const url = 'https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Get MCP server response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Get MCP server response
require 'uri'
require 'net/http'

url = URI("https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <apiKey>'

response = http.request(request)
puts response.read_body
```

```java Get MCP server response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php Get MCP server response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Get MCP server response
using RestSharp;

var client = new RestClient("https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Get MCP server response
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.phonic.ai/v1/mcp_servers/nameOrId?project=main")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```