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§
- Loaded
Config - Everything
mcp.jsonfiles configure, and their problems. - OAuth
Config - pi’s
McpOAuthConfig: OAuth client settings for servers that do not support dynamic client registration. - Server
Config - One validated server entry.
- Server
Entry - A configured server.
Enums§
- Config
Patch - pi’s
McpServerConfigPatch: a setting/mcpchanges. - McpExposure
- pi’s
McpExposure: how an MCP server’s tools reach the model. - Scope
- Which file defined a server.
- Server
Transport - How to reach a server.
Functions§
- add_
server_ config - pi’s
addMcpServerConfig: addsconfigas servernameto themcp.jsonatpath, 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.jsonof the project inproject_dir. Disabled servers are included. Withkeep, 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 servernamefrom themcp.jsonatpath. Returns false when the file does not define it. - resolve_
exposure_ aliases - pi’s
resolveExposureAliases:rawwith exposure aliases, inexposureandtoolExposure, replaced by their current names. - update_
server_ config - pi’s
updateMcpServerConfig: changes one setting of servernamein themcp.jsonatpath. The defaults,enabled: trueandexposure: "codemode", remove the key. - validate_
server - pi’s
validateMcpServerConfig: the entry, or an error message.