CLI usage¶
The CLI can serve a compressed MCP server or start helper modes that create local command/code clients.
Standard MCP proxy¶
mcp-compressor -c medium -- python server.py
Compression level shorthand:
mcp-compressor -c low -- python server.py
mcp-compressor -c medium -- python server.py
mcp-compressor -c high -- python server.py
mcp-compressor -c max -- python server.py
Custom server name¶
mcp-compressor -c medium --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
The first run opens a browser for OAuth if no stored credentials exist.
Streamable HTTP frontend¶
mcp-compressor -c medium --transport streamable-http --port 9000 -- python server.py
CLI mode¶
CLI mode writes a shell script that calls the live local session created by mcp-compressor.
mcp-compressor --cli-mode --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
Then run commands through the generated script:
atlassian --help
atlassian get-accessible-atlassian-resources
Use an explicit output directory:
mcp-compressor --cli-mode --server-name alpha --output-dir ./bin -- python server.py
Code Mode¶
Code Mode generates Python or TypeScript functions for backend MCP tools while keeping the local mcp-compressor session alive. By default, generated Code Mode files are written under ./dist in the current working directory.
mcp-compressor --code-mode python --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
mcp-compressor --code-mode typescript --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
See Code Mode and generated clients for examples of generated functions and agent usage.
Just Bash mode¶
mcp-compressor --just-bash-mode --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
Just Bash mode lets language hosts register MCP tools as shell-style commands. See Just Bash.