MCP Gateway CLI & SDK
Enterprise-grade Model Context Protocol management for Claude Desktop
Manage MCP servers, workspaces, and configurations for Claude Desktop with enterprise security features.
Two ways to use:
- 🖥️ CLI: Command-line tool for interactive management
- 🐍 SDK: Python library for programmatic integration
🚀 Quick Start
Installation
pip install of-mcp
Note: Package name is of-mcp, CLI command is mcpgw
After installation, add to your PATH (if needed):
# Add to ~/.zshrc or ~/.bashrc
export PATH="$HOME/Library/Python/3.12/bin:$PATH"
Requirements: Python 3.9+
CLI Usage
1. Login
mcpgw auth login
# Enter your email and password
2. List Workspaces
mcpgw workspace list
3. Create Workspace
mcpgw workspace create --name "Production"
4. Add Backend
mcpgw backend add WORKSPACE_ID --name "Gmail" --url "http://gmail-mcp:9000"
5. Create Agent
mcpgw agent create WORKSPACE_ID --name "My Agent"
# Save the API key shown!
SDK Usage
Use of-mcp as a Python library in your applications:
from of_mcp import MCPGatewayClient
# Initialize client
client = MCPGatewayClient(token="your-token")
# Or login with email/password
client = MCPGatewayClient()
client.login(email="user@example.com", password="password")
# List workspaces
workspaces = client.workspaces.list()
print(workspaces)
# Create workspace
workspace = client.workspaces.create(name="Production", description="Prod environment")
print(f"Created workspace: {workspace['id']}")
# Add backend
backend = client.backends.add(
workspace_id=workspace['id'],
name="Gmail",
url="http://gmail-mcp:9000"
)
# List backends
backends = client.backends.list(workspace['id'])
# Create agent
agent = client.agents.create(
workspace_id=workspace['id'],
name="Email Agent",
description="Handles email operations"
)
print(f"Agent API key: {agent['api_key']}")
# Browse catalog
catalog = client.catalog.list(category="email")
# Enable catalog backend
enabled = client.catalog.enable(
workspace_id=workspace['id'],
backend_id="backend_gmail"
)
SDK Error Handling
from of_mcp import MCPGatewayClient, AuthenticationError, APIError
try:
client = MCPGatewayClient()
client.login(email="user@example.com", password="wrong-password")
except AuthenticationError as e:
print(f"Login failed: {e}")
except APIError as e:
print(f"API error ({e.status_code}): {e}")
SDK with Environment Variables
import os
from of_mcp import MCPGatewayClient
# Uses MCPGW_API_URL and MCPGW_TOKEN from environment
os.environ['MCPGW_API_URL'] = 'http://localhost:8000/api/v1'
os.environ['MCPGW_TOKEN'] = 'your-token'
client = MCPGatewayClient()
workspaces = client.workspaces.list()
CLI Commands
Authentication
mcpgw auth login # Login
mcpgw auth logout # Logout
mcpgw auth whoami # Show current user
Workspaces
mcpgw workspace list # List all workspaces
mcpgw workspace get WORKSPACE_ID # Get workspace details
mcpgw workspace create # Create new workspace
mcpgw workspace delete WORKSPACE_ID # Delete workspace
Backends
mcpgw backend list WORKSPACE_ID # List backends
mcpgw backend add WORKSPACE_ID --name X --url Y # Add backend
mcpgw backend remove WORKSPACE_ID BACKEND_ID # Remove backend
Backend Catalog
mcpgw catalog list # Browse catalog
mcpgw catalog list --category email # Filter by category
mcpgw catalog enable WORKSPACE_ID BACKEND_ID # Enable from catalog
Agents
mcpgw agent list WORKSPACE_ID # List agents
mcpgw agent create WORKSPACE_ID --name X # Create agent
Configuration
Config stored in ~/.mcpgw/config.json
Environment Variables
MCPGW_API_URL- API base URL (default: https://api.mcpgw.io/api/v1)MCPGW_PROFILE- Configuration profile to useMCPGW_TOKEN- Authentication token (for CI/CD)
Profiles
Manage multiple environments:
# Create profiles for different environments
mcpgw profile create staging --api-url https://staging.mcpgw.io/api/v1
mcpgw profile create local --api-url http://localhost:8000/api/v1
# List profiles
mcpgw profile list
# Switch between profiles
mcpgw profile use staging
# Show current profile
mcpgw profile current
Examples
Setup a new workspace
# Login
mcpgw auth login
# Create workspace
mcpgw workspace create --name "Production"
# Enable Gmail backend
WORKSPACE_ID="ws_abc123"
mcpgw catalog enable $WORKSPACE_ID backend_gmail
# Create an agent
mcpgw agent create $WORKSPACE_ID --name "Email Agent"
Get workspace info as JSON
mcpgw workspace list --json-output | jq '.[0]'
Development
# Install in development mode
cd cli
pip install -e .
# Run tests
pytest
# Build distribution
pipx run build
# Upload to PyPI
pipx run twine upload dist/*
📖 Documentation
- Environment Guide: ENVIRONMENT_GUIDE.md - Complete guide for multi-environment management
- Publishing Guide: PUBLISHING.md - How to publish to PyPI
- Distribution: DISTRIBUTION.md - Homebrew and package distribution
🔗 Links
- PyPI Package: https://pypi.org/project/of-mcp/
- Documentation: https://docs.mcpgw.io
- Website: https://mcpgw.io
- GitHub: https://github.com/orangefennec/mcp-gateway
- Support: support@mcpgw.io
📝 License
MIT License - see LICENSE for details
🤝 Contributing
Contributions welcome! See CONTRIBUTING.md
Made with ❤️ by Orange Fennec
Metadata
Release files for of-mcp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| of_mcp-0.1.2.tar.gz | 30.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| of_mcp-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.6 kB
Release files / of_mcp-0.1.2.tar.gz
| Download URL | of_mcp-0.1.2.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97d2b2b7ca84cee6d8e61d4927cbd72e864f2a4107618a8742945e0420dc06f1
|
|
BLAKE2b-256 checksum How to use checksums |
8efcf60f369523fb87e7d3933344b3b99fdd492a3c840d85650dc6b52e38f704
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / of_mcp-0.1.2-py3-none-any.whl
| Download URL | of_mcp-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45edc79d3a99815e446d3699d12d28f8e6bb137ef1f4abe820c78965020b3c1e
|
|
BLAKE2b-256 checksum How to use checksums |
d9b75cffed2854a648f9deed6e7352463f6d26f0aba3e8c4487f5885ec2ab7c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for of-mcp 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.