My product starts claude code/codex/cursor cli to finish some works. But cursor cli does not support add MCP server from command line parameter. Cursor sdk can do that , but we don’t want embed cursor in our product, which focus on main product features, only call agent to do separated works.
Hey, thanks for the request. A couple quick clarifications since part of this is already covered.
Cursor CLI can manage MCP servers from the terminal without embedding the SDK:
# Register an MCP server
agent mcp add <name> -- <command> [args...]
# List servers
agent mcp list
# Auto-approve MCPs in headless runs
agent --approve-mcps -p "..."
Also, the CLI picks up MCP config from .cursor/mcp.json at both the project level in the working directory and globally at ~/.cursor/mcp.json. So your product can just write .cursor/mcp.json into the working folder before running agent, and the server will be picked up. No SDK needed.
Docs: MCP | Cursor Docs
If you specifically need an ephemeral inline parameter to pass MCP server config in a single call without writing a file, like --mcp-config in Claude Code, there isn’t a flag for that right now. I’ll pass this as feedback to the team. Let me know if the .cursor/mcp.json option covers your use case, or if you really need a per-run flag.