Skip to content

mcp

Types

McpLoadResult

ts
export type McpLoadResult = {
  tools: any[];
  status: Record<string, string>
}

(source)

Effects

mcp::call

ts
effect mcp::call {
  server: string;
  tool: string;
  args: Record<string, any>
}

(source)

Functions

isMcpAvailable

ts
isMcpAvailable(): boolean

True when the @agency-lang/mcp package is installed and reachable.

Returns: boolean

(source)

readProjectMcpConfig

ts
readProjectMcpConfig(dir: string): Record<string, any>

Read the mcpServers block from the project agency.json under dir.

Parameters:

NameTypeDefault
dirstring

Returns: Record<string, any>

(source)

mergeMcpServers

ts
mergeMcpServers(
  global: Record<string, any>,
  project: Record<string, any>,
): Record<string, any>

Merge global and project mcpServers configs (project wins on collision).

Parameters:

NameTypeDefault
globalRecord<string, any>
projectRecord<string, any>

Returns: Record<string, any>

(source)

loadMcpTools

ts
loadMcpTools(merged: Record<string, any>, onOAuthRequired = null): any[]

Load gated MCP tools for every server in merged. Returns [] when the package is absent, incompatible, or no servers are configured.

Parameters:

NameTypeDefault
mergedRecord<string, any>
onOAuthRequirednull

Returns: any[]

(source)

loadMcpToolsWithStatus

ts
loadMcpToolsWithStatus(
  merged: Record<string, any>,
  onOAuthRequired = null,
): McpLoadResult

Like loadMcpTools, but also returns a per-server status map for /mcp.

Parameters:

NameTypeDefault
mergedRecord<string, any>
onOAuthRequirednull

Returns: McpLoadResult

(source)