https://github.com/contextforge-org/contextforge-cli
ContextForge CLI
https://github.com/contextforge-org/contextforge-cli
Last synced: 5 months ago
JSON representation
ContextForge CLI
- Host: GitHub
- URL: https://github.com/contextforge-org/contextforge-cli
- Owner: contextforge-org
- License: apache-2.0
- Created: 2025-11-11T20:42:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-19T23:01:53.000Z (6 months ago)
- Last Synced: 2026-01-13T21:36:12.695Z (5 months ago)
- Language: Python
- Size: 298 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# ContextForge CLI
[](https://www.python.org/downloads/)
[](LICENSE)
**A command-line interface for managing [ContextForge MCP Gateway](https://github.com/IBM/mcp-context-forge)** — seamlessly manage local or hosted MCP servers, tools, resources, prompts, and Agent-to-Agent services.
> **Part of the [ContextForge](https://github.com/IBM/mcp-context-forge) ecosystem** by IBM
---
## Quick Start
### Installation
```bash
pip install git+https://github.com/contextforge-org/contextforge-cli.git
```
### First Steps
```bash
# Authenticate with your gateway
cforge login
# List available tools
cforge tools list
# Start a local gateway server
cforge serve
```
---
## Features
| 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 |
---
## Commands
### Authentication & Settings
```bash
cforge login # Authenticate with the gateway
cforge logout # Clear saved credentials
cforge whoami # Show current user
cforge version # Display CLI version
```
### Resource Management
To see the full set of available comands, use `cforge --help`. To see the options for a sub command, use `cforge --help`.
Here are some examples:
```bash
# Tools
cforge tools list [--mcp-server-id ID] [--json]
cforge tools get
cforge tools create [file.json]
cforge tools toggle
# Resources
cforge resources list
cforge resources create [file.json]
# Prompts
cforge prompts list
cforge prompts execute
# MCP Servers
cforge mcp-servers list
cforge mcp-servers update [file.json]
```
### Server Operations
```bash
# Start the gateway server
cforge serve [--host HOST] [--port PORT] [--reload]
# Configuration management
cforge export [--output file.json]
cforge import
cforge support-bundle # Generate diagnostics
```
### Output Options
Most commands support:
- `--json` — Output raw JSON instead of formatted tables
- `--mcp-server-id` — Filter by specific MCP server
- `--active-only` — Show only enabled items
---
## Configuration
### Environment Variables
| 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](https://ibm.github.io/mcp-context-forge/#complete-migration-guide).
---
## Development
### Setup
```bash
git clone https://github.com/contextforge-org/contextforge-cli.git
cd contextforge-cli
pip install -e ".[dev]"
```
### Running Tests
```bash
pytest
```
---
## Related Projects
- **[ContextForge MCP Gateway](https://github.com/IBM/mcp-context-forge)** — The gateway server this CLI manages
- **[MCP Specification](https://modelcontextprotocol.io/)** — Model Context Protocol documentation
---
## License
Apache 2.0 — See [LICENSE](LICENSE) for details.
---
## Contributing
Contributions welcome! Please see the [ContextForge contributing guidelines](https://github.com/IBM/mcp-context-forge/blob/main/CONTRIBUTING.md).