api.mcp

update()

api.mcp.update(name, { tools?, category?, token?, label?, url? }) → Promise<Server>

更改允许的工具、 许可类别、 符号、 标签或地址。 只有您所通过时被触动 。

PATCHtools replaces the lista new address is checked
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

toolsstring[]

替换 允许列表。 [] 不允许设置任何。

categorystring

read · write · exec.

tokenstring|null

新的代币,同样清洁 null 把它删除

labelstring

显示名称 。

urlstring

新地址—— 检查为新连接 。

// Allow two tools and nothing else
await api.mcp.update("example", { tools: ["search_docs", "get_issue"] });

// Make them free to call in auto mode
await api.mcp.update("example", { category: "read" });

// Rotate the token
await api.mcp.update("example", { token: process.env.EXAMPLE_TOKEN_NEW });

// Turn the server off without disconnecting it
await api.mcp.update("example", { tools: [] });
import os

# Allow two tools and nothing else
api.mcp.update("example", tools=["search_docs", "get_issue"])

# Make them free to call in auto mode
api.mcp.update("example", category="read")

# Rotate the token
api.mcp.update("example", token=os.environ["EXAMPLE_TOKEN_NEW"])

# Turn the server off without disconnecting it
api.mcp.update("example", tools=[])

替换工具, 它不添加

传递您想要的全部列表

发送一个名字时, 将允许使用一个工具。 要添加一个, 请在获取 () 时读取当前列表, 并随添加后寄回它 。

const server = await api.mcp.get("example");
const allowed = server.tools.filter((t) => t.allowed).map((t) => t.name);
await api.mcp.update("example", { tools: [...allowed, "create_issue"] });
server = api.mcp.get("example")
allowed = [t["name"] for t in server["tools"] if t["allowed"]]
api.mcp.update("example", tools=[*allowed, "create_issue"])

更改类别是许可决定

read 服务器的每一个工具都让服务器的每个工具都能够自由在每一个模式中呼用,但计划除外。 只有当您知道所有服务器都做什么时才设定它, 类别是服务器的,而不是工具的, 所以每读中写一个是足够的理由, 离开它 exec.

新的地址通过相同的检查

计划,它公开解决。 拒绝没有通过地址的地址 url_blocked 连接保持原样

关闭服务器

tools: [] 保留连接及其标记, 而不声明任何内容。 有助于阻止服务器的错误行为到达任何运行, 同时又不丢失证书 。