The MCPC CLI provides a convenient way to run MCPC servers by loading configuration from files or URLs, supporting multiple transport types (stdio, HTTP, SSE).
You can run the CLI directly without installation using npx:
# Show help message
npx -y deno run -A jsr:@mcpc/cli/bin --help
# Run directly from JSR
npx -y deno run -A jsr:@mcpc/cli/bin --config-url <url>Or install it for repeated use:
# npm
npx jsr add @mcpc/cli
# deno
deno add jsr:@mcpc/cli
# pnpm
pnpm add jsr:@mcpc/cliThe CLI supports multiple ways to load configuration, checked in this order:
--config <json>- Inline JSON configuration string--config-url <url>- Fetch configuration from a URL--config-file <path>- Load configuration from a file path- Default - Uses
./mcpc.config.jsonif it exists
--help,-h- Show help message--config <json>- Inline JSON configuration string--config-url <url>- Fetch configuration from URL--config-file <path>- Load configuration from file path--request-headers <header>,-H <header>- Add custom HTTP header for URL fetching (can be used multiple times)- Format:
"Key: Value"or"Key=Value"
- Format:
Pass configuration directly as a JSON string:
npx -y deno run -A jsr:@mcpc/cli/bin --config '{
"name": "my-agent",
"version": "1.0.0",
"agents": [{
"name": "my-agent",
"description": "My agent description",
"deps": {
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": ["-y", "@wonderwhy-er/desktop-commander@latest"],
"transportType": "stdio"
}
}
}
}]
}'Load configuration from a remote URL (useful for sharing configurations):
# Load from GitHub
npx -y deno run -A jsr:@mcpc/cli/bin --config-url \
"https://raw.githubusercontent.com/mcpc-tech/mcpc/main/packages/cli/examples/configs/codex-fork.json"
# Load from URL with custom headers (e.g., authentication)
npx -y deno run -A jsr:@mcpc/cli/bin \
--config-url "https://api.example.com/config.json" \
-H "Authorization: Bearer token123" \
-H "X-Custom-Header: value"
# Multiple headers can be specified
npx -y deno run -A jsr:@mcpc/cli/bin \
--config-url "https://private-api.example.com/config.json" \
--request-headers "Authorization: Bearer ${API_TOKEN}" \
--request-headers "Accept: application/json"Load configuration from a local file:
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./my-config.jsonIf no configuration is specified, the CLI looks for ./mcpc.config.json:
# Uses ./mcpc.config.json if it exists
npx -y deno run -A jsr:@mcpc/cli/binConfiguration files support environment variable substitution using $VAR_NAME
syntax:
{
"name": "my-agent",
"agents": [{
"deps": {
"mcpServers": {
"github": {
"transportType": "streamable-http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer $GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
}]
}Set the environment variable before running:
export GITHUB_PERSONAL_ACCESS_TOKEN="ghp_your_token_here"
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./config.jsonCommunicates via standard input/output, suitable for integration with AI clients like Claude Desktop:
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./config.jsonRun as an HTTP server with SSE (Server-Sent Events) support:
# Using the server command
npx -y deno run -A jsr:@mcpc/cli/server --config-file ./config.json
# Server will start on http://localhost:3000 by defaultAccess endpoints:
GET /health- Health checkPOST /messages- Send messages to the agentGET /sse- Server-sent events streamGET /docs- OpenAPI documentation
Here's a complete example that creates a coding assistant agent:
Create codex-fork.json:
{
"name": "codex-fork-agent",
"version": "0.1.0",
"capabilities": {
"tools": {},
"sampling": {}
},
"agents": [
{
"name": "codex-fork-agent",
"description": "You are a coding assistant with advanced capabilities...\n\nAvailable tools:\n<tool name=\"desktop-commander.start_process\"/>\n<tool name=\"desktop-commander.read_file\"/>\n<tool name=\"desktop-commander.write_file\"/>",
"options": {
"mode": "agentic"
},
"deps": {
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": ["-y", "@wonderwhy-er/desktop-commander@latest"],
"transportType": "stdio"
},
"github": {
"transportType": "streamable-http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer $GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
}
]
}export GITHUB_PERSONAL_ACCESS_TOKEN="ghp_your_token_here"# Run with stdio transport
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./codex-fork.json
# Or run as HTTP server
npx -y deno run -A jsr:@mcpc/cli/server --config-file ./codex-fork.json{
"mcpServers": {
"my-agent": {
"command": "npx",
"args": [
"-y",
"deno",
"run",
"-A",
"jsr:@mcpc/cli/bin",
"--config-file",
"/path/to/config.json"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}A complete configuration file structure:
{
"name": "server-name",
"version": "1.0.0",
"capabilities": {
"tools": {},
"sampling": {}
},
"agents": [
{
"name": "agent-name",
"description": "Agent description with <tool name='server.tool'/> references",
"options": {
"mode": "agentic"
},
"deps": {
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "package-name"],
"transportType": "stdio"
},
"http-server": {
"transportType": "streamable-http",
"url": "https://api.example.com/mcp/",
"headers": {
"Authorization": "Bearer $API_TOKEN"
}
}
}
}
}
]
}If you're unsure about available options:
npx -y deno run -A jsr:@mcpc/cli/bin --helpMake sure to include the -A flag for all permissions:
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./config.jsonEnsure environment variables are exported before running:
export MY_VAR="value"
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./config.jsonCheck that the file path is correct and the file exists:
ls -l ./config.json
npx -y deno run -A jsr:@mcpc/cli/bin --config-file ./config.json- See complete configuration examples
- Learn about creating your first agentic MCP
- Explore example configurations