Skip to main content

CLI Commands

server

The server command manages the MCP gateway server for local model hosting and testing.

Usage

cogni server [COMMAND] [OPTIONS]

Description

The server command provides a suite of subcommands for managing the MCP gateway server. This server acts as a local proxy for MCP model servers, allowing you to test models and applications locally before deploying them to the cloud. The gateway server:
  • Manages local MCP model server instances
  • Routes API requests to the appropriate model server
  • Provides a unified endpoint for your applications
  • Handles authentication and request validation

Subcommands

SubcommandDescription
startStart the MCP gateway server
stopStop the MCP gateway server
statusShow the status of the MCP gateway server
restartRestart the MCP gateway server
configShow or modify the server configuration

Common Options

OptionDescription
--helpShow help message for the server command or subcommand

Examples

Start the Gateway Server

# Start the server with default settings
cogni server start

# Start the server on a specific port
cogni server start --port 9000

# Start the server with verbose logging
cogni server start --verbose

Check Server Status

# Check if the server is running
cogni server status

Stop the Server

# Stop the running server
cogni server stop

# Force stop the server
cogni server stop --force

Server Configuration

# Show current server configuration
cogni server config

# Set a configuration value
cogni server config set port 9000

Output

For the start command:
Starting MCP gateway server...
Server is running on http://localhost:8080
Service timeout set to 300 seconds
Ready to serve MCP model requests
For the status command:
MCP gateway server is running
PID: 12345
Uptime: 2 hours, 15 minutes
Port: 8080
Running models: 2 (gpt4-mini, llama3)
For the stop command:
Stopping MCP gateway server...
Server stopped successfully

Server Configuration

The server uses the configuration from your Cogni+ config file, which can be modified with the cogni init command or directly with cogni server config. Key configuration options include:
  • Port number (default: 8080)
  • Service idle timeout (default: 300 seconds)
  • Docker registry URL
  • Log level
  • cogni logs - View logs from running servers
  • cogni init - Configure server settings during CLI setup

Tips

  • The gateway server must be running for most local development tasks
  • For production deployments, publish your models to the Cogni+ Platform instead
  • If port conflicts occur, use cogni server start --port to specify a different port
  • Use cogni server restart when changing configuration for the changes to take effect