/mcp
command provides comprehensive management of MCP servers within Factory CLI, allowing you to configure, monitor, and maintain Model Context Protocol server connections.
Factory CLI currently only supports stdio-based MCP servers. Other transport types are not
supported at this time.
Overview
MCP (Model Context Protocol) servers extend Factory’s capabilities by providing additional tools and context. The/mcp
command lets you:
- List all configured MCP servers and their status
- Add new MCP servers to your configuration
- Remove existing servers
- View detailed information about specific servers
Usage
Global Options
Option | Description |
---|---|
-h, --help | Display help for command |
Available Commands
Command | Description |
---|---|
list | List configured MCP servers and their status |
add <name> <command> | Add a new MCP server to the configuration |
remove <name> | Remove an MCP server from the configuration |
get <name> | Show details about a specific MCP server |
help [command] | Display help for a specific command |
If no command is specified,
/mcp
defaults to the list
command.Commands
list
Lists all configured MCP servers and displays their current status.-h, --help
- Display help for the list command
add
Adds a new MCP server to your configuration.name
- Server name (used as identifier)command
- Command to start the server
-e, --env <key=value...>
- Environment variables (can be used multiple times)--transport <type>
- Transport type (defaults to “stdio”)-h, --help
- Display help for the add command
remove
Removes an MCP server from the configuration.name
- Server name to remove
-h, --help
- Display help for the remove command
get
Shows detailed information about a specific MCP server.name
- Server name to get details for
-h, --help
- Display help for the get command
Getting Help
You can get help for the/mcp
command and its subcommands in several ways:
/mcp --help
or/mcp -h
- Show general help/mcp help
- Show general help/mcp help <command>
- Show help for a specific command/mcp <command> --help
- Show help for a specific command
Configuration
MCP server configurations are stored in a configuration file managed by Factory CLI. Each server configuration includes:- Name: Unique identifier for the server
- Command: Shell command to start the server
- Environment Variables: Optional environment variables passed to the server
- Transport: Communication protocol (stdio only)
Stdio Transport
Factory CLI uses the stdio transport method for MCP servers, which means:- Communication happens over standard input/output streams
- Servers must implement the MCP protocol over stdin/stdout
- This is the most common and widely supported transport method for MCP servers
- No network configuration or ports are required
Environment Variables
When adding servers, you can specify environment variables using the-e
or --env
flag:
KEY=VALUE
format. If a value contains an equals sign, everything after the first =
is treated as the value.
Error Handling
The/mcp
command provides clear error messages for common issues:
- Invalid environment variable format: Check that variables use
KEY=VALUE
format - Server already exists: Use a different name or remove the existing server first
- Unsupported transport type: Only “stdio” transport is supported
- Unknown command: Use
/mcp --help
to see available commands - Missing arguments: Ensure all required arguments are provided
Examples
Here are some common usage patterns: List all servers:MCP servers extend Factory’s capabilities by providing additional tools and context. Make sure
your MCP servers are compatible with the Model Context Protocol specification and support stdio
transport.