> This page is for Agent Handler.

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

# Register a remote MCP server

POST https://ah-api.merge.dev/api/v1/connectors/
Content-Type: application/json

Registers a remote MCP server as a connector. Merge completes the MCP handshake against the server before anything is written, so either a connector exists with its tools discovered or nothing does.

`auth.type` accepts `none` and `secret`. OAuth is not yet supported.

Reference: https://docs.merge.dev/merge-agent-handler/agent-handler/connectors/connectors-create

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Request

### Body (application/json)

This endpoint expects a RemoteMCPConnectorCreatePublic.

- `name` (string, required) — Display name for the connector.
- `url` (string, required) — HTTPS URL of the remote MCP server. Immutable once set.
- `slug` (string, optional) — Identifier for the connector. Lowercase letters, digits and underscores. Derived from `name` when omitted.
- `headers` (map from string to string, optional) — Additional non-secret headers sent on every request. Write-only: the caller is the system of record for header state.
- `auth` (RemoteMCPAuthPublic, optional) — Defaults to `{"type": "none"}`.

## Response

### 200

- `id` (string, required) — Unique identifier for the Connector
- `name` (string, required) — Name of the Connector
- `slug` (string, required) — Slug identifier for the Connector
- `description` (string, required) — Description of what the Connector does
- `source_url` (string, required, nullable) — URL to the Connector's source website
- `logo_url` (string, required) — URL to the Connector's logo image
- `categories` (list of string, required, nullable) — Categories this connector belongs to
- `auth_options` (list of AuthOptionPublic, required) — Authentication options available for this connector
- `tools` (list of ConnectorTool, required) — List of available tools for this connector. By default each tool includes only name, description, and credit_type; pass include_tool_details=true on the detail endpoint to also include input_schema, output_schema, annotations, scopes, and endpoints.

### 201

- `id` (string, required) — Unique identifier for the Connector
- `name` (string, required) — Name of the Connector
- `slug` (string, required) — Slug identifier for the Connector
- `description` (string, required) — Description of what the Connector does
- `source_url` (string, required, nullable) — URL to the Connector's source website
- `logo_url` (string, required) — URL to the Connector's logo image
- `categories` (list of string, required, nullable) — Categories this connector belongs to
- `auth_options` (list of AuthOptionPublic, required) — Authentication options available for this connector
- `tools` (list of ConnectorTool, required) — List of available tools for this connector. By default each tool includes only name, description, and credit_type; pass include_tool_details=true on the detail endpoint to also include input_schema, output_schema, annotations, scopes, and endpoints.

## Errors

### 409 Conflict Error

- `map from string to any`

## Types

### RemoteMCPAuthPublic

How Merge authenticates to the remote MCP server.

- `type` (enum, optional, default: none) — `none` or `secret`. `oauth` is not yet supported.
  - Allowed values: `none`, `secret`, `oauth`
- `header` (RemoteMCPAuthHeaderPublic, optional) — Required when `type` is `secret`.

### AuthOptionPublic

- `type` (string, required)
- `secrets` (list of SecretSchemaPublic, required)

### ConnectorTool

Full version of ConnectorTool serializer with schemas and annotations.

- `name` (string, required) — Name of the tool
- `description` (string, required, nullable) — Description of what the tool does
- `credit_type` (string, required) — Credit type consumed by the tool
- `input_schema` (map from string to any, optional) — JSON Schema describing the tool's input parameters. Only returned when include_tool_details=true.
- `output_schema` (map from string to any, optional, nullable) — JSON Schema describing the tool's output. Omitted when the tool does not declare one. Only returned when include_tool_details=true.
- `annotations` (map from string to boolean, optional, nullable) — MCP annotation hints (e.g. read_only, destructive). Only returned when include_tool_details=true.
- `scopes` (list of string, optional, default: []) — Third-party API scopes required by the tool. Only returned when include_tool_details=true.
- `endpoints` (list of string, optional, default: []) — Third-party API endpoints the tool calls. Only returned when include_tool_details=true.

### RemoteMCPAuthHeaderPublic

The single header carrying a remote MCP server's API key.

- `key` (string, required) — Header name, e.g. `X-API-Key`.
- `value` (string, required) — Header value. Stored encrypted and never returned.

### SecretSchemaPublic

