Skip to content

Latest commit

 

History

History
664 lines (494 loc) · 23.9 KB

File metadata and controls

664 lines (494 loc) · 23.9 KB

MCP Client Support in AgentTools

This document explains how AgentTools supports different MCP client applications and how to install MCP servers into them.

Overview

AgentTools works with any MCP client that supports the stdio server transport. The server communicates via standard input/output using JSON-RPC messages, which is the most common transport mechanism for local MCP servers.

For convenience, InstallMCPServer and UninstallMCPServer functions are provided to automatically configure several popular client applications. These functions handle the different configuration file formats and locations used by each client.

Clients with InstallMCPServer Support

The following clients have built-in support for automatic configuration via InstallMCPServer:

Client Canonical Name Aliases Config Format Project Support Default Toolset
Amazon Q Developer "AmazonQ" "AmazonQDeveloper", "Q", "QDeveloper" JSON Yes "WolframLanguage"
Augment Code "AugmentCode" "Auggie", "Augment" JSON No "WolframLanguage"
Augment Code IDE "AugmentCodeIDE" "AugmentIDE", "AuggieIDE" JSON (array) No "WolframLanguage"
Claude Code "ClaudeCode" JSON Yes "WolframLanguage"
Claude Desktop "ClaudeDesktop" "Claude" JSON No "Wolfram"
Cline "Cline" JSON No "WolframLanguage"
Copilot CLI "CopilotCLI" "Copilot" JSON No "WolframLanguage"
Cursor "Cursor" JSON No "WolframLanguage"
Gemini CLI "GeminiCLI" "Gemini" JSON No "WolframLanguage"
Goose "Goose" YAML No "Wolfram"
Antigravity "Antigravity" "GoogleAntigravity" JSON No "WolframLanguage"
Junie (IDE + CLI) "Junie" "JetBrainsJunie" JSON Yes "WolframLanguage"
Kiro "Kiro" JSON Yes "WolframLanguage"
Codex CLI "Codex" "OpenAICodex" TOML Yes "WolframLanguage"
OpenCode "OpenCode" JSON Yes "WolframLanguage"
Visual Studio Code "VisualStudioCode" "VSCode" JSON Yes "WolframLanguage"
Windsurf "Windsurf" "Codeium" JSON No "WolframLanguage"
Zed "Zed" JSON Yes "WolframLanguage"

The Default Toolset is the predefined server used when InstallMCPServer/DeployAgentTools is called without an explicit server (or with Automatic). Coding clients default to "WolframLanguage"; chat clients (Claude Desktop, Goose) default to "Wolfram".

Usage

Basic Installation

Install an MCP server into a client application:

InstallMCPServer["ClaudeDesktop"]

This installs the client's default toolset into Claude Desktop's configuration file. Each client has its own default — Claude Desktop and Goose default to "Wolfram"; coding clients (Claude Code, Cursor, VS Code, etc.) default to "WolframLanguage". Pass Automatic explicitly for the same behavior, or pass a server name to override (see the table above for each client's default).

Installing a Specific Server

InstallMCPServer["ClaudeCode", "WolframLanguage"]

Project-Level Installation

For clients that support project-level configuration, use a {name, directory} specification:

InstallMCPServer[{"ClaudeCode", "/path/to/project"}]

This creates a .mcp.json file in the specified project directory.

Installing to a Custom File

InstallMCPServer[File["/custom/path/config.json"]]

For TOML files (Codex), the format is auto-detected from the .toml extension. For YAML files (Goose), the format is auto-detected from the .yaml or .yml extension.

Uninstalling

UninstallMCPServer["ClaudeDesktop"]              (* Remove all servers *)
UninstallMCPServer["ClaudeDesktop", "Wolfram"]   (* Remove specific server *)
UninstallMCPServer[myServerObject]               (* Remove from all locations *)

Client Configuration Details

Amazon Q Developer

Scope Config Location
Global ~/.aws/amazonq/mcp.json
Project .amazonq/mcp.json (in project root)

Format:

{
    "mcpServers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... }
        }
    }
}

