---
title: "创建MCP服务"
method: POST
path: "/mcp-services"
tags: ["MCP服务"]
---

# 创建MCP服务

`POST /mcp-services`

创建新的MCP服务配置

## Request body

- GithubComTencentWeKnoraInternalTypesMCPService
  - `advanced_config` GithubComTencentWeKnoraInternalTypesMCPAdvancedConfig
    - `retry_count` integer — Number of retries, default: 3
    - `retry_delay` integer — Delay between retries in seconds, default: 1
    - `timeout` integer — Timeout in seconds, default: 30
  - `auth_config` GithubComTencentWeKnoraInternalTypesMCPAuthConfig
    - `api_key` string
    - `api_key_header` string — APIKeyHeader is the header name that carries APIKey when AuthType is api_key. Empty defaults to "X-API-Key". This is non-secret structural config (the secret is APIKey), so it is not encrypted and is safe to echo back in responses. It lets services that expect the key in a different header (e.g. the raw token directly in "Authorization") work without resorting to plaintext custom headers.
    - `auth_server_metadata_url` string — AuthServerMetadataURL optionally pins the OAuth authorization server metadata URL. When empty, the server is discovered automatically from the MCP URL (RFC 9728 / RFC 8414).
    - `auth_type` '' | 'api_key' | 'bearer' | 'oauth'
    - `custom_headers` object
    - `scopes` string[] — Scopes are the OAuth scopes requested during authorization. Optional.
    - `token` string
  - `created_at` string
  - `deleted_at` GormDeletedAt
    - `time` string
    - `valid` boolean — Valid is true if Time is not NULL
  - `description` string
  - `enabled` boolean
  - `env_vars` GithubComTencentWeKnoraInternalTypesMCPEnvVars
  - `headers` GithubComTencentWeKnoraInternalTypesMCPHeaders
  - `id` string
  - `is_builtin` boolean — Whether this is a builtin MCP service (visible to all workspaces)
  - `name` string
  - `stdio_config` GithubComTencentWeKnoraInternalTypesMCPStdioConfig
    - `args` string[] — Command arguments array
    - `command` string — Command: "uvx" or "npx"
  - `tenant_id` integer
  - `transport_type` 'sse' | 'http-streamable' | 'stdio'
  - `updated_at` string
  - `url` string — Optional: required for SSE/HTTP Streamable

## Response `200`

创建的MCP服务

- object

## Other responses

- `400` — 请求参数错误

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/6e297e21afca/schema)
