---
title: "Test Config"
method: POST
path: "/mcp-servers/test-config"
tags: ["mcp-servers"]
---

# Test Config

`POST /mcp-servers/test-config`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/mcp-servers/test-config`
- Auth: none declared

保存前先探测：用给定 transport+config **连一次但不落库**，返回连接状态/发现的工具/错误。
前端据此在连接成功后才允许保存。仅远程传输（同创建策略）。

## Request body

- TestConfigIn
  - `transport` string
  - `config` object

## Response `200`

Successful Response

- McpServerOut
  - `id` string, required
  - `name` string, required
  - `transport` string, required
  - `enabled` boolean, required
  - `config` object, required
  - `status` string, nullable
  - `last_error` string, nullable
  - `discovered_tools` unknown[], nullable
    - unknown
  - `last_checked_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
