A command-line interface for managing ContextForge MCP Gateway — seamlessly manage local or hosted MCP servers, tools, resources, prompts, and Agent-to-Agent services.
Part of the ContextForge ecosystem by IBM
pip install git+https://github.com/contextforge-org/contextforge-cli.git# Authenticate with your gateway
cforge login
# List available tools
cforge tools list
# Start a local gateway server
cforge serve| Capability | Description |
|---|---|
| MCP Server Management | Register, configure, and monitor MCP server peers |
| Tool Operations | Create, update, toggle, and organize MCP tools |
| Resource Management | Manage MCP resources with subscription support |
| Prompt Library | Store, organize, and execute prompt templates |
| Virtual Servers | Build composite servers from multiple sources |
| A2A Integration | Manage and invoke Agent-to-Agent services |
| Config Import/Export | Backup and migrate gateway configurations |
cforge login # Authenticate with the gateway
cforge logout # Clear saved credentials
cforge whoami # Show current user
cforge version # Display CLI versionTo see the full set of available comands, use cforge --help. To see the options for a sub command, use cforge <command> --help.
Here are some examples:
# Tools
cforge tools list [--mcp-server-id ID] [--json]
cforge tools get <tool-id>
cforge tools create [file.json]
cforge tools toggle <tool-id>
# Resources
cforge resources list
cforge resources create [file.json]
# Prompts
cforge prompts list
cforge prompts execute <prompt-id>
# MCP Servers
cforge mcp-servers list
cforge mcp-servers update <mcp-server-id> [file.json]# Start the gateway server
cforge serve [--host HOST] [--port PORT] [--reload]
# Configuration management
cforge export [--output file.json]
cforge import <file.json>
cforge support-bundle # Generate diagnosticsMost commands support:
--json— Output raw JSON instead of formatted tables--mcp-server-id— Filter by specific MCP server--active-only— Show only enabled items
| Variable | Default | Description |
|---|---|---|
CONTEXTFORGE_HOME |
~/.contextforge |
Configuration directory |
MCG_HOST |
localhost |
Gateway host |
MCG_PORT |
8000 |
Gateway port |
Additionally, all configuration in mcpgateway can be set via the environment or via CONTEXTFORGE_HOME/.env. For full details, see the docs.
git clone https://github.com/contextforge-org/contextforge-cli.git
cd contextforge-cli
pip install -e ".[dev]"pytest- ContextForge MCP Gateway — The gateway server this CLI manages
- MCP Specification — Model Context Protocol documentation
Apache 2.0 — See LICENSE for details.
Contributions welcome! Please see the ContextForge contributing guidelines.