Amazon Q Developer supports an optional timeout field (milliseconds, default 120000) per server entry. InstallMCPServer does not emit timeout; Amazon Q uses its default when absent. Runtime fields like disabled and per-tool auto-approve are managed through the Amazon Q IDE UI, not in mcp.json.

Claude Desktop

OS Config Location
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json

Format:

{
    "mcpServers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... }
        }
    }
}

Claude Code

Scope Config Location
Global ~/.claude.json
Project .mcp.json (in project root)

Format: Same as Claude Desktop (mcpServers key).

Cline

Cline stores its configuration in VS Code's extension global storage.

OS Config Location
macOS ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Format:

{
    "mcpServers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Note: Cline uses the standard mcpServers format with additional disabled and autoApprove fields. InstallMCPServer automatically adds these defaults.

Copilot CLI

Scope Config Location
Global ~/.copilot/mcp-config.json

Format:

{
    "mcpServers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... },
            "tools": ["*"]
        }
    }
}

Note: Copilot CLI requires the tools field to specify which tools to enable. InstallMCPServer automatically adds "tools": ["*"] to enable all tools.

Cursor

Scope Config Location
Global ~/.cursor/mcp.json

Format: Same as Claude Desktop (mcpServers key).

Gemini CLI

Scope Config Location
Global ~/.gemini/settings.json

Format: Same as Claude Desktop (mcpServers key).

Antigravity

Scope Config Location
Global ~/.gemini/antigravity/mcp_config.json

Format: Same as Claude Desktop (mcpServers key).

Augment Code

Scope Config Location
Global ~/.augment/settings.json

Format: Same as Claude Desktop (mcpServers key).

Note: Augment Code uses a single config file at ~/.augment/settings.json on all platforms (macOS, Windows, Linux). It supports stdio, HTTP, and SSE transports; InstallMCPServer writes the standard stdio form. Augment Code has no project-level MCP configuration — server entries can also be managed from the Auggie CLI via auggie mcp add / auggie mcp list / auggie mcp remove.

On Windows, InstallMCPServer automatically rewrites the command to its 8.3 short-path form (e.g. C:\PROGRA~1\WOLFRA~1\Wolfram\15.0\wolfram.exe) to work around a shell-invocation quirk where spaces in C:\Program Files\... cause cmd.exe to fail with 'C:\Program' is not recognized as an internal or external command.

Augment Code IDE

The Augment Code VS Code extension stores its MCP servers separately from the Auggie CLI. Use "AugmentCodeIDE" (not "AugmentCode") to target the extension.

OS Config Location
macOS ~/Library/Application Support/Code/User/globalStorage/augment.vscode-augment/augment-global-state/mcpServers.json
Windows %APPDATA%\Code\User\globalStorage\augment.vscode-augment\augment-global-state\mcpServers.json
Linux ~/.config/Code/User/globalStorage/augment.vscode-augment/augment-global-state/mcpServers.json

Format (JSON array at root, not mcpServers object):

[
    {
        "type": "stdio",
        "name": "ServerName",
        "command": "...",
        "args": ["..."],
        "env": { ... }
    }
]

Notes:

  • This is the only supported client whose config file is a JSON array at the root rather than an object with an mcpServers/servers/context_servers key. InstallMCPServer upserts by the name field inside each array entry.
  • The Windows 8.3 short-path coercion applied to the CLI variant ("AugmentCode") applies here too — the VS Code extension also shell-invokes the command on Windows.
  • No project-level MCP configuration — the VS Code extension reads a single global file.
  • After InstallMCPServer writes the file, VS Code may need to be reloaded (Ctrl+Shift+P → "Reload Window") for the extension to pick up the change.

If you primarily use the Auggie CLI instead of the VS Code extension, use "AugmentCode" — the two configurations are independent.

Goose

OS Config Location
macOS ~/.config/goose/config.yaml
Linux ~/.config/goose/config.yaml
Windows %APPDATA%\Block\goose\config\config.yaml

Format (YAML):

extensions:
  ServerName:
    name: ServerName
    cmd: "..."
    args: ["...", "..."]
    enabled: true
    envs:
      KEY: value
    type: stdio
    timeout: 300

Note: Goose uses YAML with an extensions key (not mcpServers) and renames several fields: commandcmd, envenvs. InstallMCPServer automatically adds the required name, enabled: true, type: stdio, and timeout: 300 fields. Goose has no project-level configuration.