- `name` (string, required)
- `human_readable_name` (string, required, nullable)
- `field_type` (string, required)
- `options` (list of SecretSchemaPublicOptionsItems, required, nullable)
- `prefix` (string, optional, nullable)
- `suffix` (string, optional, nullable)

### SecretSchemaPublicOptionsItems

- `label` (string, required)
- `value` (string, required)
- `default` (boolean, required)

## Examples

### No authentication

**Request**

```json
{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "none"
  }
}
```

**Response**

```json
{
  "id": "084fce8e-43d3-472a-8227-e28553e73aa0",
  "name": "Acme MCP",
  "slug": "acme_mcp",
  "description": "",
  "source_url": "https://mcp.acme.com/mcp",
  "logo_url": "https://mintcdn.com/mcp/4ZXF1PrDkEaJvXpn/mcp.png?fit=max&auto=format&n=4ZXF1PrDkEaJvXpn&q=85&s=532f106faedf9079b75d2bdb69426588",
  "categories": [],
  "auth_options": [],
  "tools": [
    {
      "name": "search_docs",
      "description": "Search the Acme documentation corpus.",
      "credit_type": "simple"
    },
    {
      "name": "get_page",
      "description": "Fetch a single documentation page by id.",
      "credit_type": "simple"
    }
  ],
  "source": "external_mcp"
}
```

**SDK Code**

```python No authentication
import requests

url = "https://ah-api.merge.dev/api/v1/connectors/"

payload = {
    "name": "Acme MCP",
    "url": "https://mcp.acme.com/mcp",
    "auth": { "type": "none" }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript No authentication
const url = 'https://ah-api.merge.dev/api/v1/connectors/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Acme MCP","url":"https://mcp.acme.com/mcp","auth":{"type":"none"}}'
};

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

```go No authentication
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/connectors/"

	payload := strings.NewReader("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby No authentication
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/connectors/")

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  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}"

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

```java No authentication
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ah-api.merge.dev/api/v1/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}")
  .asString();
```

```php No authentication
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ah-api.merge.dev/api/v1/connectors/', [
  'body' => '{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "none"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp No authentication
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/connectors/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift No authentication
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": ["type": "none"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/connectors/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### API key in a header

**Request**

```json
{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "secret",
    "header": {
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    }
  }
}
```

**Response**

```json
{
  "id": "084fce8e-43d3-472a-8227-e28553e73aa0",
  "name": "Acme MCP",
  "slug": "acme_mcp",
  "description": "",
  "source_url": "https://mcp.acme.com/mcp",
  "logo_url": "https://mintcdn.com/mcp/4ZXF1PrDkEaJvXpn/mcp.png?fit=max&auto=format&n=4ZXF1PrDkEaJvXpn&q=85&s=532f106faedf9079b75d2bdb69426588",
  "categories": [],
  "auth_options": [],
  "tools": [
    {
      "name": "search_docs",
      "description": "Search the Acme documentation corpus.",
      "credit_type": "simple"
    },
    {
      "name": "get_page",
      "description": "Fetch a single documentation page by id.",
      "credit_type": "simple"
    }
  ],
  "source": "external_mcp"
}
```

**SDK Code**

```python API key in a header
import requests

url = "https://ah-api.merge.dev/api/v1/connectors/"

