Skip to main content

Module config

Module config 

Source
Expand description

mcp.json: the MCP servers of the agent directory and, for trusted projects, of <project>/.yapi/mcp.json, in the mcpServers shape other MCP clients share. Project entries replace global ones of the same name. Port of extensions/mcp/config.ts and core/mcp-servers.ts in pi v1.0.0.

Structs§

LoadedConfig
Everything mcp.json files configure, and their problems.
OAuthConfig
pi’s McpOAuthConfig: OAuth client settings for servers that do not support dynamic client registration.
ServerConfig
One validated server entry.
ServerEntry
A configured server.

Enums§

ConfigPatch
pi’s McpServerConfigPatch: a setting /mcp changes.
McpExposure
pi’s McpExposure: how an MCP server’s tools reach the model.
Scope
Which file defined a server.
ServerTransport
How to reach a server.

Functions§

add_server_config
pi’s addMcpServerConfig: adds config as server name to the mcp.json at path, creating the file when missing. Returns whether an entry of that name was replaced.
check_registration
pi’s checks of server name, which an extension registers, against the servers that extensions of other runtimes registered: neither the name nor its tools’ namespace may be theirs. The error is pi’s.
load
Loads the global and, when trusted, the mcp.json of the project in project_dir. Disabled servers are included. With keep, as in a project-only run, the global file gives only the servers whose names match its patterns.
namespace
mcp__<server> with - as _, the prefix of the server’s tool names.
remove_server_config
pi’s removeMcpServerConfig: removes server name from the mcp.json at path. Returns false when the file does not define it.
resolve_exposure_aliases
pi’s resolveExposureAliases: raw with exposure aliases, in exposure and toolExposure, replaced by their current names.
update_server_config
pi’s updateMcpServerConfig: changes one setting of server name in the mcp.json at path. The defaults, enabled: true and exposure: "codemode", remove the key.
validate_server
pi’s validateMcpServerConfig: the entry, or an error message.