Junie (JetBrains IDE plugin + Junie CLI)

Scope Config Location
Global ~/.junie/mcp/mcp.json
Project .junie/mcp/mcp.json (in project root)

Format: Same as Claude Desktop (mcpServers key).

Junie is JetBrains' AI coding agent. A single InstallMCPServer["Junie", ...] call covers both the JetBrains IDE plugin and the standalone Junie CLI — they read the same files. Specifically:

  • The user-scope file at ~/.junie/mcp/mcp.json is shared across every JetBrains IDE that hosts the Junie plugin (IntelliJ IDEA, PyCharm, WebStorm, GoLand, PhpStorm, RubyMine, RustRover, Rider, etc.) and the standalone junie CLI. There is no per-IDE config split.
  • The project-scope file at .junie/mcp/mcp.json (in the project root) is designed to be checked into version control and is read by the same plugin and CLI.
  • Junie auto-reloads mcp.json changes, so no IDE restart is needed after running InstallMCPServer.

Kiro

Scope Config Location
Global ~/.kiro/settings/mcp.json
Project .kiro/settings/mcp.json (in project root)

Format:

{
    "mcpServers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Note: Kiro uses the standard mcpServers format with optional disabled and autoApprove fields. InstallMCPServer automatically adds these defaults.

Codex CLI

Scope Config Location
Global ~/.codex/config.toml
Project .codex/config.toml (in project root)

Format (TOML):

[mcp_servers.ServerName]
command = "..."
args = ["..."]
enabled = true

[mcp_servers.ServerName.env]
KEY = "value"

Note: Project-level Codex configuration is stored in .codex/config.toml. This lets InstallMCPServer[{"Codex", "/path/to/project"}] install a server for just that project.

OpenCode

Scope Config Location
Global ~/.config/opencode/opencode.json
Project opencode.json (in project root)

Format:

{
    "mcp": {
        "ServerName": {
            "type": "local",
            "command": ["...", "arg1", "arg2"],
            "enabled": true,
            "environment": { ... }
        }
    }
}

Note: OpenCode uses a different format where the command and args are combined into a single command array.

Visual Studio Code

OS Config Location
macOS ~/Library/Application Support/Code/User/mcp.json
Windows %APPDATA%\Code\User\mcp.json
Linux ~/.config/Code/User/mcp.json
Project .vscode/mcp.json

Format:

{
    "servers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... }
        }
    }
}

Note: VS Code uses a dedicated mcp.json file with servers at the root level.

Windsurf

OS Config Location
macOS/Linux ~/.codeium/windsurf/mcp_config.json
Windows %USERPROFILE%\.codeium\windsurf\mcp_config.json

Format: Same as Claude Desktop (mcpServers key).

Zed

Scope Config Location
Global (macOS/Linux) ~/.config/zed/settings.json
Global (Windows) %APPDATA%\Zed\settings.json
Project .zed/settings.json

Format:

{
    "context_servers": {
        "ServerName": {
            "command": "...",
            "args": ["..."],
            "env": { ... }
        }
    }
}

Note: Zed uses context_servers instead of mcpServers. The inner server entry format is the same as Claude Desktop.

Using Other MCP Clients

AgentTools can be used with any MCP client that supports the stdio transport. If your client is not listed above, you can manually configure it using the server's command, arguments, and environment variables.

Server Configuration

The basic configuration requires:

Field Value
Command /full/path/to/wolfram (or wolfram.exe on Windows)
Arguments -run PacletSymbol["Wolfram/AgentTools","StartMCPServer"][] -noinit -noprompt

Environment Variables

Include these environment variables for proper operation:

Variable Description
MCP_SERVER_NAME Name of the MCP server to run (e.g. "WolframLanguage", optional)
WOLFRAM_BASE Path to Wolfram base directory ($BaseDirectory)
WOLFRAM_USERBASE Path to user's Wolfram files ($UserBaseDirectory)
APPDATA (Windows only) Path to application data (typically ParentDirectory[$UserBaseDirectory])
MCP_APPS_ENABLED Set to "false" to disable MCP Apps UI resources (optional)
MCP_TOOL_OPTIONS JSON string of tool option overrides, set automatically by "ToolOptions" (optional)