payload = {
    "name": "Acme MCP",
    "url": "https://mcp.acme.com/mcp",
    "auth": {
        "type": "secret",
        "header": {
            "key": "Authorization",
            "value": "Bearer YOUR_API_KEY"
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript API key in a header
const url = 'https://ah-api.merge.dev/api/v1/connectors/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Acme MCP","url":"https://mcp.acme.com/mcp","auth":{"type":"secret","header":{"key":"Authorization","value":"Bearer YOUR_API_KEY"}}}'
};

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

```go API key in a header
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/connectors/"

	payload := strings.NewReader("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby API key in a header
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/connectors/")

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  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}"

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

```java API key in a header
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ah-api.merge.dev/api/v1/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}")
  .asString();
```

```php API key in a header
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ah-api.merge.dev/api/v1/connectors/', [
  'body' => '{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "secret",
    "header": {
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp API key in a header
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/connectors/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift API key in a header
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": [
    "type": "secret",
    "header": [
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/connectors/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### No authentication

**Request**

```json
{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "none"
  }
}
```

**Response**

```json
{
  "id": "084fce8e-43d3-472a-8227-e28553e73aa0",
  "name": "Acme MCP",
  "slug": "acme_mcp",
  "description": "",
  "source_url": "https://mcp.acme.com/mcp",
  "logo_url": "https://mintcdn.com/mcp/4ZXF1PrDkEaJvXpn/mcp.png?fit=max&auto=format&n=4ZXF1PrDkEaJvXpn&q=85&s=532f106faedf9079b75d2bdb69426588",
  "categories": [],
  "auth_options": [],
  "tools": [
    {
      "name": "search_docs",
      "description": "Search the Acme documentation corpus.",
      "credit_type": "simple"
    },
    {
      "name": "get_page",
      "description": "Fetch a single documentation page by id.",
      "credit_type": "simple"
    }
  ],
  "source": "external_mcp"
}
```

**SDK Code**

```python No authentication
import requests

url = "https://ah-api.merge.dev/api/v1/connectors/"

payload = {
    "name": "Acme MCP",
    "url": "https://mcp.acme.com/mcp",
    "auth": { "type": "none" }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript No authentication
const url = 'https://ah-api.merge.dev/api/v1/connectors/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Acme MCP","url":"https://mcp.acme.com/mcp","auth":{"type":"none"}}'
};

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

```go No authentication
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/connectors/"

	payload := strings.NewReader("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby No authentication
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/connectors/")

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  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}"

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

```java No authentication
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ah-api.merge.dev/api/v1/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}")
  .asString();
```

```php No authentication
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ah-api.merge.dev/api/v1/connectors/', [
  'body' => '{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "none"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp No authentication
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/connectors/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"none\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift No authentication
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": ["type": "none"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/connectors/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### API key in a header

**Request**

```json
{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "secret",
    "header": {
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    }
  }
}
```

**Response**

```json
{
  "id": "084fce8e-43d3-472a-8227-e28553e73aa0",
  "name": "Acme MCP",
  "slug": "acme_mcp",
  "description": "",
  "source_url": "https://mcp.acme.com/mcp",
  "logo_url": "https://mintcdn.com/mcp/4ZXF1PrDkEaJvXpn/mcp.png?fit=max&auto=format&n=4ZXF1PrDkEaJvXpn&q=85&s=532f106faedf9079b75d2bdb69426588",
  "categories": [],
  "auth_options": [],
  "tools": [
    {
      "name": "search_docs",
      "description": "Search the Acme documentation corpus.",
      "credit_type": "simple"
    },
    {
      "name": "get_page",
      "description": "Fetch a single documentation page by id.",
      "credit_type": "simple"
    }
  ],
  "source": "external_mcp"
}
```

**SDK Code**

```python API key in a header
import requests

url = "https://ah-api.merge.dev/api/v1/connectors/"

payload = {
    "name": "Acme MCP",
    "url": "https://mcp.acme.com/mcp",
    "auth": {
        "type": "secret",
        "header": {
            "key": "Authorization",
            "value": "Bearer YOUR_API_KEY"
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript API key in a header
const url = 'https://ah-api.merge.dev/api/v1/connectors/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Acme MCP","url":"https://mcp.acme.com/mcp","auth":{"type":"secret","header":{"key":"Authorization","value":"Bearer YOUR_API_KEY"}}}'
};

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

```go API key in a header
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/connectors/"

	payload := strings.NewReader("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby API key in a header
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/connectors/")

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  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}"

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

```java API key in a header
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ah-api.merge.dev/api/v1/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}")
  .asString();
```

```php API key in a header
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ah-api.merge.dev/api/v1/connectors/', [
  'body' => '{
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": {
    "type": "secret",
    "header": {
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp API key in a header
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/connectors/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Acme MCP\",\n  \"url\": \"https://mcp.acme.com/mcp\",\n  \"auth\": {\n    \"type\": \"secret\",\n    \"header\": {\n      \"key\": \"Authorization\",\n      \"value\": \"Bearer YOUR_API_KEY\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift API key in a header
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Acme MCP",
  "url": "https://mcp.acme.com/mcp",
  "auth": [
    "type": "secret",
    "header": [
      "key": "Authorization",
      "value": "Bearer YOUR_API_KEY"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/connectors/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```