api.mcp

get()

api.mcp.get(name, { refresh? }) → Promise<Server>

One server with its tools. With refresh it shakes hands again, re-reads the catalogue from the server and records what came back.

free without refreshrefresh contacts the serverkeeps your choices
Using Python?

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

const server = await api.mcp.get("example");

for (const tool of server.tools) {
  console.log(tool.allowed ? "✓" : " ", tool.name, "—", tool.description);
}
server = api.mcp.get("example")

for tool in server["tools"]:
    print("✓" if tool["allowed"] else " ", tool["name"], "—", tool["description"])

Each tool

namestring

As the server calls it.

descriptionstring

What the model is told.

inputSchemaobject

Its parameters, as the server declared them.

allowedboolean

Whether it is declared to a model at all.

refresh re-reads the server

const server = await api.mcp.get("example", { refresh: true });
server = api.mcp.get("example", refresh=True)
Without refreshWith refresh
Contacts the servernoyes — handshake and tool list
Costsnothinga round trip
Updates the cataloguenoyes, and the agreed revision
Your allowed listunchangedkept
Refreshing never widens what is allowed

The tools you had allowed stay allowed, and new ones the server has added arrive disallowed. A server cannot grant itself more surface by shipping more tools.

When to refresh

  • A tool started failing with an argument error — its schema may have changed.
  • The server announced new tools you want to allow.
  • lastError shows something, and you want to know whether it is still true.

The token comes back to its owner

get() returns it, because the package needs it to contact the server. It is encrypted at rest and never leaves for anyone else — which is also why it is not in list().