Getting the Configuration

You can generate the JSON configuration for manual use:

MCPServerObject["Wolfram"]["JSONConfiguration"]

This returns a JSON string with the complete server configuration that you can adapt to your client's format.

Setup Instructions

For clients not listed here, consult the MCP documentation or your client's documentation for instructions on configuring stdio-based MCP servers.

Options

DevelopmentMode

Controls how the MCP server is started:

Value Behavior
False (default) Uses the installed paclet via PacletSymbol
True Uses Scripts/StartMCPServer.wls from the current paclet location
"path/to/directory" Uses Scripts/StartMCPServer.wls from the specified directory

This is useful for testing local changes without reinstalling the paclet:

InstallMCPServer["ClaudeCode", "DevelopmentMode" -> True]

ProcessEnvironment

Specifies additional environment variables to include in the configuration:

InstallMCPServer["ClaudeCode", ProcessEnvironment -> <|"MY_VAR" -> "value"|>]

By default, InstallMCPServer includes:

  • MCP_SERVER_NAME
  • WOLFRAM_BASE
  • WOLFRAM_USERBASE
  • APPDATA (Windows only)

EnableMCPApps

Controls whether MCP Apps UI resources are enabled for the installed server:

Value Behavior
True (default) MCP Apps are enabled; the server will negotiate UI support with compatible clients
False MCP Apps are disabled; sets MCP_APPS_ENABLED=false in the server environment
InstallMCPServer["ClaudeDesktop", "EnableMCPApps" -> False]

MCPServerName

Controls the key used for the server entry in the client's configuration file:

Value Behavior
Automatic (default) Uses the server's "MCPServerName" property if set, otherwise falls back to "Name"
"CustomName" Uses the specified string as the config key

All built-in servers (Wolfram, WolframAlpha, WolframLanguage, WolframPacletDevelopment) share the config key "Wolfram" by default. This means installing one built-in server variant replaces any previously installed built-in variant in the same client — they are mutually exclusive configurations of the same Wolfram MCP server.

To install multiple built-in servers side by side, override the config key:

InstallMCPServer["ClaudeDesktop", "Wolfram", "MCPServerName" -> "WolframBasic"]
InstallMCPServer["ClaudeDesktop", "WolframLanguage", "MCPServerName" -> "WolframDev"]

User-created servers are unaffected — they continue to use their "Name" as the config key.

This option works with both InstallMCPServer and UninstallMCPServer. When uninstalling, use the same "MCPServerName" override that was used at install time:

(* Uninstall the "WolframDev" entry that was installed with a custom name *)
UninstallMCPServer["ClaudeDesktop", "WolframLanguage", "MCPServerName" -> "WolframDev"]

ToolOptions

Customizes the behavior of built-in MCP tools at install time. The value is an association mapping tool names to their option overrides:

InstallMCPServer["ClaudeCode", "WolframLanguage",
    "ToolOptions" -> <|
        "WolframLanguageEvaluator" -> <|"Method" -> "Local", "TimeConstraint" -> 120|>,
        "WolframLanguageContext"   -> <|"MaxItems" -> 20|>
    |>
]

Options are serialized to the MCP_TOOL_OPTIONS environment variable and read by the server at startup. See tools.md for the full list of per-tool options.

Unrecognized tool names or option names generate warnings but do not prevent installation (for forward compatibility).

VerifyLLMKit

Controls whether to check LLMKit subscription requirements:

Value Behavior
True (default) Warns or errors if tools require LLMKit subscription
False Skips the LLMKit check

ApplicationName

Specifies which MCP client the configuration file belongs to:

Value Behavior
Automatic (default) Auto-detects the client from the file path or content
"ClientName" Explicitly specifies the target client

This option works with both InstallMCPServer and UninstallMCPServer. It is useful when installing to a File[...] target where the client cannot be auto-detected from the path:

InstallMCPServer[File["config.json"], "ApplicationName" -> "Cline"]
UninstallMCPServer[File["config.json"], "ApplicationName" -> "Cline"]

Querying Supported Clients

The public variable $SupportedMCPClients provides an association of all supported client metadata. It can be used to programmatically query which clients are supported and inspect their configuration details.

(* List all supported client names *)
Keys[$SupportedMCPClients]
(* {"Antigravity", "ClaudeCode", "ClaudeDesktop", "Cline", "Codex", ...} *)

(* Get metadata for a specific client *)
$SupportedMCPClients["ClaudeDesktop"]
(* <|"Aliases" -> {"Claude"}, "ConfigFormat" -> "JSON", "ConfigKey" -> {"mcpServers"}, ...|> *)

Detecting Installed Clients

DetectedMCPClients[] returns the subset of $SupportedMCPClients whose user-scope config file exists on the current machine — a quick way to discover which supported clients are actually installed before calling InstallMCPServer.

(* Names of clients that appear to be installed locally *)
Keys @ DetectedMCPClients[ ]
(* {"ClaudeCode", "Cursor", "VisualStudioCode", ...} *)

(* Full metadata for detected clients *)
DetectedMCPClients[ ]
(* <|"ClaudeCode" -> <|...|>, "Cursor" -> <|...|>, ...|> *)

The result is keyed by canonical client name and preserves the ordering of $SupportedMCPClients. Detection is based purely on the existence of each client's "InstallLocation" config file for the current $OperatingSystem; project-scope config files ("ProjectPath") are not checked.

Adding Support for New Clients

All client configuration is centralized in $supportedMCPClients in Kernel/SupportedClients.wl. To add support for a new MCP client, add an entry to this association.

Client Entry Structure

Each entry is keyed by the canonical client name and contains an association with the following fields:

Field Required Description
"DisplayName" Yes Human-readable name shown to users
"Aliases" Yes List of alternative names (can be empty { })
"ConfigFormat" Yes File format: "JSON", "TOML", or "YAML"
"ConfigKey" Yes Key path to the servers section (e.g. {"mcpServers"} or {"servers"})
"URL" Yes Client's website or download page
"InstallLocation" Yes Config file path(s) per OS (see below)
"DefaultToolset" Yes Predefined server name to use when InstallMCPServer/DeployAgentTools is called with Automatic. Use "WolframLanguage" for coding-oriented clients and "Wolfram" for general-purpose chat clients.
"ProjectPath" No Relative path components for project-level config
"ServerConverter" No Function to transform the standard server entry into a client-specific format

Example Entry

"NewClient" -> <|
    "DisplayName"     -> "New Client",
    "DefaultToolset"  -> "WolframLanguage",
    "Aliases"         -> { "NC" },
    "ConfigFormat"    -> "JSON",
    "ConfigKey"       -> { "mcpServers" },
    "URL"             -> "https://newclient.example.com",
    "ProjectPath"     -> { ".newclient.json" },
    "InstallLocation" -> <|
        "MacOSX"  :> { $HomeDirectory, ".newclient", "config.json" },
        "Windows" :> { $HomeDirectory, "AppData", "Roaming", "NewClient", "config.json" },
        "Unix"    :> { $HomeDirectory, ".config", "newclient", "config.json" }
    |>
|>

If the install location is the same on all platforms, use a single RuleDelayed instead of a per-OS association:

"InstallLocation" :> { $HomeDirectory, ".newclient", "config.json" }

Custom Server Converters

If the client uses a non-standard server entry format, provide a "ServerConverter" function. This function receives a standard server association (with "command", "args", "env" keys) and should return the client-specific format. For example, Cline adds "disabled" and "autoApprove" fields:

convertToClineFormat[ server_Association ] := Enclose[
    Module[ { result },
        result = ConfirmBy[ server, AssociationQ, "Server" ];
        result[ "disabled" ] = False;
        result[ "autoApprove" ] = { };
        result
    ],
    throwInternalFailure
];

Related Files

  • Kernel/SupportedClients.wl - Supported MCP client definitions and format converters
  • Kernel/InstallMCPServer.wl - Installation and uninstallation implementation
  • Kernel/DeployAgentTools.wl - Managed deployment of agent tools (see deploy-agent-tools.md)
  • Kernel/CreateMCPServer.wl - Server creation and JSON configuration generation
  • Kernel/MCPServerObject.wl - Server object structure